23
Interrupt Functions
Section 1-4
1234, an incorrect comparison result is reflected in comparison result output
A.
Countermeasure for Above Problem
1-4-3
Input Interrupts
The CPU Unit’s inputs allocated IR 00000 to IR 00003 can be used for inter-
rupts from external sources. Input interrupts 0 through 3 correspond respec-
tively to these bits and are always used to call subroutines 000 through 003
respectively. When input interrupts are not used, subroutines 000 to 003 can
be used for ordinary subroutines.
Processing
There are two modes for processing input interrupts. The first is the Input
Interrupt Mode, in which the interrupt is carried out in response to an external
input. The second is the Counter Mode, in which signals from an external
source are counted at high speed, and an interrupt is carried out once for
every certain number of signals.
The INT(89) instruction determines which mode is used.
In the Input Interrupt Mode, signals with a length of 100
µ
s or more can be
detected. In the Counter Mode, signals up to 1 kHz can be counted.
Procedure
(Input Interrupt Mode)
Follow the steps outlined below when using input interrupts in input interrupt
mode.
1,2,3...
1.
Determine the input interrupt number.
2.
Wire the input. (See page 25 for more details.)
3.
Make PC Setup settings. (See page 26 for more details.)
a) Write 1 in the corresponding digit in DM 6628 to indicate that the input
will be used as an input interrupt (input interrupt or counter mode.)
b) Bits in DM 6630 through DM 6633 can be turned ON to cause the input
to be refreshed before the interrupt subroutine is executed.
I N T
1 0 0
0 0 0
0 0 0
B S E T
# 1 2 3 4
D M 0 0 0 0
D M 0 0 1 0
I N T
2 0 0
0 0 0
0 0 0
Main Program
Interrupts disabled.
Interrupts enabled.
Terminal
Corresponding bit address
Subroutine number
B0
IN0
IR 00000
000
A0
IN1
IR 00001
001
B1
IN2
IR 00002
002
A1
IN3
IR 00003
003