30
4554 Group
SINGLE-CHIP 4-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
(5) Notes on External 1 interrupts
Note [1] on bit 3 of register I2
When the input of the INT1 pin is controlled with the bit 3 of reg-
ister I2 in software, be careful about the following notes.
Depending on the input state of the D9/INT1 pin, the external 1 in-
terrupt request flag (EXF1) may be set when the bit 3 of register
I2 is changed. In order to avoid the occurrence of an unexpected
interrupt, clear the bit 1 of register V1 to “0” (refer to Figure 21)
and then, change the bit 3 of register I2.
In addition, execute the SNZ1 instruction to clear the EXF1 flag
after executing at least one instruction (refer to Figure 21).
Also, set the NOP instruction for the case when a skip is per-
formed with the SNZ1 instruction (refer to Figure 21).
LA
4
; (02)
TV1A
; The SNZ1 instruction is valid ...........
LA
8
; (12)
TI2A
; Control of INT1 pin input is changed
NOP
...........................................................
SNZ1
; The SNZ1 instruction is executed
(EXF1 flag cleared)
NOP
...........................................................
: these bits are not used here.
Fig. 21 External 1 interrupt program example-1
Note [2] on bit 3 of register I2
When the bit 3 of register I2 is cleared, the RAM back-up mode is
selected and the input of INT1 pin is disabled, be careful about
the following notes.
When the key-on wakeup function of INT1 pin is not used (regis-
ter K22 = “0”), clear bits 2 and 3 of register I2 before system
enters to the RAM back-up mode. (refer to Figure 22).
LA
0
; (002)
TI2A
; Input of INT1 disabled .....................
DI
EPOF
POF2
; RAM back-up
: these bits are not used here.
Fig. 22 External 1 interrupt program example-2
Note on bit 2 of register I2
When the interrupt valid waveform of the D9/INT1 pin is changed
with the bit 2 of register I2 in software, be careful about the fol-
lowing notes.
Depending on the input state of the D9/INT1 pin, the external 1 in-
terrupt request flag (EXF1) may be set when the bit 2 of register
I2 is changed. In order to avoid the occurrence of an unexpected
interrupt, clear the bit 1 of register V1 to “0” (refer to Figure 23)
and then, change the bit 2 of register I2.
In addition, execute the SNZ1 instruction to clear the EXF1 flag
after executing at least one instruction (refer to Figure 23).
Also, set the NOP instruction for the case when a skip is per-
formed with the SNZ1 instruction (refer to Figure 23).
LA
4
; (02)
TV1A
; The SNZ1 instruction is valid ...........
LA
12
TI2A
; Interrupt valid waveform is changed
NOP
...........................................................
SNZ1
; The SNZ1 instruction is executed
(EXF1 flag cleared)
NOP
...........................................................
: these bits are not used here.
Fig. 23 External 1 interrupt program example-3