nRF52840 timer wakeup from lowest possible power mode

Hi

I have a nRF52840 setup with external 32 kHz xtal and external 32 MHz xtal, supplied by 3.3V.

I would like the system to be in as low power mode as possible.

Each x seconds it should wake up, do something and go back to as low power mode as possible.

It should also be possible to be woken up by GPIO interrupt on a single pin.

Can anyone supply me with working sample code that does this? Preferrable not in the framework - just the required ~20 lines of code...

Which sleep currents can be expected?

I have tried, but either it high current, or does not wake up.

Thanks for you help!

Kind regards

Mikael

Parents
  • Hi Mikael,

    The lowest possible idle current can be achieved by system OFF from which you can wake up from a GPIO. However, the problem with system OFF is that wakeup is in form of a reset, so this is not suitable for all applications (as full re-initialization is also needed, most applications do not benefit from this). That said, it is demonstrated in this sample assuming you use nRF Connect sDK.

    I am not sure what you refer to by "the framework", but if what you mean without an SDK you can in principle configure the GPIO pin to wake with SENSE mechanism, and then enter system off using nrf_gpio_cfg_sense_set() and then enter sytem off with "NRF_POWER->SYSTEMOFF = 1;". But if you use nRF Connect SDK you should do as above, and if using the old nRF5 SDK with SoftDevice, you should use sd_power_system_off() (there are severeal examples if this in the SDK).

    Most applications will use system ON low power mode as the only low power mode. That is the normal sleep mode and does not need any special attention, as most SDK examples use it already. You would only need to configure the interrupt pin. Note that for low power GPIO interrupts, you should use the sense mechanism. Assuming nRF Connect SDK, you can configure sense for a pin by setting the pin in the sense-edge-mask for the GPIO port, as you see an example of here.

    You can see expected current consumption under different sleep modes and wakeup sources here.

    If you need further assistance, please let me know which SDK version you use, and prefrably also share the code you have that does not work (and explain in what way it does not).

Reply
  • Hi Mikael,

    The lowest possible idle current can be achieved by system OFF from which you can wake up from a GPIO. However, the problem with system OFF is that wakeup is in form of a reset, so this is not suitable for all applications (as full re-initialization is also needed, most applications do not benefit from this). That said, it is demonstrated in this sample assuming you use nRF Connect sDK.

    I am not sure what you refer to by "the framework", but if what you mean without an SDK you can in principle configure the GPIO pin to wake with SENSE mechanism, and then enter system off using nrf_gpio_cfg_sense_set() and then enter sytem off with "NRF_POWER->SYSTEMOFF = 1;". But if you use nRF Connect SDK you should do as above, and if using the old nRF5 SDK with SoftDevice, you should use sd_power_system_off() (there are severeal examples if this in the SDK).

    Most applications will use system ON low power mode as the only low power mode. That is the normal sleep mode and does not need any special attention, as most SDK examples use it already. You would only need to configure the interrupt pin. Note that for low power GPIO interrupts, you should use the sense mechanism. Assuming nRF Connect SDK, you can configure sense for a pin by setting the pin in the sense-edge-mask for the GPIO port, as you see an example of here.

    You can see expected current consumption under different sleep modes and wakeup sources here.

    If you need further assistance, please let me know which SDK version you use, and prefrably also share the code you have that does not work (and explain in what way it does not).

Children
No Data
Related