71
CPM1/CPM1A Interrupt Functions Section 1-6
For example, IR 00000 would not be ON in interrupt routine for input interrupt
0 unless it was refreshed. In this case, use the Always ON Flag, SR 25313 in
the interrupt routine instead of IR 00000.
Input Interrupt Mode When an input interrupt signal is received, the main program is interrupted
and the interrupt program is executed immediately, regardless of the point in
the cycle in which the interrupt is received. The signal must be ON for 200
µs
or more to be detected.
Use the following instructions to program input interrupts using the Input Inter-
rupt Mode.
Masking/Unmasking of Interrupts
With the INT(89) instruction, set or clear input interrupt masks as required.
All of the input interrupts are masked when PC operation is started. If input
interrupt mode is being used, be sure to enable the inputs by executing
INT(89) as shown above.
Clearing Masked Interrupts
If the bit corresponding to an input interrupt turns ON while masked, that input
interrupt will be saved in memory and will be executed as soon as the mask is
cleared. In order for that input interrupt not to be executed when the mask is
cleared, the interrupt must be cleared from memory.
Only one interrupt signal will be saved in memory for each interrupt number.
With the INT(89) instruction, clear the input interrupt from memory.
Reading Mask Status
With the INT(89) instruction, read the input interrupt mask status.
Main program
Interrupt program
Input interrupt
Main program
(@)INT(89)
000
000
D
Make the settings with word D bits 0 to 3, which correspond
to input interrupts 0 to 3.
0: Mask cleared. (Input interrupt enabled.)
1: Mask set. (Input interrupt disabled.)
(@)INT(89)
001
000
D
If D bits 0 to 3, which correspond to input interrupts 0 to 3, are
set to "1," then the input interrupts will be cleared from memory.
0: Input interrupt retained.
1: Input interrupt cleared.
(@)INT(89)
002
000
D
The status of the rightmost digit of the data stored in word D (bits
0 to 3) show the mask status.
0: Mask cleared. (Input interrupt enabled.)
1: Mask set. (Input interrupt disabled.)