Timers, Interrupts, and the System Clock
4-72
4.9.1
High- and Low-Resolution Clocks
Using the CLK Manager in the configuration, you can disable or enable
DSP/BIOS’ use of an on-device timer to drive high- and low-resolution times
on the Clock Manager Properties.
The C6000 platform has multiple general-purpose timers. On the C6000, the
configuration allows you to select the on-device timer that is used by the CLK
Manager. On all platforms, you can configure the period at which the timer
interrupt is triggered. See
CLK Module
in the
TMS320 DSP/BIOS API
Reference Guide
for your platform, for more details about these properties.
By entering the period of the timer interrupt, DSP/BIOS automatically sets up
the appropriate value for the period register.
When the CLK Manager is enabled on the C6000 platform, the timer counter
register is incremented every four CPU cycles. When the CLK Manager is
enabled on the C28x platform, the timer counter is decremented at the
following rate, where CLKOUT is the DSP clock speed in MIPS (see the GBL
properties in the
TMS320 DSP/BIOS API Reference Guide
for your platform)
and TDDR is the value of the timer divide-down register as shown in the
following equation.
When this register reaches 0 on the C28x platform, or the value set for the
period register on the C6000 platform, the counter is reset. On the C28x, it is
reset to the value in the period register. On the C6000, it is reset to 0. At this
point, a timer interrupt occurs. When a timer interrupt occurs, the HWI object
for the selected timer runs the CLK_F_isr function, which causes these
events to occur:
❏
The low-resolution time is incremented by 1 on the C6000, C2800, and
C5000 platforms.
❏
All the functions specified by CLK objects are performed in sequence in
the context of that ISR.
Therefore, the low-resolution clock ticks at the timer interrupt rate and the
clock’s time is equal to the number of timer interrupts that have occurred. To
obtain the low-resolution time, you can call CLK_getltime from your
application code.
The CLK functions performed when a timer interrupt occurs are performed in
the context of the hardware interrupt that caused the system clock to tick.
Therefore, the amount of processing performed within CLK functions should
be minimized and these functions can invoke only DSP/BIOS calls that are
allowable from within an HWI.
CLKOUT / (TDDR + 1)
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...