This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom board crystal, is it working ?

How do I quickly check if the external crystal  (32.768 with 15pf load caps.)  I soldered is working.

I built a custom board but had to reflow solder in my lab.

Everything is perfect, examples run .

Is there a function I can call that would return true/false? 

Like in some AVR microcontroller , is it possible to send the clock output to a pin where I can measure the clock frequency ?

  • Hi,

     

    How do I quickly check if the external crystal  (32.768 with 15pf load caps.)  I soldered is working.

    I built a custom board but had to reflow solder in my lab.

    Everything is perfect, examples run .

    Is there a function I can call that would return true/false? 

    Like in some AVR microcontroller , is it possible to send the clock output to a pin where I can measure the clock frequency ?

    If your application does not start up the LFCLK, you can manually start up the 32k ext. clock:

    NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART = 1;
    
    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {}
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;

     

    Add this to the blinky example for instance, and if it hangs in the while-loop, it has problems starting up your external 32k source.

     

    If using a example that has already started the 32k source, you can also read the status in this register:

    https://infocenter.nordicsemi.com/topic/ps_nrf52840/clock.html?cp=4_0_0_4_3_2_18#register.LFCLKSTAT

     

    Kind regards,

    Håkon

Related