Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Strange behaviour in synchronous mode

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

I am just starting to work with ANT and am trying to communicate with a AP281M5IB module in synchronous byte-flow control mode. Unfortunately it does not work for me as it should and I hope you can hint me what I may be doing wrong.

1) I reset the module with 1ms RESET signal, then wait 0.5s before starting to really communicate. I am not doing the synchronization sequenca as I understand this is not necessary and even with the sequence, the behaviour was the same.

2) ANT sends me bytes 0x 12 C0 7B 00 29, without preceeding sync byte. These bytes seem to make no sense.

3) When I pull MSG READY down to send a message, I get 0xD2 (followed by 0xFF) instead of the sync byte. I receive this 0xD2 many times(once I counted it was 6 times) and finally I receive the sync byte 0xA5.

4) After receiving the sync byte, I start to send the reset command. After sending just one byte, ANT pulls SEN high and I can not send rest of the packet.

Unfortunately I do not have a scope or analyzer right now to see what is exactly going on. I hope the symptoms that I gave can give some hints to where is the problem, ie. what may I be doing wrong.      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

In order for the Host MCU to guarantee synchronization with ANT in start-up conditions, it must reset ANT immediately after power-up.
Your sequence should be changed as following:
SYNC_SMSGRDY_DEASSERT(); // make sure it is deasserted so that it doesn't misguide ANT
SYNC_SRDY_DEASSERT(); // put SRDY in a known state

ANT_PIN_RESET(); // Do a PIN reset
...
DELAY for 0.5s to reset ANT AP2 Module.      
Rank

Total Posts: 1

Joined 0

PM

The problem was that the bit-order of the MCU's SPI block and ANT are different. Flipping the bits around made the data reasonable and now I have good communication.

Sorry for posting because of a silly mistake like this.