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

32.768KHz RC Oscillator Configuration for BLE central

Hi there,

I am developing a BLE dongle on nrf51822. There is no external 32.768KHz crystal oscillator on my customized board(only has an external 16MHz oscillator). so I have to use the on-chip 32.768KHz RC for softdevice.

However, I am confused with the LFCLK source settings. 

I set the following values for the nrf_clock_lf_cfg_t variable and set into softdevice by SOFTDEVICE_HANDLER_APPSH_INIT function.

#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \
                                 .rc_ctiv       = 1,                                \
                                 .rc_temp_ctiv  = 1,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

But from the devzone forum, a lower calibration frequency setting seems more popular, the parameters are set as below,

#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \
                                 .rc_ctiv       = 16,                                \
                                 .rc_temp_ctiv  = 2,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
 

which setting can make the 32.768KHz RC works more accurate?

I think rc_ctiv=1, rc_temp_ctiv=1 can let the RC performs better, but with higher power consumption, am I right?

I want to figure this out, because my product sometimes disconnect with my BLE peripheral with an unexpected reason 0x3E(CONNECT_REQ is sent, but no reponse from slave, then connection timeout). 

I found the issue can be induced by clock setting and the board RF performance, so I want to inquire if the rc_ctiv=1, rc_temp_ctiv=1 setting is the best setting for my board. 

Thanks in advance.

  • Hi

    You can't guarantee better accuracy than 250ppm from the RC in the nRF51 series, but in general the more often you calibrate the more accurate it will be (at the cost of higher power consumption, as you say). 

    The most aggressive settings you can use is rc_ctiv=1 and rx_temp_ctiv=0. Then the RC will be calibrated every 250ms, even if the temperature is stable. 

    Best regards
    Torbjørn 

Related