Mismatches in acquired digital signal in Simulink using Arduino Due

2 次查看(过去 30 天)
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 个评论
TAPABRATA SEN
TAPABRATA SEN 2019-8-20
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.

请先登录,再进行评论。

回答(1 个)

Arun Kumar
Arun Kumar 2019-9-25
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.

类别

Help CenterFile Exchange 中查找有关 Run on Target Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by