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

System Clock Frequency

### Details

MCU- nRF52832

DK- nRF52DK

### Description

Hi all,

I'm new to Nordic platform and this might come up as a very basic question but, I couldn't find any exact reference to my confusion.

What exactly is the clock that the core is running on on BLE_peripheral examples (ble_app_multirole_lesc)? I could see from the data sheet that the there are 2 options,

1.  64MHz on-chip oscillator

2.  64MHz crystal oscillator using 32MHz crystal

and the peripherals can work on PCLK1, PCLK16M, PCLK32M.

As per datasheet it states that, "The HFCLK clock controller provides the following clocks to the system." In my application I don't explicitly call HFCLKSTART task, does that mean that it always operates using HFINT or the example is internally calling this function whenever it wakes up from sleep? I've also read in couple of articles that Softdevice requires HFXO but I couldn't find any call to HFCLKSTART task.

In my sdk_config.h file, the NRF_SDH_CLOCK_LF_SRC- SoftDevice Clock source is set to NRF_CLOCK_LF_SRC_XTAL. Does that mean that the softdevice is running at 32.768KHz external crystal? If so, what exactly is running at 32.768KHz, is it the time scheduling of SoftDevice that runs with 32.768KHz or some other functionality?

Could someone please guide me in understanding the clocks as I'm finding it very difficult to get an exact hold on the same. 

Parents
  • Hi Jay, 

    As per datasheet it states that, "The HFCLK clock controller provides the following clocks to the system." In my application I don't explicitly call HFCLKSTART task, does that mean that it always operates using HFINT or the example is internally calling this function whenever it wakes up from sleep? I've also read in couple of articles that Softdevice requires HFXO but I couldn't find any call to HFCLKSTART task.

     Yes, the CPU and most of the peripherals use the HFINT as the HFCLK source, but some peripherals like the RADIO require the HFXO to function properly. 
    The SoftDevice will automatically start the HFXO when it needed by the SoftDevice, so this is not something you need to handle in the application. The HFXO takes sometime to startup and stabilize so the HFINT is used util the HFXO is ready. 

    In my sdk_config.h file, the NRF_SDH_CLOCK_LF_SRC- SoftDevice Clock source is set to NRF_CLOCK_LF_SRC_XTAL. Does that mean that the softdevice is running at 32.768KHz external crystal? If so, what exactly is running at 32.768KHz, is it the time scheduling of SoftDevice that runs with 32.768KHz or some other functionality?

     Yes, the SoftDevice uses the Low Frequency clock(LFCLK) to schedule advertisment, scan, connection events etc. The SoftDevice can either use the internal RC oscillator or an external crystal(LFXO) as the LFCLK source

    The internal LFRC oscillator  needs to be calibrated against the HFXO every 4 seconds to be within the +/-250ppm accuracy requirement stated in the Bluetooth specification. The LFXO will typically have an accuracy of +/-20ppm, so no calibration is needed.

     Best regards

    Bjørn

Reply
  • Hi Jay, 

    As per datasheet it states that, "The HFCLK clock controller provides the following clocks to the system." In my application I don't explicitly call HFCLKSTART task, does that mean that it always operates using HFINT or the example is internally calling this function whenever it wakes up from sleep? I've also read in couple of articles that Softdevice requires HFXO but I couldn't find any call to HFCLKSTART task.

     Yes, the CPU and most of the peripherals use the HFINT as the HFCLK source, but some peripherals like the RADIO require the HFXO to function properly. 
    The SoftDevice will automatically start the HFXO when it needed by the SoftDevice, so this is not something you need to handle in the application. The HFXO takes sometime to startup and stabilize so the HFINT is used util the HFXO is ready. 

    In my sdk_config.h file, the NRF_SDH_CLOCK_LF_SRC- SoftDevice Clock source is set to NRF_CLOCK_LF_SRC_XTAL. Does that mean that the softdevice is running at 32.768KHz external crystal? If so, what exactly is running at 32.768KHz, is it the time scheduling of SoftDevice that runs with 32.768KHz or some other functionality?

     Yes, the SoftDevice uses the Low Frequency clock(LFCLK) to schedule advertisment, scan, connection events etc. The SoftDevice can either use the internal RC oscillator or an external crystal(LFXO) as the LFCLK source

    The internal LFRC oscillator  needs to be calibrated against the HFXO every 4 seconds to be within the +/-250ppm accuracy requirement stated in the Bluetooth specification. The LFXO will typically have an accuracy of +/-20ppm, so no calibration is needed.

     Best regards

    Bjørn

Children
Related