User`s guide

Table Of Contents
1 Getting Started
1-8
Scheduling and Timing
A timer interrupt is used to run generated code in real time on the C2000 DSP.
Each iteration of the model solver is run after an interrupt has been posted and
serviced by an interrupt service routine (ISR). The code generated for the C28x
uses
CPU_timer0. The code generated for the C24x uses an Event Manager (EV)
timer, which you can select.
The timer is configured so that the model’s base rate sample time corresponds
to the interrupt rate. The timer period and prescaler are calculated and set up
to ensure the desired rate as follows:
The minimum achievable base rate sample time depends on the model
complexity. The maximum value depends on the maximum timer period value
(2
32
-1 for the F2812 or 2
16
-1 for the LF2407), the CPU clock speed and for the
LF2407, the
TimerClockPrescaler setting in the appropriate Target
Preferences block. The CPU clock speed for the LF2407 is 40 MHz and for the
F2812 it is 150 MHz.
Maximum Sample Times
TimerClockPrescaler
Setting
C24x Maximum
Sample Time
(seconds)
C28x Maximum
Sample Time
(seconds)
1 0.0016 0.0004
20.0032N/A
40.0065N/A
80.0131N/A
16 0.0262 N/A
32 0.0524 N/A
Base Rate Sample Time
Timer Period
CPU Clock Speed()
TimerClockPrescaler
---------------------------------------------------------------


------------------------------------------------------------------
---
=