![Infineon Technologies XC2200 User Manual Download Page 220](http://html1.mh-extra.com/html/infineon-technologies/xc2200/xc2200_user-manual_2055439220.webp)
XC2200 Derivatives
System Units (Vol. 1 of 2)
Interrupt and Trap Functions
User’s Manual
5-8
V2.1, 2008-08
ICU_X2K, V2.2
Upon entry into the interrupt service routine, the priority level of the source that won the
arbitration and whose priority level is higher than the current CPU level, is copied into
bitfield ILVL of register PSW after pushing the old PSW contents onto the stack.
The interrupt system of the XC2200 allows nesting of up to 15 interrupt service routines
of different priority levels (level 0 cannot be arbitrated).
Interrupt requests programmed to priority levels 15 … 8 (i.e., ILVL = 1XXX
B
) can be
serviced by the PEC if the associated PEC channel is properly assigned and enabled
(please refer to
). Interrupt requests programmed to priority levels 7 through
1 will always be serviced by normal interrupt processing.
Note: Priority level 0000
B
is the default level of the CPU. Therefore, a request on level 0
will never be serviced because it can never interrupt the CPU. However, an
individually enabled interrupt request (independent of bit IEN) on level 0000
B
will
reactivate the CPU.
General Interrupt Control Functions in Register PSW
The acceptance of an interrupt request depends on the current CPU priority level (bitfield
ILVL in register PSW) and the global interrupt enable control bit IEN in register PSW (see
).
CPU Priority ILVL
defines the current level for the operation of the CPU. This bitfield
reflects the priority level of the routine currently executed. Upon entry into an interrupt
service routine, this bitfield is updated with the priority level of the request being serviced.
The PSW is saved on the system stack before the request is serviced. The CPU level
determines the minimum interrupt priority level which will be serviced. Any request on
the same or a lower level will not be acknowledged. The current CPU priority level may
be adjusted via software to control which interrupt request sources will be
acknowledged. PEC transfers do not really interrupt the CPU, but rather “steal” a single
cycle, so PEC services do not influence the ILVL field in the PSW.
Hardware traps switch the CPU level to maximum priority (i.e. 15) so no interrupt or PEC
requests will be acknowledged while an exception trap service routine is executed.
Note: The TRAP instruction does not change the CPU level, so software invoked trap
service routines may be interrupted by higher requests.
Interrupt Enable bit IEN
globally enables or disables PEC operation and the
acceptance of interrupts by the CPU. When IEN is cleared, no new interrupt requests are
accepted by the CPU (see also
). When IEN is set to 1, all interrupt
sources, which have been individually enabled by the interrupt enable bits in their
associated control registers, are globally enabled. Traps are non-maskable and are,
therefore, not affected by the IEN bit.
Note: To generate requests, interrupt sources must be also enabled by the interrupt
enable bits in their associated control register.