Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Is channel number order important on ant_channel_assign?

Rank

Total Posts: 17

Joined 2015-10-28

PM

Newbie here with possibly a dumb question.

I am trying to setup a test application on an PCA10028 board. The application is based on the background scanning example. I've altered a few things, but even before I get into the major changes to my code, I get an INVALID_PARAMETER error on my very first call to sd_ant_channel_assign.
err_code sd_ant_channel_assign(p_config->channel_number
                                     
p_config->channel_type
                                     
p_config->network_number,
                                     
p_config->ext_assign); 

In my code I've changed the channel number from 0 to 2 because I wanted to keep channel 0 free. The other parameters are CHANNEL_TYPE_MASTER, and 0,0 for the last two. If I change the channel_number back to 0, the test code runs fine without an error.

It was my understanding that the channel_number was arbitrary (within the limits of the number of possible channels) and simply provided a means for the application to keep the channel configurations organized. Must I always assign channel 0 first?

In case anyone is curious as to why I want to keep channel 0 free, it is because eventually I want to merge in ANT-FS support and, looking at that code, it appears that it always consumes channel number 0 without any way to change it, short of changing the library code.

Tom
     
Avatar
RankRankRankRank

Total Posts: 741

Joined 2012-09-14

PM

Hi Tom,

You should be able to assign whichever channel you want in whichever order you want. In the demo, have you increased the number of channels which are allocated at SoftDevice initialization? If I recall correctly, the demo only starts with 2 channels allocated.

Are you using uVision 5? If you are, in the "arm5\RTE\nRF_ANT\nRF51422_xxAA" (or nRF51422_xxAC) folder there should be a file called "ant_stack_config_defs.h". In it it contains the "ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED" definition. Here you should set how many ANT channels you will need for your application (at least 3 it sounds like).

Cheers      
Rank

Total Posts: 17

Joined 2015-10-28

PM

Harrison - 07 December 2015 10:15 AM
Hi Tom,

You should be able to assign whichever channel you want in whichever order you want. In the demo, have you increased the number of channels which are allocated at SoftDevice initialization? If I recall correctly, the demo only starts with 2 channels allocated.

Are you using uVision 5? If you are, in the "arm5\RTE\nRF_ANT\nRF51422_xxAA" (or nRF51422_xxAC) folder there should be a file called "ant_stack_config_defs.h". In it it contains the "ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED" definition. Here you should set how many ANT channels you will need for your application (at least 3 it sounds like).

Cheers

Ah! I knew it had to be something this simple! Thank you for answering! No, I hadn't adjusted that but will try it.

I'm not using Keil, I'm afraid. Existence of gcc makes it hard to convince my employers to spend money on tools and this phase of the project scope is too low to build a case of long term costs... Perhaps once we get out of proof of concept phase (he said, dreamily wink

Thanks again. Great support!
Tom
PS: I'll copy the include file to my project 'includes' folder and edit. Thanks for the info on how to set this!