Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Time Sync feature doesn’t work if Adv. Burst feature is enabled.

Rank

Total Posts: 1

Joined 2020-01-22

PM

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

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.
// Slave's output
Page number255 
User data
186248248 
Offset
186248 
 
Page number
255 
User data
63106249 
Offset
63106 
 
Page number
255 
User data
196219249 
Offset
196219 

As you can see, received Time Sync packets are invalidated and the transmission time offset is equal to the master's RTC value, that is, the transmission time offset isn't being computed by the ANT stack. Now, if I disable the master's Adv. Burst feature, I get the following:
// Slave's output. Adv. burst disabled in master.
Page number255 
User data
4219017 
Offset
173
 
Page number
255 
User data
1754718 
Offset
173
 
Page number
255 
User data
5216118 
Offset
173

The Time Sync packets are still getting invalidated, but the transmission time offset is being computed. On the other hand, if the Adv. Burst feature is enabled and the master sends broadcast messages instead of acknowledge messages, then the Time Sync packets are valid and the transmission time offset is computed. Something similar happens if the slave sends broadcast messages instead of ack/burst.

I tested that this behavior is independent of

- Channel configuration (channel period, channel RF, shared channel or independent channel).
- Time Sync invalidation enabled/disabled.
- Number of messages between Time Sync packets.

A possible fix is to disable the master's Adv. Burst feature when a Time Sync packet is being sent, and for now is working well. Nevertheless, I still have some doubts:

1.- Under what circumstances a Time Sync packet is invalidated by the stack?
2.- Under what circumstances the stack doesn't compute the transmission time offset in a Time Sync packet? Is this normal?
3.- Are there any incompatibilities between the Adv. Burst feature and the Time Sync feature?

I've already checked the following documents, but I couldn't find anything that helps:

- ANT Message Protocol and Usage, Rev 5.1.
- ANT Burst transfers, Rev 3.0.
- ANT Time Sync Application Note, Rev 1.0.

I'm using a PCA10040 DK with a nRF52832 marked QFAAEQ and a MDK V2.0 with a nRF52832 marked QFAAB0. Both are using SDK16.0 and SoftDevice S332 6.1.1.

Thanks in advance,
Rodrigo.      

File Attachments