Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Unknown msg IDs

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hello all,
I've been trying to get my MCU to communicate with an AP2 module via UART (I am using the ANTAP2DK1 kit and a MCF51QE128). Once I have setup the channel and opened it the AP2 starts to send the last broadcast message it was transmitting before it was turned off or reset. I am able to see this message using the antware 2 software.

If I attempt to modify one of the values in the messages payload Antware 2 promptly shows me the new message that has been transmitted.

Here comes the strange part: if I change more then 1 value in an arbitrary way all I see in Antware 2 is the last message that was received and not the one with both vaues changed.

These are the messages I am sending from the MCU to AP2 (via UART) and vice versa:

MCU-> AP2: A4 09 4E 01 10 00 FF FF 02 02 03 03 F2
AP2->MCU: A4 03 05 01 03 FE FF

This message is correctly received and shown on Antware2. Next the MCU transmits:

MCU-> AP2: A4 09 4E 01 10 00 FF FF 02 08 03 03 0A
AP2 -> MCU: A4 03 C0 C0 03 FE FF

On Antware 2 All I see is the previous message.

On the ANT message protocol and usage document I can not find the meaning of the replies of the AP2 (0x05 and 0xC0).

Any help would be much appreciated.

Thanks
Bobby      
RankRankRank

Total Posts: 95

Joined 2010-05-03

PM

Hello,

Could you send the full channel configuration sequence, both on ANTware and your MCU. Also, include the responses from ANT during the configuration sequence.

This will help in figuring out why you are receiving those invalid messages.


Thanks!      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Thanks for your answer,
This are the values the MCU receives from the AP2 module:
(Reset)
0xA4, 0x01, 0x6F, 0x20, 0xEA
This is the message I would expect after sending the reset command. Next I set the network key and AP2 answers:
0xA4, 0x03, 0x01, 0x46, 0x00, 0xE8

0xE8 is not the value one gets if you calculate the XOR of the previous values. This lead me to believe that the data the MCU is showing me may not be the real data the ANT is sending (it is strange because the UAT library on the MCU works perfectly when used to communicate with a PC).

I decided to see if I had the same problem using the AP3 module. I did not: the same MCU code setup the channel and opened it and the AP3 module responded correctly to every command I used to set up the channel.

This is the sequence I use to se up the channel
1) reset AP module
2) Set Channel Key
3) Assign Channel
4) Set Channel ID
5) Set RF Frequency (to 2,457 GHz)
6) Open channel

I'm currently using the AP2 module and the AP3 module @ 57600 bps

Could it be that the data rate is too high for the AP2?


Anyone got any ideas?
Thanks for any help
Bobbymk      
RankRankRank

Total Posts: 95

Joined 2010-05-03

PM

Hi,

After setting the network key, the AP2 should send the Channel Response/Event message (0x40) (refer to ANT Message Protocol and Usage document for more details:

http://www.thisisant.com/images/Resources/PDF/1204662412_ant message protocol and usage.pdf).

However, the answer AP2 sends to the MCU:
0xA4, 0x03, 0x01, 0x46, 0x00, 0xE8
after you have set the network key, has one byte missing and that is the "0x40" byte. Therefore, maybe one of your pins is not connected.

What you can do is send us the schematic to have a look at and figure out what the problem is. Also, you can use the oscilloscope and check the serial lines' values.

As for the baud rate you are using; 57600 bps, it is the right baud rate for both AP2 and AT3.      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Thanks for your answere.
I think I found the problem: when I set my mcu uart to 57600 bps I get framing errors when recieving data from the ap2 module (this does not happen with the AP3). To fix the problem I set the mcu uart to 59000 bps (2,4% more then it shold be).
By doing this eveything is working as it should: I get the correct the responses from every command I send and I am able to transmit data.
Any ideas why this would happen? From what I remember tha AP3 module uses SensScore and so when I communicate with it the commands are sent to an MCU on the ant board. This mcu then sends the data to Nordics chip. In the AP2 module, instead, one communicates directly with nordics chip.
Could the error tollerance on the ap2 be too big for the MCF51QE128 while the errore on the AP3 is acceptable?
I am probably overlooking something because I have not seen any posts in which a similar problem has occurred.
Thanks for any advice and help.
Bobby      
RankRankRank

Total Posts: 95

Joined 2010-05-03

PM

Hi Bobby,

That is strange that at 59000 bps, the problem is fixed! As I said it should be working fine at 57600 bps. Therefore, I would think the reason for this strange behavior is that there is something wrong with the clock.      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hello,
First of all thanks for you help guys.
Second of all let me just say: My bad!
The problem was due to the fact that the demo board of the MCU I'm using has the UART Rx pin shared with a variable resistor. This introduced noise and so explains the problem...:blush:
Thanks for the help everyone.
Hope not to make similar errors in the future!