Trigger downstream function-call subsystems from interrupt service routine
C2000 Microcontroller Blockset/ Scheduling
Use the Hardware Interrupt block to create an interrupt service routine (ISR) automatically in the generated code of your model. The ISR executes the downstream function-call subsystem associated with event ports of the block.
The function call subsystem associated with the event output port run at same priority as that of ISR priority.
Using this block you can:
Set ISR priority.
Enable or disable interrupt preemption.
Use the Hardware Mapping tool to configure the desired event or interrupt.
The Hardware Mapping tool allows you to configure the hardware interrupts tasks for the selected hardware board. With this tool, you can map the tasks in your software model to the available event sources and interrupts:
Manually select the task in Mapping Browser > Tasks >
CPU name. Select the desired event or interrupt source. For more, see Configure Interrupts and Events Using Hardware Mapping
name Event Task — Function-call event input simulation
The simulation-only message input port, when connected to an Function-Call Generator block, the block acts as
pass-through with the output emitted on the
name Event port
To enable this port, select the Enable simulation port parameter.
name Event — Generate interrupt request
The output of this block is a function-call. The number of function call outputs will be same as events selected to serve in an ISR.
Number of events to serve — Specify number of events to serve
1 (default) |
Specify the number of events to serve for the Hardware Interrupt bock.
This parameter enables the specified number events as output port
Simulink task priority — Set priority of selected ISR
50 (default) |
positive integer or nonnegative integer
The value you specify in this parameter sets the priority of the downstream function-call subsystem. The simulink task priority of the selected (ISR) is relative to the model base rate priority.
The default model base sample rate priority is set to 40 with a lower priority value indicating a higher priority task. To achieve this the Higher priority value indicates higher task priority option must be enabled in Configuration Parameters > Solver pane.
Disable interrupt pre-emption — Select to disable interrupt preemption
off (default) |
By default, an interrupt can be preempted by a higher priority interrupt. Selecting this option allows low priority interrupts to complete their execution without being preempted by other interrupts.
Enable simulation port — Enable simulation ports to block
off (default) |
Select this parameter to add an compatible simulation input port.
Introduced in R2023a