フィルターのクリア

Arduino Due CAN bus Communication via Simulink

7 ビュー (過去 30 日間)
Min
Min 2024 年 5 月 24 日
回答済み: Min 2024 年 6 月 6 日
Hi,
I have Arduino Due with CAN shield to read and send CAN messages but some reason I was not able to read with the message via CAN receive block by Arduino Support Package.
I was successfully able to read the CAN message if I use the Arduino IDE but not with Simulink.
I did check both CP, SPI, and Inturrup Pin set up which matches what I have on Arduino IDE.
Can someone explain how this works?
My current blocks are
CAN Receive (Arduino Package) -> CAN Unpack (With DBC File) -> Scope.
THanks!

採用された回答

Min
Min 2024 年 6 月 6 日
Forgot to answer and share the knowledge that I have since the issue has been conditionally resolved.
  1. It is possible to read the CAN message via Arduino as long as the hardware set up is appropriate.
  2. It is required to follow this step to not fail the CAN set up
  • Turn off the system
  • Plug the Arduino without turning the entire system on
  • Deploy the Simulinik model
  • Once it is deployed turn on the entire system
Sending CAN message is also posisble but with Arduino, it is limited due to its speed.
I am currently looking into using Raspberry Pi for higher speed (84 Mhz vs 1.4 Ghz).

その他の回答 (1 件)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU 2024 年 6 月 6 日
Hi Min,
Simulink's CAN Receive block might not fully support Due's CAN bus. Consider using the S-Function Block for more control.
There could be mismatches between Simulink's generated code and your CAN shield setup. Enable Simulink's Hardware Logging to monitor CAN communication during simulation.
If these suggestions don't help, share details about your CAN shield, DBC file, and relevant code for further troubleshooting.

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by