Chapter 3
Interrupts
External Interrupts III - 47
3.3.4 Key Interrupt
Key interrupt (KEYIRQn) pin can be selected with the KEYIEN and KEYSEL. KEYIRQn is generated when one
of the KEYIRQ pins goes from "High" to "Low".
Setting example of KEYIRQ
The following example shows how to use P10, P11, P12 and P13 as KEYIRQ pins and generate IRQ7.
3.3.5 Noise Filter Function
Noise Filter (NF) controlled with NFCTR01, NFCTR23, NFCTR45 and NFCTR67 is available to eliminate input
noise at the external interrupt pins (IRQn). NF samples the input signal at IRQn, and when the input signal is sam-
pled three times and the level of it is not changed, the signal can pass through NF.
Figure:3.3.1 Eliminating input noise at IRQn with NF
..
NF cannot be used in STOP or HALT mode. When an IRQn is used as the trigger to return
from the STOP or HALT mode, NF of the IRQn must not be used.
..
Step Settings Register Description
1
Set the input direction of
P10, P11, P12 and P13
P1DIR Set P1DIR.P1DIR3-0 to "0000".
2 Add the pull-up resistors P1PLUP Set P1PLUP.P1PLU3-0 to "1111".
3
Set P10, P11, P12 and P13 as
KEYIRQ pins.
KEYSEL
KEYIEN
Set KEYSEL.KEYSEL3-0 to "0000".
Set KEYIEN.KEYEN3-0 to "1111".
4
Set the Interrupt level of IRQ7 IRQ7ICR Set IRQ7ICR.LV1-0 as you like.
* IRQ7ICR.IR should be set to "0".
5 Enable IRQ7 IRQ7ICR Set IRQ7ICR.IE to "1".
NF Sampling timing
Input signal at IRQn
Signal passed through NF