Triggering multiple output pins of Arduino simultaneously from Simulink
5 views (last 30 days)
Show older comments
Using DigitalWrite command in Arduino for multiple pins creates a delay, which can be solved as follows.
PORTB = 0b00110000; (Pin 12 and 13 becomes high simultameously)
However, when I use simulink for the same purpose, there is a 30 us delay (from oscilloscope) between the pin 12 and pin 13 high time.
I know that internal codes of simulink uses DigitalWrite command for a digital output pin and it works for only a single pin at a time.
In Arduino code, it is possible to write on a Port say, PORTB = 0b00110000; (Pin 12 and 13 becomes high simultameously)
Is there any way by which we can write on a Port of Arduino similarly from simulink?
I think, there is no building option.
However, is there any alternative way say by modifying any code to write on a port of Arduino from simulink?
How the delay time can be reduced to zero?
0 Comments
Answers (1)
Highphi
on 8 Feb 2022
Unfortunately, the way Arduino evaluates code is step by step, therefore parallel evaluation does not exist on that hardware.
30 us is probably the closest to 'simultaneous' you will be able to get.
1 Comment
See Also
Categories
Find more on Arduino Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!