Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Ant message encoding latency.

Avatar
RankRank

Total Posts: 40

Joined 2009-03-20

PM

Suppose I am working with an Ant master. I have a channel with a 4 Hz period. I am measuring a continuous signal. I tally up 250 msec averages of the signal and send them as broadcast at the 4Hz rate.

How can I ensure the lowest latency?

In other words, I want to wait until the last possible millisecond to complete the average and present it to the Ant processor for transmission.

At the protocol level, the problem looks like this: Sometime after the last message transmits, I receive an EVENT_TX message. After I get EVENT_TX, I can supply the next message to ANT. But how long can I wait after EVENT_TX before I "miss the bus" on the next outgoing transmission?

I suppose I can measure this, but I would prefer to have an official number.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Hi Mark,

There is no "official" number, but we think that 240ms would work (assuming UART @ 57600) for the 4Hz case. EVENT_TX gets generated by the ANT stack at the point where the radio is loaded, but there is some latency in sending it to you MCU. It usually doesn’t start getting sent out the serial port for ~300-500 us. The message transmission will take ~1.5 ms. Sending a broadcast message to ANT and having it processed should take ~3 ms. 240ms should give you some margin.

Please note, that number does depend on the serial implementation and any additional latency associated with processing on your system; you will need to test this on your own system to ensure you "don't miss the bus".