User`s guide
Table Of Contents
- Getting Started
- Using the IQmath Library
- Block Reference
- Blocks — Alphabetical List
- Absolute IQN
- Arctangent IQN
- C24x ADC
- C24x CAN Receive
- C24x CAN Transmit
- C24x From Memory
- C24x PWM
- C24x To Memory
- C28x ADC
- C28x eCAN Receive
- C28x eCAN Transmit
- C28x From Memory
- C28x PWM
- C28x To Memory
- Division IQN
- F2812 eZdsp
- Float to IQN
- Fractional part IQN
- Fractional part IQN x int32
- Integer part IQN
- Integer part IQN x int32
- IQN to Float
- IQN x int32
- IQN x IQN
- IQN1 to IQN2
- IQN1 x IQN2
- LF2407 eZdsp
- Magnitude IQN
- Saturate IQN
- Square Root IQN
- Trig Fcn IQN
- Index

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
---------------------------------------------------------------
------------------------------------------------------------------
---
=