80
4.3.3
External Interrupts
The nine external interrupts are NMI and IRQ
0
to IRQ
7
. NMI, IRQ
0
, IRQ
1
, IRQ
2
, and IRQ
6
can be
used to recover from software standby mode.
NMI:
A nonmaskable interrupt is generated on the rising or falling edge of the
NMI
input signal
regardless of whether the I (interrupt mask) bit is set in the CCR. The valid edge is selected by the
NMIEG bit in the system control register. The NMI vector number is 3. In the NMI hardware
exception-handling sequence the I bit in the CCR is set to 1.
IRQ
0
to IRQ
7
:
These interrupt signals are level-sensed or sensed on the falling edge of the input,
as selected by ISCR bits IRQ0SC to IRQ7SC. These interrupts can be masked collectively by the I
bit in the CCR, and can be enabled and disabled individually by setting and clearing bits IRQ0E to
IRQ7E in the IRQ enable register.
The
IRQ
6
input signal can be logically ORed internally with the key sense input signals. When
KEYIN
0
to
KEYIN
7
pins (P6
0
to P6
7
) are used for key sense input, the corresponding KMIMR bits
should be cleared to 0 to enable the corresponding key sense input interrupts. KMIMR bits
corresponding to unused key sense inputs should be set to 1 to disable the interrupts. All 8 key
sense input interrupts are combined into a single IRQ
6
interrupt.
When one of these interrupts is accepted, the I bit is set to 1. IRQ
0
to IRQ
7
have interrupt vector
numbers 4 to 11. They are prioritized in order from IRQ
7
(low) to IRQ
0
(high). For details, see
table 4.2.
Interrupts IRQ
0
to IRQ
7
do not depend on whether pins
IRQ
0
to
IRQ
7
are input or output pins.
When using external interrupts IRQ
0
to IRQ
7
, clear the corresponding DDR bits to 0 to set these
pins to the input state, and do not use these pins as input or output pins for the timers, serial
communication interface, or A/D converter.
4.3.4
Internal Interrupts
Twenty-six (H8/3337 Series) or twenty-three (H8/3397 Series) internal interrupts can be requested
by the on-chip supporting modules. Each interrupt source has its own vector number, so the
interrupt-handling routine does not have to determine which interrupt has occurred. All internal
interrupts are masked when the I bit in the CCR is set to 1. When one of these interrupts is
accepted, the I bit is set to 1 to mask further interrupts (except
NMI
). The vector numbers are 12 to
37. For the priority order, see table 4.2.