Texas Instruments TMS320 User Manual page 176

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Timers, Interrupts, and the System Clock
4.9.1
High- and Low-Resolution Clocks
4-72
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.
CLKOUT / (TDDR + 1)
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.

Advertisement

Table of Contents
loading

Table of Contents