Hardware Interrupt
Trigger downstream function-call subsystems from interrupt service routine for Arduino SAM core
Since R2024b
Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.
Libraries:
Simulink Support Package for Arduino Hardware /
Advanced /
SAM
Description
Use the Hardware Interrupt block to create an interrupt service routine (ISR) automatically in the generated code of your Simulink® model for the selected interrupts. 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 the same priority as the ISR.
Using this block, you can:
Create an ISR on the Arduino® board.
Set priority for an ISR.
Enable or disable interrupt preemption.
This block generates code only for the ISR and events that you select or specify. To change the configuration, enable the interrupt, and specify triggering options, use the settings of the selected peripherals. For example, to create an ISR for the CAN communication peripheral on the Hardware Interrupt block, your Simulink model must have an On-board CAN Receive or On-board CAN Transmit block.
Note
The Hardware Interrupt block supports C/C++ code generation. This feature allows you to generate C and C++ code using Embedded Coder®.
Supported Arduino Board
Arduino Due
Ports
Output
Parameters
Version History
Introduced in R2024b