A Comprehensive Guide to CAN Bus Communication - Understanding Data Frames

In the previous article, we provided an overview of the CAN bus and discussed its applications in automotive communication. In today's piece, we delve deeper into CAN bus communication — specifically, an introduction to the Data Frame used in CAN communication.

CAN bus communication takes place in the form of "frames." The "Data Frame," as the name suggests, is designed for data transmission. CAN bus data frames are differentiated into Standard Format and Extended Format. The format for a standard frame is illustrated below:




The data frame can be divided into seven segments:

  1. Start Of Frame (SOF): 1 bit, explicit signal, indicates the beginning of a data frame (or remote frame).

  2. Arbitration Field: This includes two parts: the Identifier Field (ID) and the Remote Transfer Request (RTR) bit.

    The Identifier Field is a functional address used by CAN receivers to filter data frames. The identifier (CAN-ID) length for standard format data frames is 11 bits (11 bits), ranging from ID10 to ID0. ID10 is the most significant bit (MSB), and ID0 is the least significant bit (LSB), transmitted in the order of ID10 to ID0. The CAN protocol also stipulates that the first 7 bits of the highest weight (ID10 to ID4) cannot all be "dominant" signals.

    The Remote Transfer Request bit, abbreviated as "RTR," is 1 bit. Despite its long name, its function is simple — it distinguishes whether the frame is a data frame or a remote frame. "Dominant signal (0)" represents a data frame (Data Frame), while "Recessive signal (1)" represents a remote frame (Remote Frame).

  3. Control Field: This comprises 6 bits, including the Identifier Extension bit (IDE, 1 bit); Reserved bit0 (r0, 1 bit); and Data Length Code (DLC, 4 bits). The DLC specifies the number of bytes in the Data Field, as shown in the diagram below:



  • Identifier Extension bit (IDE): Indicates whether the frame is in standard format or extended format.

  • Reserved bit0 (r0): Reserved for future use.

  • Data Length Code (DLC): 4 bits (DLC3 to DLC0), indicating the actual length of the data sent in the frame (in bytes). The encoding rules for DLC are as follows:





















      4. 


Among these, "d" signifies a dominant signal, and "r" signifies a recessive signal.
Data Field: This segment contains the actual data being transmitted, with a maximum length of 8 bytes. The correspondence between the Data Field and DLC is illustrated in the diagram below:


  1. CRC Field (Cyclic Redundancy Check): This includes the Cyclic Redundancy Check Sequence (CRC Sequence) and Delimiter (DEL).
    • CRC Sequence: 15 bits, used for verifying the correctness of the transmission.
    • DEL (Delimiter): 1 bit, recessive signal, indicating the end of the CRC sequence.
  2. ACK Field (Acknowledge): This comprises the Acknowledge Slot (ACK SLOT) and Delimiter (DEL), indicating whether the reception is normal.
    • ACK SLOT (Acknowledge Slot): 1 bit. When a node receives the correct CRC sequence, the ACK bit at the transmitting end is set.
    • DEL (Delimiter): 1 bit, recessive signal.
  3. End of Frame (EOF): 7 bits, recessive signal, indicating the end of the frame.


The content provided above describes the standard format of a data frame. Now, let's explore the differences between the extended format and the standard format. Take a look at the following diagram:













  1. Arbitration Field: The arbitration field in the extended format includes five components:

    • Base Identifier (Base ID): 11 bits, identical to the identifier in the standard format.

    • Substitute Remote Request Bit (SRR): 1 bit, recessive signal.

    • Identifier Extension bit (IDE): 1 bit, indicating whether the frame is an extended frame or a standard frame.

    • Extended Identifier (Extended ID): 18 bits, storing the extended identifier.

    • Remote Transmission Request (RTR): 1 bit. In a data frame, it is a dominant signal; in a remote frame, it is a recessive signal.

  2. Control Field: 6 bits, different from the standard frame. It replaces IDE with Reserved bit 1 (r1), while r0 and DLC remain the same. In other words, the extended frame has two reserved bits, r1 and r0, both of which need to transmit dominant signals.

Related Reference Articles: