Arduino Interrupt should only trigger Function Call Subsystem
4 views (last 30 days)
Show older comments
I would like to realise a simple hardware interrupt for Arduino in Simulink. For this I use the block "External Interrupt" which activates a function call subsystem.
Within the function call subsystem there is only one constant with the value “1”, which is routed externally to the digital output.
If I then activate the interrupt externally by pressing a button, the LED lights up permanently. Is there a way to deactivate the Function Call Subsystem again until the next interrupt? Of course, I would like a 0 to be fed to the digital output so that the LED goes out again.

Here the inner content of the function call subsystem:

I'm pretty sure that this can be done more elegantly, because I don't have a condition in there that if the interrupt is not there, a 0 is sent to the digital output.
I have also tried to set the trigger type of the function call to Rising, but then the model is no longer compiled.
Kindest regards
0 Comments
Answers (1)
Satwik
on 22 Jul 2025
I understand that you want to model the 'External Interrupt' block which activates the Function Call Subsystem, in such a way that it allows for deactivation of the subsystem output until the next interrupt.
To do this, I recommend adding an Input port to the 'External Interrupt' and incorporating input logic to control the interrupt accordingly. You can achieve this by checking the 'Add simulation input port' option in Block Parameters of the 'External Interrupt' block. This will enable the 'SimIRQ' block input. In simulation, the block triggers the downstream function-call subsystem only if 'SimIRQ' is True.
Please refer to the following MathWorks example, which demonstrates a similar approach: https://www.mathworks.com/help/simulink/supportpkg/arduino_ref/trigger-downstream-function-call-subsystem-using-arduino-external-interrupt-block.html
I hope this helps!
0 Comments
See Also
Categories
Find more on Schedule Model Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!