Triggering multiple output pins of Arduino simultaneously from Simulink
12 ビュー (過去 30 日間)
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?
回答 (1 件)
Highphi 2022 年 2 月 8 日
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.