What is the maximum time that I can use in app_timer_start?
I tried setting it to APP_TIMER_TICKS(15 * 60000) in order to set a timer of 15 minutes but it timed out after 6m28s.
What is the maximum time that I can use in app_timer_start?
I tried setting it to APP_TIMER_TICKS(15 * 60000) in order to set a timer of 15 minutes but it timed out after 6m28s.
Depends on the prescaler. RTC counter and compare registers are 24 bits wide.
Ok, how do I calculate it If I use 0 for APP_TIMER_CONFIG_RTC_FREQUENCY?
A 24bit counter will overflow in 2^24=16777216 RTC periods, and I recommend that the max timeout value is half of that. So that means that if the RTC period is default (1/32768)seconds, then the max timeout should be 1/32768 * 16777216/2 = 256seconds.
Best regards,
Kenneth
A 24bit counter will overflow in 2^24=16777216 RTC periods, and I recommend that the max timeout value is half of that. So that means that if the RTC period is default (1/32768)seconds, then the max timeout should be 1/32768 * 16777216/2 = 256seconds.
Best regards,
Kenneth
Why do you recommend the max timeout be half of the 24 bit counter? I need to measure a 24hr span of time, and would like to setup a repeating 5 minute timer to count that time. 256 seconds is less than that. the counter periods elapsed over the course of 300 seconds seems well within the bounds of the 24 bit counter, so why recommend staying under half of the counter range?