Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

CAN arbitration is done with IDs, and any node on the bus can transmit with any ID (ideally it should not, but a nasty node can).

What if two different nodes connected on the same CAN bus transmit messages with the same IDs but different data bytes?

My thinking: It will generate garbage on the bus. Whoever has the dominant bits those only will get transmitted.

share|improve this question
1  
I'm not sure why they did it this way. I would have thought it would make more sense for arbitration to apply to the whole message. – Rocketmagnet Oct 9 '12 at 9:35

2 Answers

up vote 5 down vote accepted

Section 6.1 of the CAN spec:

BIT ERROR: A unit that is sending a bit on the bus also monitors the bus. A BIT ERROR has to be detected at that bit time, when the bit value that is monitored is different from the bit value that is sent. An exception is the sending of a ’recessive’ bit during the stuffed bit stream of the ARBITRATION FIELD or during the ACK SLOT.

So, the node which first transmits a '1' when the other is transmitting a '0' will note a Bit Error and then signal an error as normal - by transmitting an error-flag (see Section 3.1.3) , as described formally in Section 6.2.

Informally, if that node is error-active (which should be the usual case) it will transmit an error flag of 6 dominant bits, which all other nodes will also detect (as a stuff error). This has the effect of destroying that message completely:

  • no-one will receive it
  • none of the transmitters will think they have successfully transmitted it.

Each transmitter will then attempt to retransmit - depending on the precise timing of the retransmissions, one may start sufficiently before the other the gain control of the bus. Otherwise, the same sequence may happen again. (Or another higher-priority message may put them both off for a while!)

share|improve this answer

If the messages data field is different, you'll (hopefully!) get an error frame on the bus due to wrong CRC.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.