![](http://datasheet.mmic.net.cn/120000/ML64P168-XXXGP_datasheet_3559835/ML64P168-XXXGP_103.png)
7-27
ML64168/P168 User's Manual
Chapter 7 Ports (P0, P1, P2, P3 and P4)
7
Figure 7-12 External 0 Interrupt Generation Circuit (one bit)
7.3.3 External Interrupt Generation Timing of Port 2, Port 3 and Port 4
External interrupt of Ports 2 to 4 is generated when each IE bit (P20IE to P23IE, P30IE to
P33IE and P40IE to P43IE) of P2.0 to P2.3, P3.0 to P3.3 and P4.0 to P4.3 are set to "1" and
by the change of an input level of those ports for which each DIR bit (P20DIR to P23DIR,
P30DIR to P33DIR and P40DIR to P43DIR) is set to "0" (set for interrupt enable and input
mode). The External 0 interrupt (XI0INT) is generated by OR signal of each level change
detection signal.
Change of input level can be sampled by 64 Hz output of the time base counter which is the
sampling clock or by falling of the system clock (32.768 kHz or 700 kHz). Selection of the
sampling clock is performed by Bit 2 (P20F to P23F, P30F to P32F) of each port control
register and when the F bit is reset to "0", the sampling clock becomes 64 Hz and when the
F bit is set to "1", the sampling clock changes to the system clock. There is no function to select
the sampling clock for P3.3 and P4.0 to P4.3 and they are fixed at 64 Hz output of the time
base counter.
Delay time until the External 0 interrupt request flag (QXI0) is set after the level of Port 2 to
Port 4 is changed to output XI0INT signal is one period of the sampling clock or less. Since
the External 0 interrupt request flag (QXI0) is set by input level change of one of Port 2 to Port
4, which port the interrupt request comes from should be judged by checking the signal level
after reading out each port.
The interrupt vector address of External interrupt XI0INT is address 038H.
Figures 7-12 and 7-13 show the External 0 interrupt generation circuit and timing.
DQ
R
DQ
R
P2nDIR
P3nDIR
P4nDIR
P2.n
P3.n
P4.n
64 Hz
System clock
(32 kHz/
700 kHz)
P2nF
P30F
P31F
P32F
Sampling clock
RESETS
Level change detection circuit
(n = 0 to 3)
From other I/O ports
11
XI0INT
(to interrupt
controller)
P2nIE
P3nIE
P4nIE