2.4Interrupt Operation
All PC0, PC1, PC2 and PC3 can be used as an interrupt signal sources. Refer to Sec. 2.1 for PC0/PC1/PC2/PC3 location. The interrupt of
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
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 is more than one interrupt source, the interrupt service routine has to identify the active signals via the following steps: (Refer to DEMO5.C)
1.Reads the new status of the interrupt signal source
2.Compares the new status with the old status to identify the active signals
3.If PC0 is active, service PC0 &
4.If PC1 is active, service PC1 &
5.If PC2 is active, service PC2 &
6.If PC3 is active, service PC3 &
7.Saves the new status to old status
Note: If the interrupt signal is too short, the new status may be the same as old status. So the interrupt signal must be held active until the interrupt service routine is executed. This hold time is different for different operating systems. It can be as a short as