Timestamp synchronization mechanism between multiple devices of the same star TSync function and use

Sharing | TSync function and use of the synchronization mechanism of the timestamp between multiple devices

With the increasing number of channels for automotive network testing, it is often necessary to connect multiple TOSUN devices to the same TSMaster application on the same computer at the same time, and perform functions such as CAN message sending and receiving and logging by multiple devices at the same time, which inevitably has the requirement of timestamp synchronization between multiple devices as well as time synchronization between devices and the operating system on the computer.

 

In order to meet TOSUN between multiple devices and devices and computers between the time synchronization requirements, in this regard, TOSUN TSMaster introduced the TSync synchronization mechanism function, this article introduces the TSync synchronization mechanism function and the corresponding method of use.

Keywords in this article: tsync synchronization mechanism, multiple devices, devices and computers, timestamp synchronization

Table of Contents for this article

01、Why there is synchronization error between equipment

In a multi-device operating environment, each device has an internal clock source. Usually generated by a crystal, the number of pulses are counted by the controller, which in turn timestamps specific events (e.g., message reception, send completion, etc.). This is shown in Figure 1. When multiple devices receive the same event, we would like to get the same timestamp, but this is usually not done and the sources of error include:

 

Phase Error:For example, different device power-up timings, startup sequences, etc. lead to fixed deviations in their timestamps;

Frequency deviation:Even though the phase deviation is corrected during startup, there is still a slight difference in the frequency of the crystal.

 

For example, a crystal with a temperature difference of ±30 ppm at room temperature, assuming that the actual deviation is 10 ppm, i.e., 10 parts per million, will produce 60*60*1000*10/10^6 = 36 milliseconds of deviation in one hour, which is brought about by the lowest level device, and the device can not be corrected by itself alone.

Independent clock module for each device
Figure 1 Each device has a separate clock module

02. Awakening

TSync time synchronization mechanism function is for TOSUN device, including TC series, TP series and other CAN/CAN FD devices, to achieve the synchronization timestamp error between devices is less than 500 microseconds, and to ensure that the time of TOSUN device and the computer operating system is also completely synchronized function. As shown in Figure 2.
TC1013 devices that support the TSync time synchronization mechanism
Figure 2 TC1013 device supporting TSync time synchronization mechanism

2.1 Verification methods for the TSync time synchronization mechanism

TSync time synchronization verification is achieved by sending and receiving CAN messages through two TOSUN devices, the main verification method is to use the CAN message send callback event and CAN message receive callback event of C applet to get the message timestamp, and further calculate the time difference between the message sending time of device A and the message receiving time of device B, which is "comp_time", as shown in Fig. 3. time", as shown in Figure 3. At the same time, the graphical module can be used to accurately observe the floating change of the time difference between devices and derive the synchronization effect between devices.

Part of the validation script for the TSync time synchronization mechanism
Figure 3 Part of the verification script for the TSync time synchronization mechanism

The following compares the differences in time synchronization between the devices of the two test groups by means of a reference test group with and without the TSync synchronization mechanism activated.

 

2.2 Reference test set for activating the TSync time synchronization mechanism

Reference test group 1: Using activated TSync mechanism and running for more than 48 hours

[Project]

descriptive

[TOSUN devices]

Two TC1013s, designated by "Equipment A" and "Equipment B"

[Device firmware compilation time]

V2024-09-21

[Software environment]

TSMaster x64 v2024.9.23.1185

[TSync mechanism activated]

be

[Test Procedure]

► Physically connect CAN channel 1 of "Device A" to CAN channel 1 of "Device B".

► CAN message 0x123 sent by "Device A" channel 1, received by "Device B" channel 1

► Run the C applet script to calculate the send/receive time difference between the two devices

► Observation of the time difference by means of a graphical module

► Continuous operation and observation

[Test run length]

178200 seconds, i.e. over 48 hours

 

Refer to the results of the test group 1 run:

After 2 days of continuous operation and observation, it can be found that the time difference "comp_time" between the two devices has been maintained at about 220 microseconds. In fact, this 200us difference is mainly due to the startup phase error, because the error caused by different crystal sources has been controlled to a very small range, so it can meet most of the synchronization requirements of CAN bus communication. As shown in Figure 4.

Figure 4 Graphical results of activating TSync time synchronization
Fig. 4 Long wake-up signal
The actual timestamps of the time of sending the message and the time of receiving the message are printed via a system message, together with the corresponding differences, as shown in Figure 5.
Figure 5 System message activating TSync time synchronization
Figure 5 System message activating TSync time synchronization

2.3 Reference test set without TSync time synchronization mechanism activated

Reference test group 2: TSync mechanism not activated

[Project]

descriptive

[TOSUN devices]

Two TC1013s, designated by "Equipment A" and "Equipment B"

[Device firmware compilation time]

V2024-09-21

[Software environment]

TSMaster x64 v2024.9.23.1185

[TSync mechanism activated]

clogged

[Test Procedure]

► Physically connect CAN channel 1 of "Device A" to CAN channel 1 of "Device B".

► CAN message 0x123 sent by "Device A" channel 1, received by "Device B" channel 1

► Run the C applet script to calculate the send/receive time difference between the two devices

► Observation of the time difference by means of a graphical module

► Continuous operation and observation

[Test run length]

About 30 minutes.

 

Refer to the results of the test group 2 run:

Without activating the TSync time synchronization function in advance, you can find that the time difference between the two devices for sending and receiving messages "comp_time" is getting bigger and bigger with the running time, which is not quite in line with the application of time synchronization requirements. As shown in Figure 6.

Figure 6 Results of running TSync time synchronization without activation
Figure 6 Results of running TSync time synchronization without activation

03、How to activate the TSync function of TOSUN device

To activate the TSync function of TOSUN device, mainly through upgrading the device firmware and the control settings of TSync on the TSMaster software side.

 

3.1 Upgrading the firmware of the updated device

The procedure for upgrading the firmware of TOSUN device is as follows:

 

1. Prepare a computer and install the latest version of TSMaster software, the recommended version is V2024.09.23.1185 and above. Software update path: [Help] - [Check Upgrade] - [Download Public Test Version]. As shown in Figure 7.

Figure 7 Upgrade and download the latest version of TSMaster
Figure 7 Upgrade and download the latest version of TSMaster

2. Connect the device that needs to be upgraded to the computer via USB.

 

3. Through [Hardware] - [Channel Mapping] - [Hardware], after selecting the device, right-click at [Device Firmware Compilation Time] on the right and select [Read Latest Firmware Compilation Time], as shown in Figure 8.

Figure 8 Reading the latest firmware compilation time
Figure 8 Reading the latest firmware compilation time
4. After reading, select [Update Device Firmware], after the download prompts "Load Firmware Complete", select [Upgrade] button to upgrade automatically. As shown in Figure 9. After the upgrade is successful, plug and unplug the USB port of the device according to the prompts.
Figure 9 Upgrading Firmware
Figure 9 Upgrading Firmware

3.2 TSync Control Settings for TSMaster Software

After connecting the device to the TSMaster, activate [Enable TSync Time Synchronization Mechanism] through [Hardware] - [Channel Selection] - [Settings] - [TSync Control], and you can refresh the list by right clicking on "List of Online Devices Supporting TSync Technology" at the bottom. After enabling the TSync mechanism, devices that support this mechanism can realize hardware timestamp synchronization. As shown in Figure 10.

Figure 11 LIN Sleep Frame Oscilloscope Waveforms
Figure 10 Enabling the TSync time synchronization mechanism
tip
  1. Software Download:
    Click on the software download link below to download and install directly, beta version is recommended:

  2. Software upgrades:
    You can check for upgrades to the latest version within the software, provided that your computer has an Internet connection.

Note: TOSUN Technical Support Email:support@tosunai.cnWe welcome inquiries! (Company and contact information must be indicated)

发表回复

en_USEnglish
×
×

产品入口: 产品添加到购物车

Download location

Please click the download button below to start experiencing the powerful TSMaster features. Thank you for your support!

Beta version updated weekly, full version updated monthly
Installation environment
  • 1
    Windows 7 SP1 or higher, supports Win10, and WIn11.

    Operating System

  • 2
    8GB

    random access memory (RAM)

  • 3
    At least 550MB of free space

    disk space

  • 4
    Dual-core (2-core) or higher

    CPU

Please ensure that your computer meets at least these requirements in order to install and run the TSMaster software successfully. If your computer does not meet these requirements, it may cause performance problems or not run the software properly. You may want to consider upgrading your hardware if you need smoother running features.