I am not marking this as solved yet, as there are still unclear aspects (see my comment on Jonas' answer).
Partially missing values while reading serial input from a microcontroller (Simulink Instrument Control Toolbox)
2 views (last 30 days)
Show older comments
I am trying to read serial data from an Atmel SAM E70 Xplained -board using Instrument Control Toolbox and display the data in Simulink. However there are values missing when printed in Simulink scope.
Below is the code snippet from the microcontroller (programmed using Atmel studio).
The numerical values of these ASCII letters are 49 57 13 10, which are expected to be received from the Serial Receive -block.
Below is the Simulink model configured to display all of the received characters:
Output of the model:
As you can see, some of the values are overlapping / appear to be missing. How can I fix this?
There is no problem while using Ardino terminal (below) or PuTTy, so I doubt there is anything wrong with the sender.
I have tried changing the block sample time and data size of the input with no success.
Answers (1)
Jonas
on 18 Jun 2019
Your Simulink model is reading at 10kHz, while your Atmel controller is only sending each one second. This means that you are reading multiple times when the data has not changed (overlap).
See Also
Categories
Find more on Development Computer Setup 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!