XC2200 Derivatives
System Units (Vol. 1 of 2)
Interrupt and Trap Functions
User’s Manual
5-2
V2.1, 2008-08
ICU_X2K, V2.2
5.1
Interrupt System Structure
The XC2200 provides 96 separate interrupt nodes assignable to 16 priority levels, with
8 sub-levels (group priority) on each level. In order to support modular and consistent
software design techniques, most sources of an interrupt or PEC request are supplied
with a separate interrupt control register and an interrupt vector. The control register
contains the interrupt request flag, the interrupt enable bit, and the interrupt priority of the
associated source. Each source request is then activated by one specific event,
determined by the selected operating mode of the respective device. For efficient
resource usage, multi-source interrupt nodes are also incorporated. These nodes can be
activated by several source requests, such as by different kinds of errors in the serial
interfaces. However, specific status flags which identify the type of error are
implemented in the serial channels’ control registers. Additional sharing of interrupt
nodes is supported via interrupt subnode control registers.
The XC2200 provides a vectored interrupt system. In this system specific vector
locations in the memory space are reserved for the reset, trap, and interrupt service
functions. Whenever a request occurs, the CPU branches to the location that is
associated with the respective interrupt source. This allows direct identification of the
source which caused the request. The Class B hardware traps all share the same
interrupt vector. The status flags in the Trap Flag Register (TFR) can then be used to
determine which exception caused the trap. For the special software TRAP instruction,
the vector address is specified by the operand field of the instruction, which is a seven
bit trap number.
The reserved vector locations build a jump table in the low end of a segment (selected
by register VECSEG) in the XC2200’s address space. The jump table consists of the
appropriate jump instructions which transfer control to the interrupt or trap service
routines and which may be located anywhere within the address space. The entries of
the jump table are located at the lowest addresses in the selected code segment. Each
entry occupies 2, 4, 8, or 16 words (selected by bitfield VECSC in register CPUCON1),
providing room for at least one doubleword instruction. The respective vector location
results from multiplying the trap number by the selected step width (2
(VECSC+2)
).
All pending interrupt requests are arbitrated. The arbitration winner is indicated to the
CPU together with its priority level and action request. The CPU triggers the
corresponding action based on the required functionality (normal interrupt, PEC, jump
table cache, etc.) of the arbitration winner.
An action request will be accepted by the CPU if the requesting source has a higher
priority than the current CPU priority level and interrupts are globally enabled. If the
requesting source has a lower (or equal) interrupt level priority than the current CPU
task, it remains pending.