2.5Interrupt Operation

All P2C0, P5C0, P8C0 and P11C0 can be used as interrupt signal sources. Refer to Sec. 2.1 & Sec. 2.7 for P2C0/P5C0/P8C0/P11C0 location. The interrupt of OME- PIO-D96 is level-trigger & Active_High. The interrupt signal can be inverted or non-invertedprogrammable. 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 (Sec. 3.3.6)

3.if the initial state is Low Æ select the non-invertedsignal (Sec. 3.3.6)

4.enable the INT function (Sec. 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 sources, the interrupt service routine has to identify the active signals as follows: (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 P2C0 is active, service P2C0 & non-inverter/inverted the P2C0 signal

4.If P5C0 is active, service P5C0 & non-inverted/inverted the P5C0 signal

5.If P8C0 is active, service P8C0 & non-inverted/inverted the P8C0 signal

6.If P11C0 is active, service P11C0 & non-inverted/inverted the P11C0 signal

7.Save the new status to old status

Note: 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 operating systems. The hold time can be as short as micro-second or as long as second. In general, 20ms is enough for most operating systems.

OME-PIO-D96 User Manual (Ver.1.1, Mar/2003)

---- 9

Page 11
Image 11
Omega Engineering OME-PIO-D96 manual Interrupt Operation, Make sure the initial level is High or Low