The CAN bus can be mounted with multiple control units, and each unit can send and receive data. In order to avoid conflicts, the protocol stipulates that only units with high priority can occupy the bus and send data when the channel is idle. So how does the CAN unit What about determining priorities?
How CAN arbitration is implemented
1. The position of CANID in the CAN message
The CANID of each CAN message consists of 11bit/29bits that uniquely identify it. Taking the standard CAN frame as an example, the position of the 11bitCANID in the CAN frame is shown in Figure 1. After SOF is the Identifier. The CANID to be sent out by each node passes CANID arbitration, and messages with high priority are sent first. At the same time, the corresponding node obtains the right to use the CAN bus first, while the node that fails arbitration stops sending data and turns to receiving data. It can only wait for the next SOF moment before arbitration.
Figure 1 Standard CAN data frame format
2. Implementation of CAN bus arbitration mechanism
So how is the priority of CANID determined? In fact, the CAN bus ID arbitration method is equivalent to a "wired AND" structure. The phase AND of dominant (logic 0) and invisible (logic 1) becomes dominant, that is, 0&1=0. The hardware circuit diagram can be referred to Figure 2. The bus arbitration method of the standard CAN frame format is shown in Figure 3. Because the high bit comes first and the low bit comes last, the smaller the value of the CAN identifier, the higher the priority.
Figure 2 Line and circuit diagram
Figure 3 Bus arbitration mode diagram
Conditions and phenomena for CANID conflicts to occur
1. Conditions for CANID conflict
This article takes our company's protocol conversion module CSM300 as an example to introduce. CSM300 is an embedded CAN and UART/SPI that integrates microprocessor, CAN-bus controller, CAN-bus transceiver, DC-DC conversion, and high-speed digital isolation. Bidirectional conversion module. If we combine two CSM300 modules with IDs 00 00 00 00 to form a CAN bus network system, arbitration will fail when these two modules with the same ID send data to the CAN bus side at the same time.
2. The phenomenon of CANID conflict
Taking CSM300 as an example, the circuit hardware simple connection diagram is shown in Figure 4. Two host computers are used to send a set of data to two modules with the same configuration through two serial ports at the same time. At this time, the two modules will receive the RXD pin at the same time. The received data is converted to the CAN bus terminal. Because the IDs of the two CAN nodes are the same, the CAN bus arbitration fails, and the two sending nodes cannot receive the feedback signal and will always send the last frame of data. At this time, the waveform at the CAN bus end is shown in Figure 5.
Figure 4 CSM300 circuit connection diagram
Figure 5 CAN bus waveform diagram
How CSM series avoids CANID conflicts
In order to meet applications in different environments, the CSM300 series and CSM100 series have three conversion methods for users to choose: transparent conversion, transparent conversion with logo, and custom protocol conversion, as shown in Figure 6.
Figure 6 Conversion mode selection diagram
In the transparent conversion mode, the user can configure the module to a different ID through the MCU or host computer to avoid arbitration failure. In the transparent conversion mode, the module does not need to perform additional processing on the data, which maximizes the data conversion speed and also improves the efficiency. Buffer utilization. However, the CANID of each module in this mode cannot be changed after the configuration is completed unless the user configures it again. In addition, in this mode, two sets of UART frames with close time intervals may be recognized as a set of data for conversion, causing data conversion errors.
In the transparent band identification conversion mode, the user can fix the position and length of the CANID in the serial frame during configuration, as shown in Figure 7, and control the CAN frame ID of the sent data by changing the serial frame data, which is convenient for users to send at the same node. CAN data with different IDs. However, in this mode, it is necessary to ensure that the time interval of the serial frames is large enough to avoid data conversion errors caused by the module not being able to correctly identify the end of each group of serial frames. For specific requirements on the minimum interval of serial frames in transparent band identification mode, please refer to the user manuals of CSM100 and CSM300.
Figure 7 Transparent band logo conversion configuration diagram
Effective custom protocol conversion serial frames include frame header, frame tail, frame ID, frame length, etc. Users can control the CAN frame ID by changing the serial frame data, making it convenient for users to send CAN data with different IDs on the same node. At the same time, the user will fix the frame header and frame tail during configuration, as shown in Figure 8. In this mode, the user informs the module of the frame header, frame tail, and data length of the serial frame through serial frame data. Therefore, this conversion method can effectively avoid errors. Data conversion errors caused by short serial frame intervals.
Figure 8 Custom conversion configuration diagram
Previous article:Apply the latest CAN bus enhancements for safe and reliable high-speed automotive communications
Next article:Analysis and Countermeasures of Automotive EPB Wire Harness Wire Breakage
- Popular Resources
- Popular amplifiers
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- How much do you know about intelligent driving domain control: low-end and mid-end models are accelerating their introduction, with integrated driving and parking solutions accounting for the majority
- Foresight Launches Six Advanced Stereo Sensor Suite to Revolutionize Industrial and Automotive 3D Perception
- OPTIMA launches new ORANGETOP QH6 lithium battery to adapt to extreme temperature conditions
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions
- TDK launches second generation 6-axis IMU for automotive safety applications
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- TI Three-Phase Motor Drive BoosterPack Evaluation Module
- What does this runtime warning mean and how to deal with it?
- ESP32 configures WIFI via Bluetooth
- LT5400AIMS8E-4#PBF If you need help with replacement, or provide this material directly, thank you!
- Calculations on the LM317 charging circuit
- Analysis of the design of real-time embedded digital processing system based on c2000
- [Today at 10:00] Focus on the core technology of speech recognition: Microchip Timberwolf audio processor online seminar
- Digital Circuit and Logic Design Study Guide
- MBUS front-end protection
- KiCad Simplified Chinese Manual