This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Asynchronous Scheduling

This example shows how to use the Texas Instruments™ c28x peripherals and Hardware Interrupt blocks to control the real-time execution of Simulink® function-call subsystems in an asynchronous fashion.

Required Hardware

  • Spectrum Digital F2808/F2812/F28335 eZdsp or Texas Instruments LaunchPad/controlSTICK/controlCARD with docking station

  • Oscilloscope and probes

Available Models

These are the Simulink models available for different C2000 processors:

Note: To use the F28M35x/F28M36x controlCARD, you need Embedded Coder® Support Package for Texas Instruments C2000™ F28M3x Concerto™ Processors.

Example Model

The EV Timer or ePWM blocks are used to configure the timer interrupts. The timer interrupts are triggered based on the timer period, and the eCAN message receive interrupt is triggered when a message is received. The Hardware Interrupt block triggers the interrupt service routines (ISR) for the timer interrupts as well as for the eCAN message receive interrupt. The ISRs in turn call the function-call subsystems connected to the Hardware Interrupt block output ports.

The outputs of the first two subsystems are free-running counters. The sum of the counters is used to control the duty cycle of 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 Receive block whose message output controls the duty cycle of the PWM block (PWMA for F2812 or ePWM1 for F2808/F28335). The duty cycle varies from 0 to 100% because the eCAN messages are received from the eCAN Transmit block.

Note: The Self-Test mode of eCAN_A is enabled to connect the eCAN_A transmitter and receiver internally to avoid external connection between the transmitter and the receiver. For disabling the Self-Test mode of eCAN_A, the transmitter and the receiver must be connected together externally.

Run the Model on the Board

To configure, build, and deploy the application that corresponds to your Simulink model:

  1. Open the model corresponding to your target hardware. Each model is configured for a default target hardware. To select a different target hardware, browse to Model Configuration Parameters > Hardware Implementation > Hardware board.

  2. Browse to Hardware Implementation > Target hardware resources > eCAN_A, select Self-Test Mode, and click OK.

  3. Click Build Model to generate, build, load, and run the program.

  4. Observe the changes of the PWM waveform on the oscilloscope.

More About