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

16MHz Crystal Current with SoftDevice

Hi,

As stated here:

After manually starting the HFCLK crystal it will be enabled even though there are no peripherals requesting the HFCLK. When no peripherals request the crystal it will reside in standby mode where the current consumption is around 25uA, compared to 470uA when it is in use, see nRF51822 PS v3.1, table 22. When a peripheral needs the HFCLK, it will be ready in standby mode and there is no startup time.

When softdevice is enabled however, the softdevice will be in control of the high frequency crystal and automatically enables the crystal before a radio event and disables the crystal after a radio event, in order to save current. If the application needs to enable the 16MHz crystal while the softdevice is enabled, it must do so by calling the following softdevice functions:

sd_clock_hfclk_request

So, if with SoftDevice enabled, I request the HFCLK. Then, run the RTC to START TIMER every 500msec and STOP the time after 50msec, i.e., the TIMER just runs for 50msec. Considering that there is no radio event during these operations, can we expect that during the 450msec period XO16MHz will be put in STANDBY mode with 25uA and no startup time required? (Also, I assume that STOPPING the TIMER means that is doesn't need HFCLK anymore and no other action is required)

In other words, with SoftDevice do all of these happen automatically, or there is no standby and for having the lower current I should use sd_clock_hfclk_release and again request it and also expect the startup current and startup time each time?

Thanks!

Parents Reply Children
  • Ok, maybe I should clarify more. Due to my application needing more accuracy in time I HAVE to turn on the timer and use the HFCLK. So, please assume that due to whatever reason, we need to run the timer. In this case what will be the answer?

  • FormerMember
    0 FormerMember in reply to FormerMember

    Okay, I see. I would recommend you to use the 32 MHz crystal (HFXO) during the 50 ms timing. During the 450 ms, I would recommend you to turn off the HFXO, and turn it on approximately 1 ms before the next time you need it. Having the HFXO in standby mode for 450 ms will use quite a bit of extra current.

  • Can you please provide a clear answer to item 1, and confirm if 2&3 are correct (example was provided just to show what the blocks that I need are):

    1- When Softdevice is enabled, can we expect the same automatic procedure of putting HFXO into standby or we have to use sd_clock_hfclk_release and do it manually? (please put aside whatever extra power is in standby, does the system put the HFXO in standby with SD enabled or not?)

    2- My understanding is that"STOPPING the timer" is enough to tell the system that HFCLK is no longer needed. Is this true? or we should do some other things like disabling the timer interrupt or...

    3- Based on Table 22, the startup current for 16MHz XO is 1.1 mA. I assume this current is drawn during the whole startup time of 800usec.

  • FormerMember
    0 FormerMember in reply to FormerMember

    1) When the softdevice is enabled, it will turn off the HFCLK (HFXO) when when it has finished the radio operation. And that can collide with your requirements for the timer? Your timer needs to run off the HFXO, right? To make sure that the HFXO is not turned off by the softdevice, you should turn it on before enabling the softevice:

    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    // wait for HFCLK to start
    ble_stack_init();
    

    The HFXO should then go into standby mode when it is not being used.

    2) I think you would need to use nrf_drv_disable(..) (NRF_TIMER->TASKS_SHUTDOWN) to "release" the HFCLK, because it is needed for the chip to enter system ON.

    3) Yes, the crystal will use "startup-current" for "startup-time" time. The crystal specific characteristics will affect the startup-time of the crystal.

Related