Engineers who work with CAN communication often come across the term "bit stuffing," but what exactly is it, and why is it used? Many people may not fully understand its purpose, so this article aims to clarify it once and for all.
When it comes to digital data encoding, there are several methods such as Non-Return-to-Zero (NRZ), Manchester, or Pulse Width coding. These differ in how many time slots are used to represent a single bit. In NRZ, the signal level remains constant throughout the bit period, requiring only one time slot per bit. On the other hand, Manchester encoding changes the signal level within a bit period, thus needing two time slots per bit. One major advantage of Manchester encoding is that it provides self-clocking by ensuring a transition in every bit period. However, this also means that the bit rate is effectively halved compared to NRZ at the same bit time (bit frequency).
The downside of NRZ is that the signal can remain at the same level for long periods, depending on the data being sent. This could cause problems with synchronization, especially in systems where timing accuracy is critical. To avoid this, the CAN protocol uses a technique called "bit stuffing." It inserts an inverse bit into the stream after five consecutive identical bits, ensuring that the signal always has transitions, which helps maintain synchronization between nodes.
Figure 1: NRZ and Manchester coded bit representation
The CAN protocol uses NRZ encoding combined with bit stuffing, typically inserting an inverse bit after every five consecutive identical bits. This ensures reliable synchronization while maintaining high transmission efficiency. The method also improves signal integrity, as the energy radiated by the bus is related to both the frequency of the signal and the number of transitions. More transitions mean more radiation, which can be a consideration in electromagnetic compatibility (EMC) design.
Bit stuffing is applied to specific parts of the CAN frame, including the Start of Frame (SOF), arbitration field, control field, data field, data frame, and remote frame. When five identical bits are detected, an inverse bit is inserted. However, certain parts of the frame—such as the CRC delimiter, ACK field, and EOF—are transmitted without bit stuffing because they have a fixed pattern. The same applies to error frames and overload frames, which are structured in a way that doesn’t require additional stuffing.
Public Transport Escalator,Automatic Escalator,Metro Station Escalator,Escalator For Multi-Floor Malls
ZHONG HAN INTERNATIONAL TRADE CO., LTD , https://www.cck-ht.com