AN201
Rev 1.5 | 79/91
www.cmostek.com
14.2 PORTA Level Change Interrupt
The input change on the PORTA will set the PAIF bit of the INTCON register. The interrupt can be enabled or disabled by
setting/clearing the PAIE bit. In addition, each pin of the port can be configured through the IOCA register.
Notes:
1.
When using the PORTA level change interrupt, users should initialize the ANSEL and CM2CON0 registers so that the
analog channel can be configured as a digital input. The pin configured as an analog input is always read as 0.
2.
When initializing the level change interrupt, configure it as a digital input IO first and set the corresponding IOCA to 1, then
read the PORTA.
3.
When the IO level changes, the PAIF bit is set to 1.
4.
Read the PORTA before clear the interrupt flag, then clear PAIF.
14.3 Interrupt Response
The interrupt delay of the external interrupts, including the interrupt from the INT pin or the PORTA change interrupt, is usually 1
to 2 instruction cycles depending on actual interrupt situations.
1
2
3
4
5
6
7
8
9
10
11
12
PC
PC+1
PC+2
0x004
0x005
中断矢量
PC-1
INTF
INT
(
PA2
)
Figure 27. Interrupt Response Timing Diagram