This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ANT-multiple channels

Hello,

Is there an example how to setup multiple ANT receive channels on one nrf51422 device using s310?

Thanks

  • Hi,

    No, there isn't any example for it. But if you start off with the ANT Broadcast example project in the nRF5x SDK you will simply need to call these 3 api's for each individual ANT channel you want to setup:

    sd_ant_channel_assign() sd_ant_channel_id_set() sd_ant_channel_open()

    You might want to also set other parameters such as for instance message period, network key and frequency, but the above api calls are the minimum required to get you started.

    Regards, Kenneth

  • I am trying to do this, but when I try to assign the second channel I get INVALID_PARAMETER (0x4033) back.

    Here's a test I did to assign two independent channels on network 0.

    uint32 err_code;
    err_code = sd_ant_channel_assign(0, 0, 0, 0);
    APP_ERROR_CHECK(err_code); //Success
    
    err_code = sd_ant_channel_assign(1, 0, 0, 0);
    APP_ERROR_CHECK(err_code);  //Fail here
    

    My intention is to call the other initializations later but even if I do call the initializations for channel 0 first, the second one fails.

    Edit: I am using SD s310 v3.0.0

  • Likely you need to alter 'ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED' in:

    uint32_t ant_stack_static_config(void)
    {
        ASSERT(ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED <= MAX_ANT_CHANNELS);
        ASSERT(ANT_CONFIG_ENCRYPTED_CHANNELS <= ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED);
    
        ANT_ENABLE m_ant_enable_cfg =
        {
            .ucTotalNumberOfChannels        = ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED,
            .ucNumberOfEncryptedChannels    = ANT_CONFIG_ENCRYPTED_CHANNELS,
            .pucMemoryBlockStartLocation    = ant_stack_buffer.u8,
            .usMemoryBlockByteSize          = ANT_BUFFER_SIZE_FOR_SD
        };
    
        return sd_ant_enable(&m_ant_enable_cfg);
    }
    
Related