Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Broadcast Transmission Problem

Rank

Total Posts: 25

Joined 2010-01-29

PM

Hi,

I'm using an asyncrhonous serial interface to communicate with ANT.

To configure the master ANT i'm sending this set of instruction:

{ 0xA4, 0x09, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEB };
{ 0xA4, 0x03, 0x42, 0x00, 0X10, 0X00, 0xF5 };
{ 0xA4, 0x05, 0x51, 0x00, 0X21, 0X00, 0x01, 0x01, 0xD1 };
{ 0xA4, 0x03, 0x43, 0x00, 0X00, 0X04, 0xE0 };
{ 0xA4, 0x02, 0x45, 0x00, 0X42, 0XA1 };
{ 0xA4, 0x02, 0x47, 0x00, 0X03, 0XE2 };
{ 0xA4, 0x01, 0x4B, 0x00, 0XEE };
{ 0xA4, 0x09, 0x4E, 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0XEB };

and I receive:
{ 0x41 0x03 0x40 0x00 0x46 0x00 };
{ 0x41 0x03 0x40 0x00 0x42 0x00 };
{ 0x41 0x03 0x40 0x00 0x51 0x00 };
{ 0x41 0x03 0x40 0x00 0x43 0x00 };
{ 0x41 0x03 0x40 0x00 0x45 0x00 };
{ 0x41 0x03 0x40 0x00 0x47 0x00 };
{ 0x41 0x03 0x40 0x00 0x4B 0x00 };
{ 0x41 0x03 0x40 0x00 0x01 0x03 };

The master seems to work perfectly. Nevertheless, the slave receive this broadcast data :

Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-63-64-65-66-67-68

instead of :: 4e, 00-61-62-63-64-65-66-67-68

I don't understand where the problem can coming from, cause my radio frequency, channel period and Tx power are the same.
I'm using ANTwareII to receive data.

Do you have an idea?

Regards, Lionel.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Could you post the ANTwareII log (Device0.txt) from when you see this problem?      
Rank

Total Posts: 25

Joined 2010-01-29

PM

I'm using ANTWareII just for the chip that receive data. I can only save xml file for Channel and Device profile.
I've made a screenshot, so you can see my configuration.      
Rank

Total Posts: 25

Joined 2010-01-29

PM

Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Logs are automatically generated, you can directly access the directory where logs are stored under the Log Files menu entry.

By the way, are you waiting for the response from ANT when you send a message before sending the next command?      
Rank

Total Posts: 25

Joined 2010-01-29

PM

Are log files under "Log files -> Open Log File directory"? Cause there is no .txt file in this directory, and I haven't see any "Device0.txt" :(

Yes, I'm waiting the message from ANT before sending the next command.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Yes, log files should be there.

Is the log file directory one where you have the correct permissions to write to? If not, you can copy the ANTwareII entire folder to a directory where you have full permissions (eg. within your Desktop or My Documents), to allow the logs to be written to disk.      
Rank

Total Posts: 25

Joined 2010-01-29

PM

Ok, now it's working. I've attached my "Device0.txt".

I still receive
[A4][09][4E][00][00][00][63][64][65][66][67][68][E8]
instead of
[A4][09][4E][00][61][62][63][64][65][66][67][68][CS]

I've connected my UART to my PC to check messages I was sending and it's ok. I've also connected ANT TXD to my PC, and ANT responses are ok.

I still don't now where the problem is coming from.
Regards,
Lionel. [file name=Device0.txt size=6100]http://www.thisisant.com/images/fbfiles/files/Device0.txt[/file]      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

That is pretty unusual.
It seems that you are setting the broadcast data once after opening the channel. Could you try setting again after an EVEN_TX? Do you see the same incorrect data on the PC?      
Rank

Total Posts: 25

Joined 2010-01-29

PM

Hi,

My host is in master mode so I don't receive EVENT_Tx after opening the channel, I just receive Channel Event Messages. Even when I wait that message to send broadcast data, I have problems. In fact, I found an other problem :D

Til the Opening Channel instruction, there is no problem. Once open, the channel starts to broadcast the last saved message. But as soon as I change the broadcast message, ANT stops sending messages, I have to close and re-open my channel, to send the new message :(

I've tested my code with AP2 and AT3 modules. [file name=my_prog.txt size=3661]http://www.thisisant.com/images/fbfiles/files/my_prog.txt[/file]      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

If this node is the master, you should be receiving a channel event message with code EVENT_TX after you open the channel, every channel period. If you are not receiving this message, what are you seeing?

From your description, it sounds like a problem with the serial driver. Does your UART_send code look at RTS to ensure that no messages are sent to ANT if RTS is high?

A couple other notes from the code snippets posted:
- When you wait for responses from ANT, make sure to actually check the contents of the message to confirm that the command you sent was successful before moving on to the next one.
- Are you trying to use SLEEP & SUSPEND after power on to reset ANT? If you are using AP2/AT3, there is a RST pin available, and that is the recommended way of doing a reset.      
Rank

Total Posts: 25

Joined 2010-01-29

PM

Ok, so if EVENT_TX = { 0xA4 0x03 0x40 0x00 0x01 0x03 }; I am receiving this message every period.

As I said in my first message, I receive these messages from ANT :
{ 0xA4 0x03 0x40 0x00 0x46 0x00 };
{ 0xA4 0x03 0x40 0x00 0x42 0x00 };
{ 0xA4 0x03 0x40 0x00 0x51 0x00 };
{ 0xA4 0x03 0x40 0x00 0x43 0x00 };
{ 0xA4 0x03 0x40 0x00 0x45 0x00 };
{ 0xA4 0x03 0x40 0x00 0x47 0x00 };
{ 0xA4 0x03 0x40 0x00 0x4B 0x00 };
{ 0xA4 0x03 0x40 0x00 0x01 0x03 };
{ 0xA4 0x03 0x40 0x00 0x01 0x03 };
{ 0xA4 0x03 0x40 0x00 0x01 0x03 };
{ 0xA4 0x03 0x40 0x00 0x01 0x03 };
{ 0xA4 0x03 0x40 0x00 0x01 0x03 };
......

when I send :
{ 0xA4, 0x09, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEB };
{ 0xA4, 0x03, 0x42, 0x00, 0X10, 0X00, 0xF5 };
{ 0xA4, 0x05, 0x51, 0x00, 0X21, 0X00, 0x01, 0x01, 0xD1 };
{ 0xA4, 0x03, 0x43, 0x00, 0X00, 0X04, 0xE0 };
{ 0xA4, 0x02, 0x45, 0x00, 0X42, 0XA1 };
{ 0xA4, 0x02, 0x47, 0x00, 0X03, 0XE2 };
{ 0xA4, 0x01, 0x4B, 0x00, 0XEE };
{ 0xA4, 0x09, 0x4E, 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0XEB };

So I assumed that ANT understand my commands. Besides, I've connected the input and the output of my UART to check messages sent and ANT's replies everytime I make a transaction, all messages are fine.

I'm not using SLEEP & SUSPEND but RST (here what I'm doing : )

Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?|________________ SLEEP

Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë? SUSPEND

________________|Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë?Ë? ANT_RST

| 500ms | 500ms | 500ms |

I've changed my program to check the contents of the message I receive and to ensure that no messages are sent to ANT if RTS is high.

Regards,
Lionel. [file name=my_prog2.txt size=4626]http://www.thisisant.com/images/fbfiles/files/my_prog2.txt[/file]      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Ok, so if EVENT_TX = { 0xA4 0x03 0x40 0x00 0x01 0x03 }; I am receiving this message every period.


Yes, that is an EVENT_TX.

If possible, please obtain scope captures of the serial lines (Tx, Rx, RTS) when you send the broadcast message. You should see RTS pulse for ~50us after the message has been received correctly. We want to make sure that the full broadcast message you are sending is received and acnowledged through ANT's serial interface.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

It seems you configured your slave as a shared slave. In a shared channel, two bytes of the payload are reserved as a shared address, and a slave will only receive messages addressed to it (i.e., with those two fields matching its shared address). Please configure your slave node in ANTware as a regular slave, making sure none of the extended options are selected.      
Rank

Total Posts: 25

Joined 2010-01-29

PM

My bad, when I'm using Rx/Tx only channel, everything works perfectly.

Thank you,
Regards,
Lionel.