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

Is external crystal neccessary at all on 52832

As i am migrating to 52 and tuning the ble app, i realized by reading many posts here that:

  1. external HF xtal is not recommended
  2. external LF xtal can be replaced by using internal xtal with temperature compensation.

So does that mean external crystal (either HF or LF ) actually not needed at all on 52?

Parents
  • Hi,

    1. External HF crystal is mandatory if you want to use the radio peripheral. If you are using BLE, you have to use an external 32 MHz crystal with a frequency tolerance of max 40 ppm. As mentioned in this post:

    The external HF clock is critical for data timing and more critical to keep the bluetooth radio on the correct frequency. All the 2.4GHz channels are derived from the 32MHz crystal. So the ppm accuracy of the xtal will be the same ppm accuracy of your carrier in the 2.4GHz band.

    2 .

    External LF crystal(32 kHz)is not mandatory, but recommend. See this and this post.

    Since you are migrating to nRF52832, I recommend to take a look at the General PCB design guidelines for nRF52 series tutorial

Reply
  • Hi,

    1. External HF crystal is mandatory if you want to use the radio peripheral. If you are using BLE, you have to use an external 32 MHz crystal with a frequency tolerance of max 40 ppm. As mentioned in this post:

    The external HF clock is critical for data timing and more critical to keep the bluetooth radio on the correct frequency. All the 2.4GHz channels are derived from the 32MHz crystal. So the ppm accuracy of the xtal will be the same ppm accuracy of your carrier in the 2.4GHz band.

    2 .

    External LF crystal(32 kHz)is not mandatory, but recommend. See this and this post.

    Since you are migrating to nRF52832, I recommend to take a look at the General PCB design guidelines for nRF52 series tutorial

Children
  • thanks @Sigurd and @RK for the clarifications. I may misunderstood some posts.

    My custom board of 52 already made, with an external HF 32M xtal, no LF though. So i think the only way now is to use internal RC osc for SD then. So am i correct to set NRF_SDH_CLOCK_LF_XTAL_ACCURACY in sdk_config.h to NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM ?

    I am asking because though seems that i already made the application running on my custom board, and the advertising started (returned error code 0), but i can not find my device on central side. did not find any clue yet.

  • Did you set the SoftDevice clock source in sdk_config.h to NRF_CLOCK_LF_SRC_RC ?

    You should also set the NRF_SDH_CLOCK_LF_RC_CTIV to 32, and the NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 2.

  • @Sigurd,

    YES, i have changed the LF src to NRF_CLOCK_LF_SRC_RC. I used 16 for NRF_SDH_CLOCK_LF_RC_CTIV, i will try 32 again.

    More facts from my testing:

    1. As the application now does not need external LF xtal so i can actually compare the results that same application running on my custom board and the 52DK. on 52DK the application seems all working, as i can discover my services on central side. But just not on custom board.

    2. I can not measure 32MHz waveform on my custom board's HF xtal, so apparently it does not work for some reason(though i am not sure for now). But a question is if HF xtal not working is it possible that ble_advertising_start() returned err_code 0? And i can see LED blinking tells that bsp indicator is working.

  • Do you have a oscilloscope that can measure 32 MHz ?

    You can try to call sd_clock_hfclk_request(), and then call sd_clock_hfclk_is_running. sd_clock_hfclk_is_running() returns 1 if the external crystal oscillator is running.

    You could e.g. try something like this:

    sd_clock_hfclk_request();
    uint32_t flag = 0;
    // Enter main loop.
    for (;;)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            power_manage();
        }
        sd_clock_hfclk_is_running(&flag);
        NRF_LOG_INFO("Flag: %d", flag);
    }
    

    If you dont't get "Flag: 1", then you have a problem with the HF crystal. And you should then double check that the crystal on your board is mounted correctly, i.e. not shifted by 90 degrees for example.

    Yes, the ble_advertising_start() will return 0, and bsp will start blinking even if the HF crystal is not mounted. The SoftDevice will wait for the HF crystal to startup before you see any BLE activity.

    Attach a debugger, and use e.g. J-Link RTT viewer to see the nrf_log's

    Let me know how it goes!

  • @Sigurd,

    thanks for the answer. That explains the problem. I did not see waveform of 32M xtal on oscilloscope so there must be some problems about it. I will test more and let you know.

Related