nRF52832 System ON Run modes of consumption

Hello,

I am working in a project using the nRF52832 SoC, on the nRF5_SDK_17.1.0, using the Softdevice S132 and working over the SES IDE. For managing the consumption I have seen some cases related tonthe System On and System Off options using Softdevice. However, what I have found is more concerned to put the device in sleep mode by different systems and waking the device using events. In my case, I should consider the nRF52832 always in Run mode using the external 32MHz crystal (I have no one external 32KHz crystal).

Is there a way to modifiy and reduce the consumption in some moments keeping the device running? For example:

- Modifying the HFCLK clock frequency dinamically while the BLE module would not be needed.

- Deactivating and reenabling dinamically internal peripherals.

Thank you very much in advance.

Regards,

Joel

  • Hi Einar,

    Excuse me if I have not explained well. The board has not an onboard 32.768KHz crystal. The question, then, is how (in execution time) is it possible to disable the HFCLK to use the LFRC and just th other way round.

    Regards,

    Joel

  • jinvers said:
    Excuse me if I have not explained well. The board has not an onboard 32.768KHz crystal.

    I understand, that is why I explained how to configure an LFRC. And the mentionning of no need to dynamically switch was as a comment to why this is done build time as you did not like that (I don't see any reason this should be runtime).

    jinvers said:
    The question, then, is how (in execution time) is it possible to disable the HFCLK to use the LFRC and just th other way round.

    As mentioned, the CPU always needs the HFCLK while running. When the CPU is sleeping (which is after a __WFE() or __WFI() instruction, typically after calling sd_app_evt_wait() when using a SoftDevice), and no other peripherals are requesting the HFCLK, this is disabled. The SoftDevice always keeps the LFCLK and RTC0 running for time keeping. RTC1 is also typically used by the app_timer library. You can see how this is done in any Bluetooth example in the SDK.

  • Ok Einar. I understand that all this control then is automaticaly made by the PMU block inside the nRF52832 and little things can be done except using SoftDevice as calling to sd_app_evt_main() for System ON Wait or sd_power_system_off().

    Or is it any specific order or function call to disable and renable a peripheral in runtime?

    Regards,

    Joel

  • Hi Joel,

    The PMU block essentially just enables clocks and regulators when some peripherals need the HFCLK or some specific voltages. It does not switch between HFXO and HFINT (the internal high frequency RC), and it does not control the LFCLK (which is normally started at startup and runs continiously. Essentially you don't have to think about it, just remember that if you have any peripherals that need the HFCLK running, it will run.

    This brings us to the next point about peripherals. These are not automatically controlled, so to achieve low power, you must disable peripherals that is not currently needed. (For a HW perspective at least, if using the nRF Connect SDK there is a power management system I mentioned in my initial reply which assists with this in som cases). But generally, it is up to your application to stop everything that is not needed. If for instance UART is active, the HF clock will be running, and the device will be consuming a significant amount of power even if the CPU is sleeping.

    PS: Regarding system off mode, that is useful in some special cases, but in this case the LFCLK is also stopped and you only have a few selected wakeup sources. Also, wakeup is also in form of a reset. The "normal" sleep mode which is often the only sleep mode used, and in virtually all products the main sleep mode, is system ON sleep mode. Here you can have more wakeup sources and the LFCLK is typically running.

    For a Bluetooth application where the SoftDevice keeps the LFCLK and RTC0 running in system ON mode, you can get a sleep current of a few micro amps (see Current consumption scenarios).

  • Thanks for your explanation.

    So, please may you share some link where I could see the function calls to disable and reenable the peripherals when needed? I am using nRF5_SDK_17.1.0 ans SES IDE.

Related