Specifications

83
3706C–MICRO–2/11
AT89LP3240/6440
another interrupt will be generated. Both INT0 and INT1 may wake up the device from the
Power-down state.
15. General-purpose Interrupts
The General-purpose Interrupt (GPI) function provides 8 configurable external interrupts on
Port 1. Each port pin can detect high/low levels or positive/negative edges. The GPIEN register
select which bits of Port 1 are enabled to generate an interrupt. The GPMOD and GPLS regis-
ters determine the mode for each individual pin. GPMOD selects between level-sensitive and
edge-triggered mode. GPLS selects between high/low in level mode and positive/negative in
edge mode. A block diagr
am is shown in Figure 15-1. The pins of Port 1 are sampled every
clock cycle. In level-sensitive mode, a valid level must appear in two successive samples before
generating the interrupt. In edge-triggered mode, a transition will be detected if the value
changes from one sample to the next. When an interrupt condition on a pin is detected, and that
pin is enabled, the appropriate flag in the GPIF register is set. The flags in GPIF must b
e cleared
by software. Any GPI interrupt may wake up the device from the Power-down state.
Figure 15-1. GPI Block Diagram
DQ
2
2
2
2
00
11
(P1.2) GPI2
DQ
1
1
1
1
00
11
(P1.1) GPI1
DQ
0
0
0
0
00
11
(P1.0) GPI0
DQ
3
3
3
3
00
11
(P1.3) GPI3
DQ
6
6
6
6
00
11
(P1.6) GPI6
DQ
5
5
5
5
00
11
(P1.5) GPI5
DQ
44 4 4
00
11
(P1.4) GPI4
DQ
7
7
7
7
00
11
(P1.7) GPI7
GPMODGPLS GPIEN GPIF
Interrupt
CLK