Vehicle clock synchronization can_tsync synchronization principle

Publisher:数据梦想Latest update time:2024-02-03 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

  1. The time slave receives the sync message at time t2r

  2. 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.

  3. The time slave receives the follow up message at t3r.

  4. 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:

  1. The timestamp is added by software, not by hardware

  2. The delay on the CAN bus is not taken into account

  3. The error from t3r to the adjust clock is not taken into account.

picture

picture

  1. 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.

  2. 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;

  3. Byte1: When byte0 is 0x20 or 0x28, Byte1 is the CRC check value of the message;

  4. 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;

  5. 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;

  6. 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.


Reference address:Vehicle clock synchronization can_tsync synchronization principle

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

Vehicle clock synchronization can_tsync synchronization principle
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
[Embedded]
Vehicle clock synchronization can_tsync synchronization principle
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号