[PR]
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
- Newer : What is CANbus
- Older : Working principle of CANbus network
]
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
CANbus is an efficient and reliable serial communication protocol for embedded systems. It is mainly used in vehicles, industrial automation, medical equipment and other fields. In these systems, CANbus provides a standardized solution for communication between various electronic control units (ECUs). The following will introduce the communication mechanism and data processing method of CANbus in detail.
CANbus communication mechanism
1. Composition of data frame
The basic communication unit of CANbus is the data frame. The data frame includes the following main parts:
Start bit (Start of Frame): Identifies the beginning of the data frame.
Identifier (Identifier): Used to identify the priority and content of the data, the standard frame uses an 11-bit identifier, and the extended frame uses a 29-bit identifier.
Control field (Control Field): Contains the data length code (DLC), indicating the length of the data field.
Data field (Data Field): The actual transmitted data can contain up to 8 bytes of data (standard CAN), or 64 bytes (CAN FD).
Cyclic redundancy check (CRC): Used to detect errors in data transmission.
Acknowledge bit (ACK): The receiving node uses it to confirm the reception of the data frame.
End bit (End of Frame): Identifies the end of the data frame.
2. Frame Type
Data Frame: used to transmit data.
Remote Frame: request to send a data frame.
Error Frame: used to indicate and report communication errors.
Overload Frame: used to indicate that the network is overloaded or the node needs extra time to process data.
3. Data Transmission Process
Node Request Access: The CAN bus uses a non-conflicting broadcast mechanism. When a node needs to send data, it first listens to the bus status to ensure that the bus is idle.
Arbitration Process: If two or more nodes send data at the same time, the CAN protocol uses a priority arbitration mechanism to determine which node has priority to send. The lower the identifier, the higher the priority. The arbitration process is based on bit competition, and the levels of different bits determine which node wins the arbitration.
Data Transmission: After arbitration, the winning node starts to transmit the data frame. After receiving the data frame, other nodes will perform data verification and confirm the integrity of the data based on the CRC field.
Error Handling: When a node receives data, it will perform error detection, including bit errors, padding errors, and CRC errors. If an error is detected, the node raises an error flag and retransmits the data.
2024/08/21 NB Module Comment(0)
COMMENT
COMMENT FORM