• admin@embedclogic.com

CAN Bit Monitoring and Stuffing

Bit Monitoring

Every transmitter reads back its transmitted bit from the CAN bus to ensure its transmitted data Integrity is called Bit monitoring.

Every node connected on a CAN network may be transmitter and receiver as well. If any node transmits some frame on CAN then all other will be listener along with the transmitter itself i.e a transmitter also read back its data from CAN line to ensure the Integrity of transmitted data and this concept is called Bit Monitoring. If read bit is not the same as transmitted then the node will consider as transmission error known as Bit-error which we see in next chapter.

The concept of CAN bus arbitration is also decided by bit monitoring.when two nodes start transmission at the same time and read back its transmitted bit then one have to leave bus if it read something else what it has transmitted and thus other node wins the arbitration and continue its transmission while looser node should wait for bus idle. see bus arbitration for more detail.

Note: During Arbitration no bit error will happen in case of bit mismatch.

Bit Stuffing

Insertion of a bit of opposite polarity after five consecutive bit of same polarity if that frame has more than five consecutive bits of same polarity is called bit stuffing.

As per CAN standard, more than 5 consecutive bits of the same polarity in CAN frame between the start of Frame(SOF) to CRC field is considered as a faulty frame on CAN Bus and it signalled as stuff error on CAN line.

Example

So to avoid this type of error transmitter insert a bit of opposite polarity after every 5 consecutive bit of the same polarity as shown in below figure and this process of bit insertion is known as bit stuffing while on receiver side these inserted bit is removed and received actual transmitted frame and it is called bit de-stuffing.


Bit Stuffing And De-stuffing

Note: In a CAN frame stuffing concept will not apply on CRC delimiter, ACK and EOF fields because these fields have fixed size.