Thursday 19 April 2018

Bus Arbitration in CAN

 There may be a condition when two nodes start transmitting at exact same time. The aforementioned mechanism will not be useful in this case. To solve this problem CAN uses collision detection and bit wise arbitration.


The frame has multiple fields but we are only interested in the first two fields, SOF and Identifier. SOF is a bit used to signal start of a frame to all other nodes on the bus. The 2nd field is the Identifier which is identifier for the type of message to be transmitted in the frame. The lower the identifier higher the priority of the message. MSB is always transmitted first on the bus.


 CAN bus has two states a recessive state (logic level 1) and a dominant state (logic level 0). The bus is always in the recessive state by default (i.e. using pull up resistors)


For example two nodes start transmitting at same time both will transmit SOF bit at same time this will have no effect on arbitration, after that they start transmitting identifier. Each node transmits a bit and then observes the bus if the data it sent is same as data it sensed and it continues to transmit the identifier. When the nodes observes that the bit it transmitted and the bit it sensed back are not same it knows that a higher priority message is being transmitted on the bus and it starts listening and stops transmitting.


Two nodes A and B that start transmitting at same time Node A has identifier 48 while node B has identifier 56. When both transmit the 8th bit Node B observes that its recessive 1 has been over ridden by a dominant 0. So its tops transmitting and node A continues with its Frame transmission which is revived by all the nodes on the bus.

No comments:

Post a Comment