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

Any way to control wether ext. 32k XTAL works properly?

Hello all,

Our product based on nRF51 is on preproduction stage. We use both 16MHz and 32kHz external crystals. The question is: Is there any way to check programatically if 32kHz crystal soldered/soldered properly/works fine?

We noticed that on SD110 v8.0.0 device works even without external 32k crystal with software defined as

if (NRF_SUCCESS !=(err_code=sd_softdevice_enable((uint32_t)NRF_CLOCK_LFCLKSRC_XTAL_75_PPM, softdevice_assert_callback)))...

However, in that case the current consumption increased significantly. And it could cause problems in post production testing.

Best regards,

Parents
  • This might not be the best way, but it looks like the failure mode for failure to synchronize on a clock source is that the device will hang at sd_softdevice_enable(...). This can be captured to reset the system.

    If you were to set a non-volatile flag prior to calling sd_softdevice_enable, then you could check on boot if the flag is set. If it is, then you were not able to enable the SD with that clock. Otherwise, once you successfully enable the SD using that clock source, you could clear the flag.

    Of course, then there is a race condition whereby a power cut at just the wrong time could disable your low-power crystal until you reset the flag.

  • You can always read registers that are in use by the softdevice, so you can check the LFCLKSRC register in the CLOCK peripheral to see which source is currently selected for the LFCLK.

Reply Children
No Data
Related