Connecting Arduino to CAN bus device

Hello guys!

Recently, I am engaged in an interesting project and I hope to find someone to assist me with the realization. I have Arduino UNO,Arduino Mega and 2X CAN-BUS Shield V2 from DFROBOT. (CAN-BUS_Shield_V2__SKU__DFR0370_-DFRobot)

My goal is to connect to another device that works with CANOpen and read the sensor status.

Here i have left data about canbus to which I want to connect:

  • Speed: 125 kpbs
  • I must use SDO Reed and Write Request to read address: 0x2300.01

Тhanks in advance!

Welcome atanas18, A bit of advice on CAN. You have to terminate it properly or it will behave funny. The CAN protocol requires an ACK from the bus when it sends something. It does not matter which module(s) acknowledge it but it will not continue until this happens. It is actually part of the CAN frame. Start with the cansend.ino and canreceive.ino pieces of code from the library. Until you get this working nothing else will. Your nodule choice uses a MPC2515, that works very well but be sure to check the crystal connected to it. I have come across 8 and 16 MHz crystals on them. You also need to connect the grounds, otherwise common mode noise will give you lots of problems.

I appreciate your attempt to point me in the right direction. For the next two days, I'il try to create something and keep you updated on what's going on. I hope to receive an answer to future questions about this project.

Postscript: Where i can find working library?

I use the Library by Cory J. Fowler, and downloaded it from github. It is not the fanciest but for me the main thing is it works. GitHub - coryjfowler/MCP_CAN_lib: MCP_CAN Library You must initialize the MCP2515 or it will not work. if(CAN0.begin(MCP_ANY,CAN_125KBPS , MCP_8MHZ) == CAN_OK)...
This line is important. This is for a 8Mhz Crystal and 125KBPS MCP2515.