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

How to set a 12-hour timer in S110

Hello,

[Device: nRF18522 S110 Softdevice 8.0.0 SDK10]

I've referred to this post:

devzone.nordicsemi.com/.../

Does it mean the maximum value is 512 seconds for prescaler of 0?

However, I want to set a 12-hour timer to monitor battery level in order to save the power consumption. Is it possible to set the 12-hour timer?

Thanks for your help in advance.

Sara

Parents
  • Yes the max value is about 512 seconds for a prescalar of zero, because the timer counts to 2^24 at 32,768Hz and 2^24/32,768 = 512.

    If you want longer, don't use a prescalar of zero.

    As usual this is in the nRF51 reference manual, section 19.1.2 which gives you the max times for various prescalars. It goes all the way up to 582.542 hours, or just over 24 days.

    Or you could just wake up every 512 seconds and count 1 until you reach 12x60x60/512 = 84 and a bit, then you have 12 hours.

  • yes, 125ms, but if you care about 12 hours, hardly matters.

    higher power, yes but not much, you're waking up 84 times instead of once, counting plus one and going back to sleep again. Just choose the value of prescalar which works for all the timers you need in your app and use that. Or don't even bother with app_timer and just start the RTC with a counter value you want, enable the interrupt and go to sleep.

Reply
  • yes, 125ms, but if you care about 12 hours, hardly matters.

    higher power, yes but not much, you're waking up 84 times instead of once, counting plus one and going back to sleep again. Just choose the value of prescalar which works for all the timers you need in your app and use that. Or don't even bother with app_timer and just start the RTC with a counter value you want, enable the interrupt and go to sleep.

Children
No Data
Related