LFCLK External Xtal and Soft Device

I am attempting to enable the external LFCLK. I want the clock to swing rail to rail.  I have the following code in place.

    /* Start low frequency crystal oscillator for app_timer(used by bsp)*/
    NRF_CLOCK->LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK->LFCLKSRC            = (CLOCK_LFCLKSRC_EXTERNAL_Enabled  << CLOCK_LFCLKSRC_EXTERNAL_Pos);
    NRF_CLOCK->LFCLKSRC            = (CLOCK_LFCLKSRC_BYPASS_Enabled << CLOCK_LFCLKSRC_BYPASS_Pos);
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART    = 1;

    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
    {
        // Do nothing.
    }
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;


I am using the s140 v 7.2 soft device and the nRF5_SDK_17.0.2_d674dde version of the sdk.

Is there some additional configuration step I'm missing?


Parents Reply Children
Related