
PIO-D144 User’s Manual
Version: 2.1 Date: 1999/10 Page 7
2.5 Interrupt Operation
The PC0, PC1, PC2, PC3 of CN1_PC can be used as interrupt signal source. Refer
to Sec. 2.1 for PC0/1/2/3 location. The interrupt of PIO-D144 is
level-trigger &
Active_High
. The interrupt signal can be
inverted or non-inverted
programmable. The procedures of programming are given as follows:
1.
make sure the initial level is High or Low
2.
if the initial state is High
!
select the
inverted
signal (Section. 3.3.6)
3.
if the initial state is Low
!
select the
non-inverted
signal (Section. 3.3.6)
4.
enable the INT function (Section. 3.3.4)
5.
If the interrupt signal is active
!
program will transfer into the interrupt
service routine
!
if INT signal is High now
!
!
!
!
select the inverted input
!
if INT signal is Low now
!
!
!
!
select the non-inverted input
Refer to DEMO3.C & DEMO4.C for single interrupt source. Refer to
DEMO5.C for four interrupt sources.
If only one interrupt signal source is used, the interrupt service routine does not
have to identify the interrupt source. (Refer to DEMO3.C & DEMO4.C)
If there are more than one interrupt source, the interrupt service routine has to
identify the active signals as following: (refer to DEMO5.C)
1.
Read the new status of the interrupt signal source
2.
Compare the new status with the old status to identify the active signals
3.
If PC0 is active, service CN1_PC0 & non-inverter/inverted the CN1_PC0 signal
4.
If PC1 is active, service CN1_PC1 & non-inverted/inverted the CN1_PC1 signal
5.
If PC2 is active, service CN1_PC2 & non-inverted/inverted the CN1_PC2 signal
6.
If PC3 is active, service CN1_PC3 & non-inverted/inverted the CN1_PC3 signal
7.
Save the new status to old status
Limitation: if the interrupt signal is too short, the new status may be as same as
old status. So the interrupt signal must be hold-active until the interrupt service
routine is executed. This hold time is different for different O.S. The hold time
can be as short as micro-second or as long as second. In general, 20ms is enough
for all O.S.
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru