Asynchronous Scheduling
This example shows how to use the c28x peripherals and Hardware Interrupt blocks to control the execution of function-call subsystems in an asynchronous fashion.
Required Hardware:
- Spectrum Digital F2808/F2812/F28335 eZdsp
- Texas Instruments™ F2808/F28035/F28069/F28335/F28343 ControlCARD with docking station
- Texas Instruments™ F28069 ControlSTICK
- Oscilloscope and probes
Available versions of this example:
- F281x based board: c281x_asyncscheduling.mdl
- F280x/F2823x/F2833x based board: c280x_2833x_asyncscheduling.mdl
- Piccolo F2803x/F2806x based board: c280xx_asyncscheduling.mdl
Contents
Model
The following figure shows the example model.
Description
The EV Timer blocks are used to configure timer interrupts to be raised on period match. Hardware Interrupt block installs the ISRs for the timer interrupts as well as for an eCAN message receive interrupt. The ISRs in turn call function-call subsystems connected to the Hardware Interrupt block output ports.
The outputs of first two subsystems are running counters. Their sum is used to control the duty cycle of the PWMB for F2812 or ePWM2 for F2808/F28335. The PWM waveform duty cycle increases linearly from 0 to 100 %.
The third subsystem contains an eCAN Rcv block whose message output drives a PWM block (PWMA for F2812 or ePWM1 for F2808/F28335) to control its duty cycle. The duty cycle varies from 0 to 100 % as the eCAN messages are received from an eCAN Xmt block.
NOTE: The Self-Test mode of eCAN_A is enabled to connect eCAN_A transmitter and receiver internally to avoid external connection between transmitter and receiver. Disabling the Self-Test mode for eCAN_A requires transmitter and receiver to be connected together externally.
How to Run the Example on the Board
The following sections explain how to configure, build, and deploy the executable.
With Code Composer Studio v3.3 (CCSv3.3) - Default
- Open the model corresponding to the family of processor you are using.
- Each model is configured for a default processor. Open the Model Configuration Parameters dialog and select "Coder Target" under "Code Generation". Next, click "Target Hardware Resources" dialog to select a different processor.
- Go to Peripherals > eCAN_A and check Self-Test Mode.
- Click OK.
- Click Build Model to generate, build, load and run the program.
- Observe the PWM waveform on the oscilloscope.
With Code Composer Studio v4 (CCSv4)
CCSv4 support is provided via a makefile based approach. This requires running xmakefilesetup to set the environment. You can ignore the following if you have already gone through these steps. For more information, please refer to the Xmakefile Documentation
- Run Xmakefile User Configuration.
- Set the Template parameter to gmake.
- Uncheck the Display operational configuration only checkbox.
- Set the Configuration parameter to ticcs_c2000_ccsv4, click Apply, if you haven't used this tool before, a dialog will ask you to browse to your CCSv4 installation folder. Pick the right folder and click OK.
- Click on the Tool Directories and make sure that the paths are pointing to directories matching your installation. For example:
- C:\Program Files\Texas Instruments\ccsv4\ for CCS Installation
- C:\Program Files\Texas Instruments\ccsv4\tools\compiler\C2000\ for Code Generation Tools
- C:\Program Files\Texas Instruments\bios_5_41_10_36\ for DSP/BIOS Installation
Code Generation and Creation of an .out file using CCSv4:
- Open the model corresponding to the family of processor you are using.
- Open the "Target Hardware Resources" dialog and set the IDE/Tool chain parameter to Texas Instruments Code Composer Studio v4 (makefile generation only).
- Change the selected board and processor to match your hardware.
- Go to Peripherals > eCAN_A and check Self-Test Mode.
- Click OK.
- Click Build Model or press Ctrl+B to generate and build an .out executable file.
- Open CCSv4 and Connect to the Hardware. Load the program on to the Hardware using CCSv4 and run.
- Observe the PWM waveform on the oscilloscope.
With Code Composer Studio v5 (CCSv5)
CCSv5 support is provided via a makefile based approach. This requires running xmakefilesetup to set the environment. You can ignore the following if you have already gone through these steps. For more information, please refer to the Xmakefile Documentation
- Run XMakefile User Configuration.
- Set the Template parameter to gmake.
- Uncheck the Display operational configuration only checkbox.
- Set the Configuration parameter to ticcs_c2000_ccsv5, click Apply, if you haven't used this tool before, a dialog will ask you to browse to your CCSv5 installation folder. Pick the right folder and click OK.
- Click on the Tool Directories and make sure that the paths are pointing to directories matching your installation. For example:
- C:\ti\ccsv5\ for CCS Installation
- C:\ti\ccsv5\tools\compiler\c2000\ for Code Generation Tools
- C:\ti\bios_5_41_11_38\ for DSP/BIOS Installation
Code Generation and Creation of an .out file using CCSv5:
- Open the model corresponding to the family of processor you are using.
- Open the "Target Hardware Resources" dialog and set the IDE/Tool chain parameter to Texas Instruments Code Composer Studio v5 (makefile generation only).
- Change the selected board and processor to match your hardware.
- Go to Peripherals > eCAN_A and check Self-Test Mode.
- Click OK.
- Click Build Model or press Ctrl+B to generate and build an .out executable file.
- Open CCSv5 and Connect to the Hardware. Load the program on to the Hardware using CCSv5 and run.
- Observe the PWM waveform on the oscilloscope.