262
CHAPTER 9 EXTERNAL INTERRUPT CIRCUIT 1 (EDGE)
9.4
External Interrupt Circuit 1 Interrupts
The external interrupt circuit 1 can generate interrupt requests when it detects a
specified edge on the signal input to an external interrupt pin.
s Interrupts for External Interrupt Circuit 1 Operation
If external interrupts are enabled (EIE1: IE10 to IE30 = 1) and the specified edge is detected at
the external interrupt input, the corresponding external IRQ flag bit (EIF1: IF10 to IF13) is set to
"1" and the corresponding IRQ (IRQ0 to IRQ3) sent to the CPU. Write "0" to the corresponding
external interrupt request flag bit in the interrupt processing routine to clear the interrupt request.
Check:
When enabling interrupts (EIE1: IE10 to IE13 = "1") after wake-up from a reset, always clear
the corresponding external interrupt request flag bit (EIE1: IF10 to IF13 = "0") in advance.
Also, interrupt processing cannot return if the external interrupt request flag bit is "1" and the
interrupt request enable bit is enabled. In the interrupt processing routine, always clear the
external interrupt request flag bit.
Notes:
Changing a signal inversion bit from the "non-invert" to the "invert" state while the INT pin is
"H", or from "invert" to "non-invert" while the pin is LOW, will cause the external interrupt
request flag bit (EIF1: IF10 to IF13) to be set immediately. Changing an external interrupt bit
from "disable" to "enable" (EIE1: IE10 to IE13: 0 --> 1) may also set the external IRQ flag bit.
For this reason, you should make the inversion or enable bit changes with interrupts in the
disabled state, then clear IRQ flags before enabling interrupts again.
An interrupt request is generated immediately if the external interrupt request flag bit is "1"
when the external interrupt enable bit is changed from disabled to enabled ("0" --> "1").
Wake-up from stop mode by an interrupt is possible using only the external interrupt circuit 1
and 2.
Perform with interrupts disabled, then clear external IRQ flags before enabling interrupts.