XC2200 Derivatives
System Units (Vol. 1 of 2)
Interrupt and Trap Functions
User’s Manual
5-37
V2.1, 2008-08
ICU_X2K, V2.2
5.8
External Interrupts
Although the XC2200 has no dedicated INTR input pins, it supports many possibilities to
react to external asynchronous events. It does this by using a number of IO lines for
interrupt input. The interrupt function may be either combined with the pin’s main function
or used instead of it if the main pin function is not required.
The
External Request Unit
provides flexible trigger signals with selectable qualifiers,
which can directly control peripherals (ADC, MultiCAN) or generate additional
interrupt/PEC requests from external input signals.
For each of these pins, either a positive, a negative, or both a positive and a negative
external transition can be selected to cause an interrupt or PEC service request. The
edge selection is performed in the control register of the peripheral device associated
with the respective port pin (separate control for ERU inputs). The peripheral must be
programmed to a specific operating mode to allow generation of an interrupt by the
external signal. The priority of the interrupt request is determined by the interrupt control
register of the respective peripheral interrupt source, and the interrupt vector of this
source will be used to service the external interrupt request.
Note: In order to use any of the listed pins as an external interrupt input, it must be
switched to input mode via its port control register.
When port pins CCxIO are to be used as external interrupt input pins, bitfield CCMODx
in the control register of the corresponding capture/compare register CCx must select
capture mode. When CCMODx is programmed to 001
B
, the interrupt request flag CCxIR
in register CCxIC will be set on a positive external transition at pin CCxIO. When
CCMODx is programmed to 010
B
, a negative external transition will set the interrupt
request flag. When CCMODx = 011
B
, both a positive and a negative transition will set
the request flag. In all three cases, the contents of the allocated CAPCOM timer will be
latched into capture register CCx, independent of whether or not the timer is running.
When the interrupt enable bit CCxIE is set, a PEC request or an interrupt request for
vector CCxINT will be generated.
Table 5-12
Pins Usable as External Interrupt Inputs
Port Pin
Original Function
Control Register
P4.7-0/CC31-24IO
CAPCOM Register 31-24 Capture Input
CC31-CC24
P2.10-3/CC23-16IO
CAPCOM Register 23-16 Capture Input
1)
1) Pin P2.10 overlays two possible input functions.
CC23-CC16
P4.2/T2IN
Auxiliary timer T2 input pin
T2CON
P4.6/T4IN
Auxiliary timer T4 input pin
T4CON
P2.10/CAPIN
GPT2 capture input pin
T5CON