Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sleep and Wakeup without GPIO

Hi

Hi i am trying my application for sleep and wakeup without gpio. Actually my work is to put my device(battery powered) in  sleep for 5 minutes and after that it should  wake it up without any GPIO signal, can anyone suggest me for this..I will be waiting for reply.

Thanks & regards

Kashinath

Parents
  • Hi,

    The RTC (using the 32 kHz clock) is a low power timer that is typically used for exactly this. For example, the SoftDevice use RTC0 to wake up for every BLE event. I recommend you to use the app timer (Timer library) which is a user friendly software library that allows you to make an arbitrary number of single shot or repeated timers using RTC1. The application will get an event (due to a RTC interrupt) whenever the timer expires. The app timer is explained in this tutorial (unfortunately somewhat outdated).

    Make sure to put the CPU to sleep when it is idle, by calling something like the following function in the main loop (assuming no SoftDevice is used):

    static void sleep_handler(void)
    {
        __WFE();
        __SEV();
        __WFE();
    }

    Alternatively, use nrf_pwr_mgmt_run() from the power management library (works both with or without SoftDevice) or sd_app_evt_wait() directly (only if SoftDevice is used).

Reply
  • Hi,

    The RTC (using the 32 kHz clock) is a low power timer that is typically used for exactly this. For example, the SoftDevice use RTC0 to wake up for every BLE event. I recommend you to use the app timer (Timer library) which is a user friendly software library that allows you to make an arbitrary number of single shot or repeated timers using RTC1. The application will get an event (due to a RTC interrupt) whenever the timer expires. The app timer is explained in this tutorial (unfortunately somewhat outdated).

    Make sure to put the CPU to sleep when it is idle, by calling something like the following function in the main loop (assuming no SoftDevice is used):

    static void sleep_handler(void)
    {
        __WFE();
        __SEV();
        __WFE();
    }

    Alternatively, use nrf_pwr_mgmt_run() from the power management library (works both with or without SoftDevice) or sd_app_evt_wait() directly (only if SoftDevice is used).

Children
Related