Usage of CAN blocs on Arduino UNO & MKR CAN Shield
1 view (last 30 days)
Show older comments
Hello,
In my project i have to use CAN blocs to communicate between raspberry pi 3 & arduino uno.
I have some troubles by using the demo code here's the following result :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1008025/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1008030/image.jpeg)
Here's the following error that i have (you can find attached to this post.
Thanks in advance for your help.
0 Comments
Answers (1)
Githin George
on 8 Feb 2024
Hello,
It is my understanding that you are trying to implement the example for CAN transmission with an Arduino UNO. I’m assuming that you are following the example given below to setup your hardware and configuration properties.
Looking at the build log, it is apparent that the data memory in the Arduino is being overflowed as it exceeds 2KB, which is the limit for the Arduino UNO. If the hardware setup is indeed in line with the example, the probable cause would be the definition of the Block Parameter “Message ID”. According to the documentation for CAN transmit block, for the parameter “Message ID” use "hex2dec(' ')" to convert the entry if the value is entered as hexadecimal. In this case use "hex2dec(‘0x14’)" as normal usage may be the cause of the unexpected behavior.
You could also try the same example with a supported hardware board which offers more flexibility in terms of data storage.
I hope this helps.
0 Comments
See Also
Categories
Find more on Modeling 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!