Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

shared channel

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hi ,
You have told me how to do deal with my channel but I have another question now .
When I finish the ANT init and I send the slave address in order to make sure it can listen to the message from the master,but in my test I cannot receive the EVENT_TX event,my channel type is
0x20(Shared Bidirectional Slave Channel),but when I change it to 0x30 ,I can receive EVENT_TX event ,why ? I do like this:
………………………………………
void Main_ProcessANTEvent(void):
switch (pucEventBuffer[3])
{
case 0:
sign = 1;//it signs the broadcast data has been sent .
break;
default:
break;
}
…………………………………………
Void Main(void):
aucNodeBuf[0] =(UCHAR)(ADDR_B);
aucNodeBuf[1] =(UCHAR)(ADDR_B >> 8);
ANT_SendBroadcastData(0,aucNodeBuf); //broadcast the address of B .
Delayms(50);
if (ByteSyncSerial_Transaction(NULL, aucRxMesgBuffer)) // Check for news //from the ANT
{
Main_ProcessANTEvent(); //main processing function.
bExt1Flag = 0;
}
if(sign ==1 ) LED1 = 0;//0x20 can’t light LED ,but 0x30 can.
I do not know why, whether I miss something important?
Thanks very much !
Your friend from china.
fu dongsong      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hi,

You should be receiving an EVENT_TX if you send broadcast data from a slave. The reason you receive EVENT_TX when you set to 0x30 is because a master that is a shared bidirectional MASTER type, and a master will begin transmitting indefinitely once its channel is opened.

Something looks strange in your ProcessANTEvent function. Could you please provide your code in a zip file, it's hard for me to understand what you're doing with just that small section of code.

Thanks,

Kassandra      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hi,

One thing I forgot to mention is that you will NOT receive an EVENT_TX when you send a broadcast message from the slave to configure the channel because the channel is closed. When you should be looking for is a broadcast message from the master, and then use those messages to send messages back from the slave.

The slave node will only be able to send data back to a master after it gets a message from the master. Would you be able to provide a full message log?

Hopefully that helps to clarify things!

Best Regards,

Kassandra      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hi
Thanks for your help,shared channel has been completed . Now I have Some conceptual problems,Please help me to confirm.
(1) The maximumate of the ANT device is 200HZ in broadcast types. to count each packet 12bytes then 200 * 12 * 8 = 19200 = 19.2k, with 1Mbps is still very far away, how does this 1M is proposed?
(2) ANT multi-channel share the radio frequency part of the TDMA mode, how could it has conflict (EVENT_CHANNEL_COLLISION)?What is TDMA in ANT is embodied?
(3) ANT send packet and receive packet(slave reverse)in one channale cycle. for example, maximum of 200hz, each channel cycle 5ms, then how to ensure that the sending and receiving can be completed within 5ms?


Thanks again!

Your friend from china
2012/4/26/21:01      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hello,

(1) The maximumate of the ANT device is 200HZ in broadcast types. to count each packet 12bytes then 200 * 12 * 8 = 19200 = 19.2k, with 1Mbps is still very far away, how does this 1M is proposed?


Please have a look at this forum post. It explains the answer to your question.

(2) ANT multi-channel share the radio frequency part of the TDMA mode, how could it has conflict (EVENT_CHANNEL_COLLISION)?What is TDMA in ANT is embodied?


This post should answer this question for you.

(3) ANT send packet and receive packet(slave reverse)in one channale cycle. for example, maximum of 200hz, each channel cycle 5ms, then how to ensure that the sending and receiving can be completed within 5ms?


Could you clarify what you're asking with this question? I'm not sure I quite understand.      
Avatar
Rank

Total Posts: 4

Joined 0

PM

Hello

In my project, the central node send commands to the sensor nodes, if the sensor node receive the command ,it will send temperature values to central node, the last the central node received temperature value and display. But why the time delay is very large? I set the channel cycle 4HZ.Can you help me analyze it?

Your friend from china
fu dongsong      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

In a shared channel, the slave nodes can only respond to the master (i.e. send temperature data in your case) when they are individually accessed by the master node.

If you have many nodes, and you are polling all of the nodes sequentially, you will have rather high latency. For example, if you had 4 nodes, with your channel period of 4Hz, it will take 1 second for each node to update its temperature data.

Hopefully this helps to get you pointed in the right direction.

Cheers,

Kassandra      
Avatar
Rank

Total Posts: 4

Joined 0

PM

Hi
Thanks for your careful response for a long time.
Now,I only use two nodes ,a central node and a temperature sensor node, the channel period set to 4Hz (1Hz and 12Hz had tried), sensor nodes can quickly receive the command and return temperature .but the temperature values ​​need to be sent back for a long time to the central node . the delay mainly in this place.
(1) I want to make sure that, under normal circumstances, how many channel periods should I have received temperature?
(2) If the central node is sending the command, at the same time receive a temperature value, and how to do?      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hello,

I'm not quite sure what you mean by
but the temperature values ​​need to be sent back for a long time to the central node

Could you clarify so I can help you better?

If your sensor node is configured to respond to the master node, it will provide temperature data every time the master specifically polls, or addresses that sensor.

I'm also not quite sure what you mean by
If the central node is sending the command, at the same time receive a temperature value, and how to do?

Are you asking how to process a Channel receive event and a Channel transmit event at the same time?

Cheers,

Kassandra      
Avatar
Rank

Total Posts: 4

Joined 0

PM

Hi,
I am sorry that I am not good at English.
(1) Are you asking how to process a Channel receive event and a Channel transmit event at the same time?
The answer is “YES”,how to do?
(2) Piece of code:
////== 1 ========================================================
//if I receive the command fromUART ,I open the channel,and send the address
if(bSysUartRecived == true)
{
ANT_OpenChannel(0);// open the channel
Dly50uS();
bSysUartRecived = 0 ;
ucLED2SineTmr = 1;
aucNodeBuf[0] = (UCHAR)( ADDR_B );
aucNodeBuf[1] = (UCHAR)( ADDR_B >> 8);
ANT_SendBroadcastData(0,aucNodeBuf);// send the address
}
////== 2 ========================================================
//if I receive the result ,I closed the channel
if(bBMessage == 1)
{
bBMessage = 0;
temp1 = (UCHAR)(sNodeBValue);
temp2= (UCHAR)(sNodeBValue >> 8);
Temperature = (temp1 + 256*temp2)*0.0625;。
temp3 = (USHORT)Temperature;
temp5 = Temperature - temp3;
temp4 = (USHORT)(temp5 *100);
aucNodeBuf[0] = temp3/10+'0';
aucNodeBuf[1] = temp3+'0';
aucNodeBuf[2] = temp4/10+'0';
aucNodeBuf[3] = temp4+'0';
UartSendMessage(aucNodeBuf,4);
ANT_CloseChannel(0);// closed the channel
}
If I send the address of Node B, I will receive the temperature from node B every channel period,so I closed the channel.but the time delay is big.
(i)I manage the channel like this,I that ture?
(ii)why the time delay is so big?
Best wishes and thanks for your reply!      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Why are you closing the channel after you receive the data from node B?

You don't need to constantly keep opening and closing the channel to manage the channel. ANT manages the channel for you. Once your master channel is opened, it will transmit indefinitely until the channel is closed.

If you want to talk to other slaves, it is not necessary to close and open the channel. All you need to do is change the data that is being sent by using the ANT_SendBroadcastData message. This sets the transmit buffer of the master device.

You are probably seeing such a large delay because you are constantly opening and closing the channel.      
Avatar
Rank

Total Posts: 4

Joined 0

PM

Hi,

Why are you closing the channel after you receive the data from node B?

I send a command, I just need to get a temperature value only once, but the RF section sends command in each channel period , I kept the received temperature value, which is very unreasonable.and I think this is waste too much power.
are there other ways?

best wishes!      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Opening and closing the channel introduces latency into your application. If you are power constrained, perhaps you could look at using a different topology. I'm wondering why exactly you're using Auto-shared channel to get the data, what constraints say you need to use this?