| Contents | Index |
Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ Scheduling
For many systems, an execution scheduling model based on a timer interrupt is not sufficient for a real-time response to external events. The C280x/C28x3x Hardware Interrupt block addresses this problem by allowing asynchronous processing of interrupts triggered by events managed by other blocks in the C280x/C28x3x DSP Chip Support Library.
The following C280x/C28x3x blocks that can generate an interrupt for asynchronous processing are available in Embedded Coder.
C280x ADC
C280x eCAN Receive
C280x SCI Receive
C280x SCI Transmit
C280x SPI Receive
C280x SPI Transmit
Only one Hardware Interrupt block can be used in a model. To handle multiple interrupts, place a Demux block at the output of the Hardware Interrupt block to direct function calls to the appropriate function-call subsystems.
The output of this block is a function call. The size of the function call line equals the number of interrupts the block is set to handle. Each interrupt is represented by four parameters shown on the dialog box of the block. These parameters are a set of four vectors of equal length. Each interrupt is represented by one element from each parameter (four elements total), one from the same position in each of these vectors.
Each interrupt is described by:
CPU interrupt numbers
PIE interrupt numbers
Task priorities
Preemption flags
So one interrupt is described by a CPU interrupt number, a PIE interrupt number, a task priority, and a preemption flag.
The CPU and PIE interrupt numbers together uniquely specify a single interrupt for a single peripheral or peripheral module. For detailed information about the interrupts, refer to the Texas Instruments documentation for your processor. For example, locate the "PIE MUXed Peripheral Interrupt Vector" or "PIE Peripheral Interrupts" tables in the following Texas Instruments documents:
| Processor | Literature Number at ti.com |
|---|---|
| 280x and 28044 | SPRU712 |
| C2833x | SPRUFB0, SPRS439 |
| C2802x | SPRUFN3 |
| C2803x | SPRUGL8 |
The task priority indicates the relative importance tasks associated with the asynchronous interrupts. If an interrupt triggers a higher-priority task while a lower-priority task is running, the execution of the lower-priority task will be suspended while the higher-priority task is executed. The lowest value represents the highest priority. The default priority value of the base rate task is 40, so the priority value for each asynchronously triggered task must be less than 40 for these tasks to suspend the base rate task.
The preemption flag determines whether a given interrupt is preemptable. Preemption overrides prioritization, such that a preemptable task of higher priority can be preempted by a non-preemptable task of lower priority.

Enter a vector of CPU interrupt numbers for the interrupts you want to process asynchronously.
Enter a vector of PIE interrupt numbers for the interrupts you want to process asynchronously.
Enter a vector of task priorities for the interrupts you want to process asynchronously.
See the discussion of this block's Vectorized Output for an explanation of task priorities.
Enter a vector of preemption flags for the interrupts you want to process asynchronously.
See the discussion of this block's Vectorized Output for an explanation of preemption flags.
Select this check box if you want to be able to test asynchronous interrupt processing in the context of your Simulink software model.
Detailed information about interrupt processing is in TMS320x280x DSP System Control and Interrupts Reference Guide, Literature Number SPRU712B, available at the Texas Instruments Web site.
The following links refer to block reference pages that require the Embedded Coder software.
C280x/C2802x/C2803x/C28x3x/c2834x Software Interrupt Trigger,Idle Task

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |