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

In our product, we would like to select LFCLK from the following choices instead of external XTAL. However we have some manufacturing issues with the XTAL chosen and so we muct use the LF_SRC to be the RC

So with the errata in mind the RC oscillator has a accuracy of +/-500 ppm, while the XTAL on the nRF52 DK has a accuracy of +/-20 ppm. During the longest waiting period of 30 seconds the 20ppm crystal would, at worst case, be 600 us off. With 500 ppm you end up at 15 ms off.

    NRF_CLOCK_LF_SRC_RC
    NRF_CLOCK_LF_SRC_XTAL

Does this mean that not using a XTAL is ever going to cause any issue? We have some manufacturability issues coming from the XTAL selected and so I am trying to weigh the options of respinning the PCB with this XTAL or using a different one.

We are using SDK 14.2 and in the future likely 15.3 if that matters at all as well.....I have seen some posts for issues regarding this.

Parents Reply Children
  • OK thanks I thought so can you give an example? or is there one in SDK?

  • There is no example no, but you may find this description useful:

    The lfclk source is set when softdevice is enabled. The softdevice will not return until the lfclk source is successfully started. If you choose an lfclk source that doesn't exist, then the softdvice is stuck and will not return. The only way to swap or change lfclk source is to disable and enable the softdevice again, however this will not work if you are trying to start an lfclk that is not present in hardware. If you are unsure whether there is an external lfclk source, then you would need to test manually for this before the softdevice is enabled, e.g. try to start the lfclk source and if the started event has not occured within 1second, then you can assume that lfclk source is not an option, thereby don't use that lfclk source when trying to enable the softdevice.

    Example to test for external LFCLK is present before enable softdevice:

    	NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
    	NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    	NRF_CLOCK->TASKS_LFCLKSTART = 1;
    	
    	// Wait for the low frequency clock to start
    	nrf_delay_ms(1000);
    	
    	if(NRF_CLOCK->EVENTS_LFCLKSTARTED == 1)
    	{
    	// hurray there is an external LFCLK present.
    	// you can set external LFCLK when enable softdevice
    	NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    	}
    	else
    	{
    	// no external lfclk present, you can use internal LFCK when enable softdevice
    	}

Related