I am using the nrf52832 soc, and have a requirement to run the device in low power mode and using the timer with a timeout value in days? how can I do so?
Sample code would be of great help.
I am using the nrf52832 soc, and have a requirement to run the device in low power mode and using the timer with a timeout value in days? how can I do so?
Sample code would be of great help.
The RTC will easily accommodate this and is the preferred method of handling sleep/wake cycles of the cpu since it is the lowest power clock. Since the RTC has a 12 bit prescaler and 24 bit counters with one compare event you can run it for 2^24/(32768/2^12) eighth second intervals or about 24 days before it overflows. The ISR from the RTC event will wake the processor up after you put it in low power mode.
Hi nordic support.
I have tried to do it using RTC in comparator mode, but it gives me a max sleep time of 512 seconds. I want a timer that can count for me for maximum time.
Can you share a sample code or a readily available example code? I am referring SDK V11.0.
Hi Ankit.
When using a prescaler of 0, the RTC will overflow after 512 seconds.
Like AmbystomaLabs said in his comment above, using the max prescaler value (2^12-1=4095) the RTC will overflow after 582.542 hours or ~24 days. More information here.
Ankit, are you using a soft device?
I changed RTC_freq to 8 and now I am able to configure RTC to count for 24 days. Yes we are using soft device s132_nrf52_2.0.0_softdevice.hex