MC68332
TIME PROCESSOR UNIT
USER’S MANUAL
7-5
To support changing TPU application requirements, Freescale has established a TPU
function library. The function library is a collection of TPU functions written for easy as-
sembly in combination with each other or with custom functions. Refer to Freescale Pro-
gramming Note TPUPN00/D,
Using the TPU Function Library and TPU Emulation
Mode for information about developing custom functions and accessing the TPU func-
tion library. Refer to the
TPU Reference Manual (TPURM/AD) for more information
about specific functions.
7.3.7 TPU Interrupts
Each of the TPU channels can generate an interrupt service request. Interrupts for
each channel must be enabled by writing to the appropriate control bit in the channel
interrupt enable register (CIER). The channel interrupt status register (CISR) contains
one interrupt status flag per channel. Time functions set the flags. Setting a flag bit
causes the TPU to make an interrupt service request if the corresponding channel in-
terrupt enable bit is set and the interrupt request level is nonzero.
The value of the channel interrupt request level (CIRL) field in TICR determines the
priority of all TPU interrupt service requests. CIRL values correspond to MCU interrupt
request signals IRQ[7:1]. IRQ7 is the highest-priority request signal; IRQ1 has the low-
est priority. Assigning a value of %111 to CIRL causes IRQ7 to be asserted when a
TPU interrupt request is made; lower field values cause corresponding lower-priority
interrupt request signals to be asserted. Assigning CIRL a value of %000 disables all
interrupts.
The CPU recognizes only interrupt requests of a priority greater than the value con-
tained in the interrupt priority (IP) mask in the condition code register. When the CPU
acknowledges an interrupt request, the priority of the acknowledged interrupt is written
to the IP mask and is driven out onto the IMB address lines.
When the IP mask value driven out on the address lines is the same as the CIRL value,
the TPU contends for arbitration priority. The IARB field in TPUMCR contains the TPU
arbitration number. Each module that can make an interrupt service request must be
assigned a unique non-zero IARB value in order to implement an arbitration scheme.
Arbitration is performed by means of serial assertion of IARB field bit values. IARB is
initialized to $0 during reset.
When the TPU wins arbitration, it must respond to the CPU interrupt acknowledge cy-
cle by placing an interrupt vector number on the data bus. The vector number is used
to calculate displacement into the exception vector table. Vectors are formed by con-
catenating the 4-bit value of the CIBV field in the TPU interrupt configuration register
with the 4-bit number of the channel requesting interrupt service. Since the CIBV field
has a reset value of %00, it must be assigned a value corresponding to the upper nib-
ble of a block of 16 user-defined vector numbers before TPU interrupts are enabled,
or a TPU interrupt service request could cause the CPU to take one of the reserved
vectors in the exception vector table.
Refer to
SECTION 4 SYSTEM INTEGRATION MODULE
for further information about
interrupts. For more information about the exception vector table refer to
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..