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

Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi Rodrigo,

Sorry about the delayed reply. We'll need to do more internal testing before we can give a more satisfactory answer later, but Time Sync's interactions with other features such as shared channels and advanced burst is currently undefined, as Time Sync's intended use case was with broadcast channels only.


Regards      
Avatar
Rank

Total Posts: 1

Joined 2020-11-27

PM

[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 purposesall 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 valueWith this information, and the time stamp of the received messageeach slave can compute its offset relative to master.

While 
doing some testingI 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 thisI wrote a code that will be attached at the endIn each received Time Sync packet the slave prints (over UARTthe page numberthe 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
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.