PIO-D96 Series Card
96-channel DIO Board
User Manual, Ver. 2.3, Jun. 2018, PMH-008-23 Page: 15
2.7
Interrupt Operation
The P2C0, P5C0, P8C0 and P11C0 can be used as interrupt signal source. Refer to
Section 2.1 “Board
Layout”
and
Section 2.4 “Pin Assignments”
for P2C0/P5C0/P8C0/P11C0 location. The interrupt of
PIO-D96 series card is
level-trigger and Active_High
. The interrupt signal can be programmable as
inverted or non-inverted
. The procedures for how to configure the interrupt signal source are given
as follows:
1.
Make sure
the initial level is high or Low from the signal source
.
2.
If the initial state is High, please select the
inverted
setting for interrupt signal source (
Section
6.3.6 “Interrupt Polarity Register”
). If the initial state is Low, please select the
non-inverted
setting for interrupt signal source (
Section 6.3.6 “Interrupt Polarity Register”
)
3.
Enable the interrupt function (
Section 6.3.4 “INT Mask Control Register”
)
4.
If the interrupt signal is active, the interrupt service routine will be started up.
Note that DEMO3.C and DEMO4.C are demo programs for a single interrupt source and DEMO5.C is
the demo program for four interrupt sources in the DOS operating system. If only one interrupt
signal source is used, the interrupt service routine does not need to identify the interrupt source.
(Refer to DEMO3.C and DEMO4.C). However, if there are more than one interrupt source, the
interrupt service routine has to identify the active signals in the following manner: (refer to
DEMO5.C)
1.
Read the new status of the interrupt signal sources.
2.
Compare the new status with the old status to identify the active signals.
3.
If P2C0 is active, service P2C0 and non-inverter/inverted the P2C0 signal.
4.
If P5C0 is active, service P5C0 and non-inverted/inverted the P5C0 signal.
5.
If P8C0 is active, service P8C0 and non-inverted/inverted the P8C0 signal.
6.
If P11C0 is active, service P11C0 and non-inverted/inverted the P11C0 signal.
7.
Update the interrupt status.
Note
If the interrupt signal is too short, the new status may be the same as the old status. So the interrupt signal must be held
active until the interrupt service routine has been executed. This hold time is different for differing operating systems. The
hold time can be as short as a micro-second or as long as 1 second. In general, 20 ms is enough for all O.S.