![CMOSTEK CMT2189C Скачать руководство пользователя страница 61](http://html1.mh-extra.com/html/cmostek/cmt2189c/cmt2189c_user-manualline_2627489061.webp)
AN202
V1.0 | Page 61/73
www.cmostek.com
14.2
PORTA Level Change Interrupt
The input change on PORTA canset the PAIF bit of the INTCON register.The interrupt can be enabled or
disabled by setting/clearingthe PAIE bit. In addition, each pin of the port can be configured through the IOCA
register.
Note:
1. When using the PORTA level change interrupt, the ANSEL and CM2CON0 registers must be initialized so
that the analog channel is configured as a digital input.The pin configured as an analog input is always
read to 0.
2. When initializing the level change interrupt, first configure it as a digital input IO, and set the
corresponding IOCA to 1, and then read the PORTA.
3. When the IO level changes, the PAIF bit is set to 1.
4. Read the PORTA before clearing the interrupt flag, and then clear the PAIF.
14.3
Interrupt Response
The external interrupt includes the interrupt from the INT pin or the PORTA change interrupt, and the interrupt
delay is usually 1 to 2 instruction cycles.It depends on the actual situation of the interrupt.
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 14-1. Interrupt Response Timing Diagram
Содержание CMT2189C
Страница 32: ...AN202 V1 0 Page 32 73 www cmostek com...