Symphony DSP56724/DSP56725 Multi-Core Audio Processors, Rev. 0
11-4
Freescale Semiconductor
Triple Timer Module (TEC, TEC_1)
3. Configure the other registers: Timer Prescaler Load Register (TPLR), Timer Load Register (TLR),
and Timer Compare Register (TCPR).
4. Enable the timer by setting the TCSR[TE] bit.
11.3.3
Timer Exceptions
Each timer can generate two different exceptions:
•
Timer Overflow (highest priority) — Occurs when the timer counter reaches the overflow value.
This exception sets the TOF bit. The TOF bit is cleared when “1” is written to it or when the timer
overflow exception is serviced.
•
Timer Compare (lowest priority) — Occurs when the timer counter reaches the value given in the
Timer Compare Register (TCPR), for all modes except measurement modes. The Compare
exception sets the TCF bit. The TCF bit is cleared when “1” is written to it or when the timer
compare interrupt is serviced.
To configure a timer exception, perform the following steps. The text to the right of each step shows the
register settings for configuring a Timer 0 compare interrupt. The order of the steps is optional except that
the timer should not be enabled (step 2e) until all other exception configuration is complete:
1. Configure the interrupt service routine (ISR):
a) Load vector base address register.
VBA (b23–8)
b) Define I_VEC to be equal to the VBA value (if that is nonzero). If it is defined, I_VEC must
be defined for the assembler before the interrupt equate file is included.
c) Load the exception vector table entry: two-word fast interrupt, or jump/branch to subroutine
(long interrupt).
p:TIM0C
2. Configure the interrupt trigger:
a) Enable and prioritize overall peripheral interrupt functionality.
IPRP (TOL[1–0])
b) Enable a specific peripheral interrupt.
TCSR0 (TCIE)
c) Unmask interrupts at the global level.
SR (I[1–0])
d) Configure a peripheral interrupt-generating function.
TCSR0 (TC[7–4])
e) Enable peripheral and associated signals.
TCSR0 (TE)
11.4
Operating Mode
The TEC timer has one mode, GPIO, mode 0: Internal timer interrupt generated by the internal clock.
•
The TCSR[TE] bit is set to clear the counter and enable the timer. Clearing TCSR[TE] disables the
timer.
•
The value to which the timer is to count is loaded into the TCPR register. (This is true for all modes
except the measurement modes (modes 4 through 6).
•
The counter is loaded with the TLR value on the first clock.
•
If the counter overflows, TCSR[TOF] is set, and if TCSR[TOIE] is set, an overflow interrupt is
generated.
•
You can read the counter contents at any time from the Timer Count Register (TCR).