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

sleep function is not working when timer/RTC is running in nRF51822

nrf51822_sleep_and_timer.txt

Hi... I having tough time to make the sleep function to work when timer/RTC is running in the background of nRF51822. The attached text file containing my code. After comment out the start_timer() & start_RTC() in the setup() then the sleep function is working fine as I will only can be woke up by the external internal. If either one of this function : start_timer() or start_RTC() is uncommented from the setup() then the system is not going to sleep as I got to know it by checking on the serial monitor as it's keep on printing "Hello". Kindly assist. Thanks.

  • Hi Aryan, I totally understand what you trying to explain to me. I still wondering is this Nordic characteristic? Nordic cannot sleep completely and run timer/RTC on the background. Because I try it out with Atmel chip again with the code that I have, and the sleep doesn't woke up by the timer/RTC interrupt. The timer able to run at the background and the system still able to sleep. Why I know is sleeping because i put printf some string on the main loop and ntg is printing out. The system will only be woke up by the accelerometer interrupt then i only can see the printf string. Kindly assist.

  • I do not know much about ATMEL chips and how you configure it, but any processor cannot be sleeping and still be able to run its interrupt handler. Processor has to wake up to process its enabled interrupts and then run its interrupt handler.

    If you want that accelerometer interrupt is the only only one that wakes your system , then you need to disable RTC interrupt. I can't say why the same thing worked on ATMEL.

Related