You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
[quote author="Riarrieta" date="1581525990"]Hi,
In my current project I'm implementing an ANT Shared Channel topology, where in each channel period the master polls a slave with an acknowledge message and receives the slave's data through a reverse direction acknowledge message or Advance Burst transfer. For data synchronization purposes, all slaves RTCs must be synchronized with the master's RTC, so every N channel periods the master sends an ANT Time Sync packet to all slaves. Each Time Sync packet contains the transmission time offset, calculated by the ANT stack, and the master's RTC value. With this information, and the time stamp of the received message, each slave can compute its offset relative to master.
While doing some testing, I noticed a really weird behavior: [em]"If in the channel period previous to a Time Sync packet the master sends an acknowledge message and receives a reverse direction acknowledge message or (Advance) Burst transfer, then the Time Sync packet will be invalidated and the stack won't compute the transmission time offset"[/em].
To exemplify this, I wrote a code that will be attached at the end. In each received Time Sync packet the slave prints (over UART) the page number, the user data (master's RTC value) and the transmission time offset. Valid page numbers are set to 0x01 and invalid page numbers are set to 0xFF.
[code]
// Slave's output
Page number: 255
User data: 186, 248, 248
Offset: 186, 248
Page number: 255
User data: 63, 106, 249
Offset: 63, 106
Page number: 255
User data: 196, 219, 249
Offset: 196, 219
// Slave's output. Adv. burst disabled in master.
Page number: 255
User data: 42, 190, 17
Offset: 173, 0
Page number: 255
User data: 175, 47, 18
Offset: 173, 0
Page number: 255
User data: 52, 161, 18
Offset: 173, 0