Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

How does ANT indicate that a command was successful?

Avatar
RankRankRankRank

Total Posts: 140

Joined 2008-12-09

PM

When developing PC applications, the PC is acting as the host controller, so when a DLL function is called, the corresponding message is sent to ANT. ANT will reply to most messages with another message, indicating whether they were successful or not. For example, when configuring the Channel ID, ANT will respond with a RESPONSE_NO_ERROR if the configuration was successful. This means that you have to process incoming messages from ANT to identify whether your command was successful or not. If the command was not successful, ANT will not issue any response. The application host controller must timeout appropriately if no response is received to a serial command. Please note that not all serial commands require a response. Please check the ANT Message Protocol and Usage document for details.      

Signature

For a complete list of frequently asked questions and answers, please view the FAQ user profile by clicking on the FAQ user name. 

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

"The application host controller must timeout appropriately"
for how long should the host wait to receive the RESPONSE_NO_ERROR
messsage?      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hi,

I'm developing a system and is encountering this problem occasionally. In normal situation, RESPONSE_NO_ERROR will arrived normally after each command is sent. In problem situation, RESPONSE_NO_ERROR never arrives and I can't proceed with the next command. This happens mostly during initialization.

What do you suggest when this sort of situation occurs?      
Rank

Total Posts: 21

Joined 2008-11-03

PM

Generally speaking, this error should be a very rare occurrence. If this is happening regularly, a review of the circuit design would be recommended to ensure proper design and functionality.

From a software point of view, if no response is received from ANT, the MCU should either retry sending the command - or reset entirely and try the configuration process again. The latter can be easier to implement using a watchdog timer, while the former may be necessary if resetting is not possible or desirable.

ANT will respond to a command right away, hence the response time is gauged by the time it takes to transmit the response message over the serial port. The message response is 7 bytes long. Some examples are shown below. Numbers should be buffered to allow some internal latency, especially if sending commands to a device with open channels.

Serial type: Asynchronous
8 data, 1 start, 1 stop, 0 parity
baud 57600

Min time to get response: [10 bits per byte]*[7 bytes per message] / [57600 bits per second]

= ~1.21 ms

Serial type: Asynchronous
8 data, 1 start, 1 stop, 0 parity
baud 57600

Min time to get response: [10 bits per byte]*[7 bytes per message] / [4800bits per second]

= ~14.58 ms

Serial type: Synchronous
8 data, 1 start, 1 stop, 0 parity
baud 150kHz

Min time to get response: [10 bits per byte]*[7 bytes per message] / [4800bits per second]

= ~0.5 ms