Arduino CAN Send and Receive

Hello All,

Not sure if this is the right forum to ask.

I am currently using a CAN-BUS shield to communicate with another CAN-BUS by following this website. Web

My question:
Can Arduino do both Send and Read in one unit/code. If so, How?

All examples I've seen, including above website, only show either reading or sending in one code/Arduino. (one Arduino reading and other sending)

I would like to have two-way CAN communication between two units but am not sure if that is possible. From my limited knowledge of CAN signals, I am concerned there will be overlap between sending and receiving signal that could cause issues. Would I need to time the signals somehow?

Is there a website/example/details that can be provided to help me understand if two-way communication is possible with Arduino CAN-bus?

Yes, Put both sending and receiving code on both Arduino's.

No, the can bus controller takes care of all that for you.

I couldn't find one, but I didn't spend much time looking.

The signals will not overlap, the CAN bus will pick the one with the highest priority and send it through first, then send the other regardless of who is sending it. This is part of the bus arbitration algorithm and is controlled by how the message is coded.

Dronebotworkshop covers CANBUS on the UNO R4. Search "Using the CAN Bus" on this page:
https://dronebotworkshop.com/arduino-uno-r4-minima-wifi/
And, slew to 21:36 of this video:

By definition CAN is a bidirectional bus. This can be deduced from the fact that it is a multi master bus. CAN is a CSMA/CD protocol, this stating that each node on the bus can detect collisions and back off before the colliding bit is finished. It then waits for a certain amount of time before trying to retransmit. This forms NDA (Non Destructive Arbitration.) This collision detection is achieved through a priority arbitration based on the message identifiers. This is accomplished by the usage of dominant and recessive bits used on the CAN bus. This is why it is used worldwide in vehicles, plains, etc.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.