Is it possible to completely disable the internal oscillator and only use an external LF XTAL?
Is it possible to completely disable the internal oscillator and only use an external LF XTAL?
If you're talking about the LFRC, then yes. If you've configured the device to use an LF XTAL then the LF RC is automatically disabled.
Interesting. I believe I have done that in this section of code, however, I never seem to get past the while statement, and if I comment out the while loop, the k_sleep never returns. Is there something I'm missing here?
// Make sure we are using the external 32.768 kHz crystal osciallator (LFXO) NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos)|(CLOCK_LFCLKSRC_BYPASS_Enabled << CLOCK_LFCLKSRC_BYPASS_Pos ) | (CLOCK_LFCLKSRC_EXTERNAL_Enabled << CLOCK_LFCLKSRC_EXTERNAL_Pos); NRF_CLOCK->EVENTS_LFCLKSTARTED = 0; NRF_CLOCK->TASKS_LFCLKSTART = 1; while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) { // Do Nothing } start_time = k_cycle_get_32(); k_sleep(1000);
Are you using an external crystal or external oscillator?
External Crystal. Actually, I get past the LFCLKSTARTED while however, my k_sleep never returns.
Check LFCLKSTAT, the LF clock might already be running on the crystal.
Also, BYPASS_Enable won't work with a crystal. That literally bypasses (=disables) the oscillator for the crystal - use that only with an external rail-to-rail oscillator.