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

How to make the nrf52840 in sleep-mode & wake-up after every 'n' seconds using software interrupt(from internal RTC/timer library)?

Consider, I have checked these threads: https://devzone.nordicsemi.com/f/nordic-q-a/38832/system-on-sleep-mode & https://devzone.nordicsemi.com/f/nordic-q-a/30351/how-to-control-specific-time-nrf52832-sleep-mode-system-off-mode

Trying to do auto-wake using NVIC_SystemReset() or RESET or wake-up the controller after every 15mins using internal RTC or software interrupt but didn't work out for me. Also, tried these:

 __WFI();
__SEV();
__WFE();

But no results on sleep mode as there are BLE interrupts that may interrupt __WFE()

Will sd_power_system_off() makes internal RTC OFF?

Any code snippet for System On sleep mode & wake-up?

Is it possible to wake-up the NRF52840 using Software Interrupt?

Regards

Vishal Aditya

Embedded Software Engineer

Parents
  •  __WFI();
    __SEV();
    __WFE();

    The correct sequence to put the CPU in System ON sleep(idle-mode) is:

            // Wait for an event.
            __WFE();
            // Clear the internal event register.
            __SEV();
            __WFE();

    If you are using the SoftDevice, you should use sd_app_evt_wait() instead.

    Will sd_power_system_off() makes internal RTC OFF?

    Yes. System OFF is the deepest power saving mode the system can enter. In this mode, the system’s core functionality is powered down and all ongoing tasks are terminated.

    Any code snippet for System On sleep mode & wake-up?

    Any interrupts that happens when the CPU is in System ON sleep will wake the CPU up, and the CPU will process the interrupt.

    Is it possible to wake-up the NRF52840 using Software Interrupt?

    From System ON sleep, yes. But not in System OFF sleep. When in System OFF mode, the device can be woken up through one of the following signals:

    1. The DETECT signal, optionally generated by the GPIO peripheral
    2. The ANADETECT signal, optionally generated by the LPCOMP module
    3. The SENSE signal, optionally generated by the NFC module to “wake-on-field”
    4. A reset
  • Hello Sigurd, 

    I am working with Vishal on implementing the System ON Sleep mode. We are currently using the ble_app_uart example as base and we have added the necessary drivers to it.

    I want my  application processes to run once every 15 minutes.

    I proposed that we use the app_timer and have a timer event every 15 minutes, carry out my computations in the timer handler.

    But later I  found out the systems wakes up for all events (in this case softdevice events and BLE events). We then decided that we will switch off all peripherals for the entire 15 minute interval as I want to reduce power consumption to the maximum extent.

    So finally, I want to switch off BLE, RTC0 and keep just RTC1 powered on and enter system on sleep mode by using the sev wfi and wfe calls. When RTC 1 throws a timeout event, I will power on ble and schedule all my processes in the event handler. 

    I am fine with the loss of ble for the 15 minute interval.

    Can you suggest some solution for this? Can I simply disable the softdevice towards the end of my rtc 1 event handler?

    Thank you. 

Reply
  • Hello Sigurd, 

    I am working with Vishal on implementing the System ON Sleep mode. We are currently using the ble_app_uart example as base and we have added the necessary drivers to it.

    I want my  application processes to run once every 15 minutes.

    I proposed that we use the app_timer and have a timer event every 15 minutes, carry out my computations in the timer handler.

    But later I  found out the systems wakes up for all events (in this case softdevice events and BLE events). We then decided that we will switch off all peripherals for the entire 15 minute interval as I want to reduce power consumption to the maximum extent.

    So finally, I want to switch off BLE, RTC0 and keep just RTC1 powered on and enter system on sleep mode by using the sev wfi and wfe calls. When RTC 1 throws a timeout event, I will power on ble and schedule all my processes in the event handler. 

    I am fine with the loss of ble for the 15 minute interval.

    Can you suggest some solution for this? Can I simply disable the softdevice towards the end of my rtc 1 event handler?

    Thank you. 

Children
No Data
Related