Mismatches in acquired digital signal in Simulink using Arduino Due

1 view (last 30 days)
Hi,
I was doing some simple signal acquisition models in Simulink (Matlab ver. R2017b) with Arduino Due board. I was giving a unipolar square wave (250 Hz) from a function generator to pin 8 of the Arduino Due microcontroller. The 'digital input' block in Simulink is used and the output of the block is connected to a scope. In the 'digital input' block, the sample time is set as 0.001.
Now, when I'm observing the signal, in the scope, it is not at all replicating the input. On the other hand, when I ran the exact same code in Arduino Uno, with the same square wave, the scope is showing the proper output. I've attached couple of pictures of scope outputs, which demonstrate the two scenarios.
Can anybody tell, what can be reason of this mismatch?
Looking forward to some solution of this problem.
  3 Comments
TAPABRATA SEN
TAPABRATA SEN on 20 Aug 2019
Hi, Yes the hardware board I selected properly.
And regarding the solver, I selected 'fixed-step' type and 'auto' solver option.
Please let me know, what you think.

Sign in to comment.

Answers (1)

Arun Kumar
Arun Kumar on 25 Sep 2019
Hi,
I think the issue is due to the operating voltages. Due is ARM based board and works at 3.3V while Uno(and other AVR boards) operate at 5V.
I suggest checking the output voltages on the function generator. For Due, max should be 3.3V.
HTH.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!