XC2200 Derivatives
System Units (Vol. 1 of 2)
Interrupt and Trap Functions
User’s Manual
5-20
V2.1, 2008-08
ICU_X2K, V2.2
5.4
Operation of the Peripheral Event Controller Channels
The XC2200’s Peripheral Event Controller (PEC) provides 8 PEC service channels
which move a single byte or word between any two locations. A PEC transfer can be
triggered by an interrupt service request and is the fastest possible interrupt response.
In many cases a PEC transfer is sufficient to service the respective peripheral request
(for example, serial channels, etc.).
PEC transfers do not change the current context, but rather “steal” cycles from the CPU,
so the current program status and context needs not to be saved and restored as with
standard interrupts.
The PEC channels are controlled by a dedicated set of registers which are assigned to
dedicated PEC resources:
•
A 24-bit source pointer for each channel
•
A 24-bit destination pointer for each channel
•
A Channel Counter/Control register (PECCx) for each channel, selecting the
operating mode for the respective channel
•
Two interrupt control registers to control the operation of block transfers
5.4.1
The PECC Registers
The PECC registers control the action performed by the respective PEC channel.
Transfer Size (bit BWT)
controls whether a byte or a word is moved during a PEC
service cycle. This selection controls the transferred data size and the increment step for
the pointer(s) to be modified.
Pointer Modification (bitfield INC)
controls, which of the PEC pointers is incremented
after the PEC transfer. If the pointers are not modified (INC = 00
B
), the respective
channel will always move data from the same source to the same destination.
Transfer Control (bitfield COUNT)
controls if the respective PEC channel remains
active after the transfer or not. Bitfield COUNT also generally enables a PEC channel
(COUNT > 00
H
).
The PECC registers also select the assignment of PEC channels to interrupt priority
levels (bitfield PLEV) and the interrupt behavior after PEC transfer completion (bit
EOPINT).
Note: All interrupt request sources that are enabled and programmed for PEC service
should use different channels. Otherwise, only one transfer will be performed for
all simultaneous requests. When COUNT is decremented to 00
H
, and the CPU is
to be interrupted, an incorrect interrupt vector will be generated.
PEC transfers are executed only if their priority level is higher than the CPU level.