Hello,
I am using Simulink to receive serial data via Arduino, which is receiving three bytes (unit8) of data from a 2nd microcontroller. The 3-byte packet includes a startChar and 2 bytes of data, illustrated below.
Occasionally, if I reset the transmitting microcontroller, I notice the receiving bytes get jumbled and the starChar (36) is positioned either in the 2nd or 3rd index of the byte array. As a result this will completely ruin the rest of my model. To fix this I need to keep resetting the tranmistting controller.
What can I do to prevent this from happening?
5 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_981368
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_981368
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_984011
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_984011
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_984494
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_984494
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_986114
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_986114
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_986540
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/582866-simulink-arduino-serial-receive-byte-stream#comment_986540
Sign in to comment.