The CAN (Controller Area Network) bus is a widely used serial communication protocol, particularly suited for the automotive and industrial automation sectors. Message types on the CAN bus can be broadly categorized as follows, with each type having its specific purpose and format.
I. Data Frame
The data frame is the most basic message type on the CAN bus and is used to transmit data between nodes. A data frame consists of multiple segments, including the Start of Frame, Arbitration Field, Control Field, Data Field, CRC Field, ACK Field, and End of Frame.
1. Start of Frame (SOF)
- Definition: A segment indicating the start of a data frame, consisting of a single active bit (logic 0).
- Function: When the bus is idle, the transmitting node sends the Start of Frame; other receiving nodes synchronize to this Start of Frame bit.
2. Arbitration Field
- Definition: A segment that indicates the frame's priority. Depending on the length of the arbitration field ID code, frames are classified as standard frames (CAN 2.0A) and extended frames (CAN 2.0B).
- Contents: The arbitration field of a standard-format frame consists of an 11-bit identifier (ID) and a remote transmit request (RTR) bit; the arbitration field of an extended-format frame consists of a 29-bit identifier and an RTR bit.
- Function: Used to determine the type of frame being transmitted (data frame or remote control frame) and the frame format (standard frame or extended frame), as well as to establish the frame's priority.
3. Control Field
- Definition: A field that specifies the number of bytes in the data and the reserved bits.
- Contents: Includes the Data Length Code (DLC) and two reserved bits (r0, r1). The DLC indicates the number of bytes in the data field, which can range from 0 to 8 bytes.
- Function: Informs the receiving node of the length of the data field so that the data can be received correctly.
4. Data Field
- Definition: The content of the data; 0 to 8 bytes of data can be transmitted.
- Purpose: To transmit the actual data information.
5. CRC Field (Cyclic Redundancy Check Field)
- Definition: A field used to check for transmission errors in a frame, consisting of a CRC sequence and a CRC delimiter.
- Function: Ensures data integrity and accuracy through CRC verification.
6. ACK Field (Acknowledgment Field)
- Definition: A segment indicating confirmation of successful reception, consisting of an ACK slot and an ACK delimiter.
- Function: When the receiver correctly receives a valid message, it sends a positive bit to the transmitter during the ACK slot to acknowledge receipt.
7. End of Frame (EOF)
- Definition: A segment indicating the end of a data frame, consisting of 7 negative bits.
- Function: Signals the end of the data frame.
II. Remote Frame
A remote frame is used to request the transmission of a data frame with the same ID. When a receiving node needs certain data but does not have it, it sends a remote frame to request that the transmitting node send the corresponding data frame. The structure of a remote frame is similar to that of a data frame, but the data segment is empty, and the RTR bit is set to 1.
III. Error Frame
An error frame consists of two fields: the error flag and the error delimiter. When a receiving node detects an error in a message on the bus, it automatically transmits an "active error flag"; other nodes, upon detecting the active error flag, send an "error acknowledgment flag." The transmission of an error frame interrupts current bus communication until the error has been resolved.
IV. Overload Frame
An overload frame consists of an overload flag and an overload separator. An overload frame is transmitted when the receiving node requires excessive time to process the current data before receiving the next frame, or when a dominant level is detected in the interframe space field. The transmission of an overload frame delays the transmission of subsequent frames to ensure that communication on the bus is not interrupted due to overload.
V. Other Message Types
In addition to the four basic message types mentioned above, the CAN bus protocol defines several other special message types, such as the Interframe Space and N_PCI message types (e.g., single frame, start frame, continuous frame, flow control frame, etc.). These message types are used in specific communication scenarios to meet different communication requirements.
Summary
Message types on the CAN bus include basic types such as data frames, remote control frames, error frames, and overload frames, as well as special types such as Interframe Space and N_PCI message types. Each message type has its specific structure and purpose, collectively forming the foundation of CAN bus communication. In practical applications, selecting the appropriate message type for data transmission based on specific communication requirements ensures reliable and efficient communication.




