Hi for my use-case I need the RTC in the NRF51 SoC to run continuously and uninterrupted (we know running out of battery will be a concern). Keeping the NRF51 system on 24/7 will drain battery power quickly, but the NRF51 will also be connected to sensors and need to periodically check if the sensors detect any changes. So we plan to program the NRF51 to sleep for one second and then wake up the next second, and repeat this to save power. However, when Softdevice BLE is advertising I think the NRF51 has to be awake.
So we have to keep track of time for programming the NRF51 system to go to sleep as well as for recording timestamps. We thought of two ways to do this:
1. Use a repeated app_timer with normal prescale and a timeout interval of 1000 or 2000 ms, etc and increment a counter variable in the app_timer's timeout_handler. We do not see much downside to this approach, though there might be a very tiny delay between the tick and the counter variable being incremented. This approach doesn't seem to have overflow issue either.
2. Use an app_timer that ticks with the the maximum prescale setting of 4095, so the RTC gets a period of 125 ms and overflows after 582.542 hours. The downside to this approach is we have to keep track of the RTC overflow, but compared to the first method above the app_timer will only need to repeat/reset after about 24 days.
Some of our concerns right now if there is any power advantage one has over the other? Will both methods also work without the clock timers being interrupted by Softdevice/BLE events or if the NRF system goes to sleep every other second?
And are there any other considerations we should also consider before deciding over using a repeated app_timer with a (short time interval and normal prescaler) vs RTC with maximum prescaler?
Thank you!