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

nRF52 ANT+ CW test with SD212 0.9.1

I alway used direct UART command with nRF24AP2 and CW test was not a problem.

Now with nRF52xxx and S212 softdevice I try this ... but nothing works .

sd_ant_stack_reset();nrf_delay_ms(3000);
sd_ant_cw_test_mode_init();nrf_delay_ms(3000);
sd_ant_cw_test_mode(0x39,RADIO_TX_POWER_LVL_4 ,0,0);                         
// 2457Mhz  CW test mode on freq=57 power level=+4dB unmodulated carrier

Is it correct , or something is missing ?

Thanks

Parents
  • Hi,

    Try the following code:

    /**@brief Function for application main entry. Does not return.
     */ 
    int main(void)
    {
        uint32_t err_code;    
        
        // Setup SoftDevice and events handler
        err_code = softdevice_ant_evt_handler_set(ant_evt_dispatch);
        APP_ERROR_CHECK(err_code);
    
        err_code = softdevice_handler_init(NRF_CLOCK_LFCLKSRC, NULL, 0, NULL);
        APP_ERROR_CHECK(err_code);
        
        err_code = ant_stack_static_config();
        APP_ERROR_CHECK(err_code);
    
        sd_ant_cw_test_mode_init();
        // sd_ant_cw_test_mode assumes that the hfclck is enabled.
        // request and allow 2 ms to stabilize
        sd_clock_hfclk_request();
        nrf_delay_ms(2);
    
        APP_ERROR_CHECK(sd_ant_cw_test_mode(33,RADIO_TX_POWER_LVL_CUSTOM,RADIO_TXPOWER_TXPOWER_0dBm,1));
        for (;;)
        {
            uint32_t err_code = sd_app_evt_wait();
            APP_ERROR_CHECK(err_code);
        }
    
    }
    

    The code gives a 0dBm output on channel 33. This code works fine for both modulated and CW for s210 and s212.

    If this doesn't work for you, leave a comment below. As a workaround you can use the radio test example. This example can be found in [YOUR_SDK_LOCATION]\nRF5_SDK_11.0.0_89a8197\examples\peripheral\radio_test\pca10028\arm5_no_packs in our most recent SDK 11.

    Best regards,

    Øyvind

  • Hi,

    Please see the updated code above, turns out that the test mode init was missing.

    • Øyvind
Reply Children
No Data
Related