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

Can Internal RC be used for BLE comms?

MS76SF2_SCH_V12.pdfHi, I am using SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL); for ble_Stack_init() because the off the shelf board (not from Nordic) goes into a never ending loop when SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL) is used. The external crystal does produce clock signals, but I think the loading capacitors are not right. Anyway, if I use NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, will this RC clock be accurate enough to keep the BLE connection (I am basically using ble_app_uart as base) going? Another question is, will the EMC testing pass with NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM as clock source? Thanks.

Parents
  • Hi RK, you are right. After I used start up code, it worked. This is what I did:

    Step 1: Start HF clock (from Xtal ) manually by doing this: NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1;

    	while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
    	{
    	}    
    	//till this manually start HFClk
    

    Step 2: Synthesise the LF clock from the started HF clock by doing this: // Initialize SoftDevice. SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL);

  • Hi, RK, thanks for your reply. Sorry, I have troubles understanding your previous answer. According to the nrf51 reference manual, LFCLKSRC can be one of the following: 0: Internal 32KHz RC oscillator; 1: External 32KHz crystal; 2: Internal 32KHz synthesiser from HFCLK system clock. And I am left with (I use SDK 10.0 and s110) only one of the following options to be used in SOFTDEVICE_HANDLER_INIT. All the following options are LF. If I want to use LF external crystal, then, I need 32KHz connected across XL1 and XL2, right? Or, I could use 16MHz (which is the external crystal connected across XC1 and XC2) and use this as my HFCLK and use internal 32HZ synthesiser to synthesise the LF clock needed for SOFTDEVICE_HANDLER_INIT from external crystal, 16MHz, right? In other words, how can I use 16MHz external crystal to feed the required LF crystal clock (as needed by SOFTDEVICE_HANDLER_INIT)?:

    /@brief Possible lfclk oscillator sources. */ enum NRF_CLOCK_LFCLKSRCS { NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, /< LFCLK Synthesized from HFCLK. */

    NRF_CLOCK_LFCLKSRC_XTAL_500_PPM, /**< LFCLK crystal oscillator 500 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_250_PPM, /**< LFCLK crystal oscillator 250 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_150_PPM, /**< LFCLK crystal oscillator 150 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_100_PPM, /**< LFCLK crystal oscillator 100 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_75_PPM, /**< LFCLK crystal oscillator 75 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, /**< LFCLK crystal oscillator 50 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_30_PPM, /**< LFCLK crystal oscillator 30 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, /**< LFCLK crystal oscillator 20 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, /**< LFCLK RC oscillator, 250ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION, /**< LFCLK RC oscillator, 500ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_1000MS_CALIBRATION, /**< LFCLK RC oscillator, 1000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION, /**< LFCLK RC oscillator, 2000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, /**< LFCLK RC oscillator, 4000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, /**< LFCLK RC oscillator, 8000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_1000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 1000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_2000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 2000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 4000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_8000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 8000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_16000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 16000ms, if changed above a threshold, a calibration is done.*/

    };

Reply
  • Hi, RK, thanks for your reply. Sorry, I have troubles understanding your previous answer. According to the nrf51 reference manual, LFCLKSRC can be one of the following: 0: Internal 32KHz RC oscillator; 1: External 32KHz crystal; 2: Internal 32KHz synthesiser from HFCLK system clock. And I am left with (I use SDK 10.0 and s110) only one of the following options to be used in SOFTDEVICE_HANDLER_INIT. All the following options are LF. If I want to use LF external crystal, then, I need 32KHz connected across XL1 and XL2, right? Or, I could use 16MHz (which is the external crystal connected across XC1 and XC2) and use this as my HFCLK and use internal 32HZ synthesiser to synthesise the LF clock needed for SOFTDEVICE_HANDLER_INIT from external crystal, 16MHz, right? In other words, how can I use 16MHz external crystal to feed the required LF crystal clock (as needed by SOFTDEVICE_HANDLER_INIT)?:

    /@brief Possible lfclk oscillator sources. */ enum NRF_CLOCK_LFCLKSRCS { NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, /< LFCLK Synthesized from HFCLK. */

    NRF_CLOCK_LFCLKSRC_XTAL_500_PPM, /**< LFCLK crystal oscillator 500 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_250_PPM, /**< LFCLK crystal oscillator 250 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_150_PPM, /**< LFCLK crystal oscillator 150 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_100_PPM, /**< LFCLK crystal oscillator 100 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_75_PPM, /**< LFCLK crystal oscillator 75 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, /**< LFCLK crystal oscillator 50 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_30_PPM, /**< LFCLK crystal oscillator 30 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, /**< LFCLK crystal oscillator 20 PPM accuracy. */

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, /**< LFCLK RC oscillator, 250ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION, /**< LFCLK RC oscillator, 500ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_1000MS_CALIBRATION, /**< LFCLK RC oscillator, 1000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION, /**< LFCLK RC oscillator, 2000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, /**< LFCLK RC oscillator, 4000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, /**< LFCLK RC oscillator, 8000ms calibration interval.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_1000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 1000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_2000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 2000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 4000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_8000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 8000ms, if changed above a threshold, a calibration is done.*/

    NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_16000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 16000ms, if changed above a threshold, a calibration is done.*/

    };

Children
No Data
Related