Timers
8-5
DSP Private Peripherals
8.2.2
Timer Characteristics
Table 8–3. Timer Characteristics
Input Clock
t
clk
, Clock
Period
LOAD_TIM
t
int
, Timer Interrupt
Period for PTV = 0
t
int
, Timer Interrupt Period
for PTV = 7
12 MHz
83.3 ns
0001
333 ns
42.67
µ
s
12 MHz
83.3 ns
FFFF (max interrupt
period)
10.92 ms
1398.1 ms
If LOAD_TIM = 0 and AR (auto-reload mode) = 1, the timer is always 0 and can
never decrement. Here the timer interrupt is asserted and stays asserted all
the time. Since the timer interrupts are edge-senditive, only one interrupt is
recognized because there is one initial edge, and then the interrupt is asserted
constantly.
8.2.3
Programming the Timer
To start a timer, set the start timer bit (ST) of the control timer to 1. Reset the
bit to 0 to stop the timer. When the timer stops, the decrementer content is
frozen.
Set the autoreload bit (AR) of the control timer to 0 to have the timer decrement
from the loaded value down to zero and then stop. Set the AR to 1 to have the
timer continue.
-
A new value from the load register is loaded into the timer when it passes
though zero or when it starts.
-
An interrupt is produced when the corresponding timer is equal to zero.
To avoid undefined results, do not program the PTV, AR, or load register while
the timer is running.
The timer value is held in the value timer register (VALUE_TIM) and can be
read while the timer is running or stopped.
The load timer and read timer registers are actually split into two 16-bit por-
tions; therefore, two 16-bit accesses from the DSP are required. To properly
read the read timer register, access the upper 16 bits first, then the lower
16 bits. The DSP can access them through a single 32-bit access.