Hi,
I wanted to get some information on the CAN bus (control area network), when communicating between 2 or more Arduino's bi-directional, as there isn't much information I can find online.
I don't have a specific project in mind for it, it's just out of interest for now.
I have read that if 2 MCU's in a CAN network attempt to send a message to each other at the same time, and they collide, the node with higher priority gets to send their message first, and once their message is sent, the lower priority node will get to send their message.
Does this then mean that you could have 2 or more Arduino's communicating with each other, in both directions, without the need to ensure that there's only 1 node as a transmitter, with the rest as receivers, at a given time?
For example, In a 3 node network; Node 1 can send something (lets say 10 bytes) directly to node 3, and node 2 can send something (e.g. 5 bytes) directly to node 1, without the need for additional programming to ensure that there's only 1 transmitter, at any given time.
If there is a collision, then if node 1 has a higher priority than node 2, node 1 will send its message first, and then node 2 will send its message once node 1 is finished.
If that doesn't actually work very well, what would be some another ways to program the 2-way communication in a CAN bus network?
This would differ from a communication method I've seen used in an RS485 network (I think it's called a star topology), where there is a single master, which makes a request for data from only 1 slave in a queue at a given time, and then requests data from the next slave in the queue, and so on, and then returns to the start of the queue once all the slaves in the queue have been requested, and repeats. That allows for only 1 transmitter (and the rest as receivers) at a given time.
Thanks.