CAN Bit Stuffing
CAN Bit Stuffing
AGENDA
Shyam Bhat
VicharaVandana
Need for Bit Stuffing
CAN Protocol is a Asynchronous Protocol.
There is no Clock signal to tell which bit is currently on bus or to synchronize between Rx
nodes with Tx nodes.
In CAN network all Rx nodes synchronize initially with Tx node with falling edge of SOF bit.
Then with its internal clock ticks it keeps track of bits and with each edge the Nodes are
resynchronized.
1 0 1 0 1 0 1 0
Need for Bit Stuffing
All Rx nodes have internal clock ticks depending upon which it knows when one bit ends
and when next bit starts on the bus. But with each bit the tolerance or delta error keeps on
building.
With every edge (or bus state change) the Rx node knows the next bit has come and re
adjusts the internal clock ticks and this is called as Resynchronization of Rx nodes with Tx
node.
So having bus state constant or unchanged for long time is risky in terms of Rx nodes being
in synch with Tx node.
SO CAN protocol designers after research came up with the strategy of bit stuffing.
If CAN bus has constant value for 5 bit lengths atleast then a complimentary bit is inserted
next to it. This is called as bit stuffing
Which part of frame is bit stuffed
Arbitration Control Data CRC ACK End of Frame
S R A
R R C A
O Message ID T DLC Data Checksum C EOF IFS
1 0 D D
F R K
0 1 1 1 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 10101010 01010101 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1
Bit Stuffing
The Bit stuffing is applicable from beginning of SOF till end of checksum field.
Bit stuffing is not applicable for Fixed form part (i.e CD to IFS)
Stuffed Bits are considered for CRC computation in CAN frame
Tx side Frame is bit stuffed and sent on bus Bit Stuffing
Rx side the stuffed bits are removed and then processed further Bit DeStuffing