XC2200 Derivatives
System Units (Vol. 1 of 2)
Interrupt and Trap Functions
User’s Manual
5-1
V2.1, 2008-08
ICU_X2K, V2.2
5
Interrupt and Trap Functions
The architecture of the XC2200 supports several mechanisms for fast and flexible
response to service requests from various internal or external sources. Different kinds of
exceptions are handled in a similar way:
•
Interrupts generated by the Interrupt Controller (ITC)
•
DMA transfers issued by the Peripheral Event Controller (PEC)
•
Traps caused by the TRAP instruction or issued by faults or specific system states
Normal Interrupt Processing
The CPU temporarily suspends current program execution and branches to an interrupt
service routine to service an interrupt requesting device. The current program status (IP,
PSW, also CSP in segmentation mode) is saved on the internal system stack. A
prioritization scheme with 16 priority levels allows the user to specify the order in which
multiple interrupt requests are to be handled.
Interrupt Processing via the Peripheral Event Controller (PEC)
A faster alternative to normal software controlled interrupt processing is servicing an
interrupt requesting device with the XC2200’s integrated Peripheral Event Controller
(PEC). Triggered by an interrupt request, the PEC performs a single word or byte data
transfer between any two locations through one of eight programmable PEC Service
Channels. During a PEC transfer, normal program execution of the CPU is halted. No
internal program status information needs to be saved. The same prioritization scheme
is used for PEC service as for normal interrupt processing.
Trap Functions
Trap functions are activated in response to special conditions that occur during the
execution of instructions. A trap can also be caused externally via the External Service
Request pins, ESRx. Several hardware trap functions are provided to handle erroneous
conditions and exceptions arising during instruction execution. Hardware traps always
have highest priority and cause immediate system reaction. The software trap function
is invoked by the TRAP instruction that generates a software interrupt for a specified
interrupt vector. For all types of traps, the current program status is saved on the system
stack.
External Interrupt Processing
Although the XC2200 does not provide dedicated interrupt pins, it allows connection of
external interrupt sources and provides several mechanisms to react to external events
including standard inputs, non-maskable interrupts, and fast external interrupts. Except
for the non-maskable interrupt and the reset input, these interrupt functions are alternate
port functions.