can_tsync synchronization principle
In general, CAN time synchronization is relatively simple, as shown in the figure below. The whole process is as follows (tips: the time elapsed since 00:00:00 on January 1, 1970, is composed of seconds + nanoseconds.):
1The time master sends a sync message in the form of a broadcast at t01, and puts the time part of the time into the message and sends it to the time slave; using the can confirmation mechanism, record the time when the sync message is actually sent from the can driver, t1r.
-
The time slave receives the sync message at time t2r
-
After the sync is sent, the time master sends a follow up message and sends out the nanoseconds of t1r through the message, that is, t4r = t2r-s(t0r). There is a potential condition here, that is, the sync message is assembled by the can timesync module and then the sending interface is called until it is sent out from the can driver. The whole time will not exceed 1s. Therefore, t4r is actually a delay from the can timesync message being sent out until the can driver sends it out.
-
The time slave receives the follow up message at t3r.
-
Therefore, at time t3r, the real time of the master at this moment is t(master_now) = t3r - t2r + t4r
Note: In reality, most of the times above are inaccurate:
-
The timestamp is added by software, not by hardware
-
The delay on the CAN bus is not taken into account
-
The error from t3r to the adjust clock is not taken into account.
-
SYNC and FOLLOW_UP messages are divided into two formats. Type=0x10 is an unsafe message format without CRC check, and the corresponding FUP message type is 0x18; Type=0x20 is a safe message format with CRC check, and the corresponding FUP message type is 0x28.
-
Byte0: Time synchronization type: 0x20 means that the current message sent is a TSync message with CRC check, 0x28 means that the current message sent is a FUP message corresponding to the 0x20 SYNC message; 0x10 means that the current message sent is a TSync message without CRC check, 0x18 means that the current message sent is a FUP message corresponding to the 0x10 SYNC message;
-
Byte1: When byte0 is 0x20 or 0x28, Byte1 is the CRC check value of the message;
-
Byte2: The upper 4 bits are the time domain; the lower 4 bits are the sequence counter, which is accumulated cyclically with the number of transmissions;
-
Byte3: When byte0 is 0x10 or 0x20, Byte3 is UserByte0; when the synchronization type is 0x28 or 0x18, the upper 5 bits are reserved, bit3 SGW is the time synchronization status (0: SyncToGTM, 1: SyncToSubDomain), bit1-bit0 OVS is the time synchronization overflow time overflow of seconds;
-
Byte4-Byte7 is the synchronization time. When the synchronization type is SYNC message, it is 32 bits of seconds. When the synchronization type is FUP message, it is 30 bits of ns.
Previous article:Implementation principle of vehicle clock synchronization can_tsync
Next article:A switch quantity detection circuit commonly used in automotive electronics
Recommended ReadingLatest update time:2024-11-16 09:43
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- 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
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Problems with devices that measure temperature
- Difference between Ethernet and Broadband
- Interpretation of how dust and water resistance testing of lamps is applied in international standards
- Is it as shown in the picture?
- PCB file conversion
- 5G indoor base stations will be released soon, and it is expected that each household will have a small base station, which will subvert the existing home Internet access methods.
- How to consider the impact of audio analog signals after being transmitted through a 100m long cable?
- Angle sensor
- Transistor Selection
- NUCLEO_G431RB Review - RTC Real-time Clock