Timers, Interrupts, and the System Clock
4-74
To do the same thing on C28x platforms with a 40 MIPS processor using the
CPU to drive the clock, the period register value is:
Period = 0.001 sec * 40,000,000 cycles per second = 40,000
4.9.2
System Clock
Many DSP/BIOS functions have a timeout parameter. DSP/BIOS uses a
system clock to determine when these timeouts should expire. The system
clock tick rate can be driven using either the low-resolution time or an external
source.
The TSK_sleep function is an example of a function with a timeout parameter.
After calling this function, its timeout expires when a number of ticks equal to
the timeout value have passed in the system clock. For example, if the
system clock has a resolution of 1 microsecond and we want the current task
to block for 1 millisecond, the call should look like this:
/* block for 1000 ticks * 1 microsecond = 1 msec */
TSK_sleep(1000)
Note:
Do not call TSK_sleep or SEM_pend with a timeout other than 0 or
SYS_FOREVER if the program is configured without something to drive the
PRD module. In a default configuration, the CLK module drives the PRD
module.
If you are using the default CLK configuration, the system clock has the same
value as the low-resolution time because the PRD_clock CLK object drives
the system clock.
There is no requirement that an on-device timer be used as the source of the
system clock. An external clock, for example one driven by a data stream
rate, can be used instead. If you do not want the on-device timer to drive the
low-resolution time, destroy the CLK object named PRD_clock in the
configuration script. If an external clock is used, it can call PRD_tick to
advance the system clock. Another possibility is having an on-device
peripheral such as the codec that is triggering an interrupt at regular intervals,
call PRD_tick from that interrupt’s HWI. In this case, the resolution of the
system call is equal to the frequency of the interrupt that is calling PRD_tick.
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 ...