Main Content

Hardware Interrupt

Trigger downstream function-call subsystems from interrupt service routine

Since R2023a

  • Hardware Interrupt block

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:

  • Create ISRs.

  • 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:



expand all

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 in simulation.


To enable this port, select the Enable simulation port parameter.


expand all

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.


expand all

Specify the number of events to serve for the Hardware Interrupt bock. This parameter enables the specified number events as output port event#

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.

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.

Select this parameter to add an compatible simulation input port.

Version History

Introduced in R2023a