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

App timer prescaler

I know this should be simple, but the prescaler is confusing me...

If I initialize my timers with a prescaler of 0, APP_TIMER_INIT(0, ...)

Then the max timer I can have is 512 seconds?

What if I do: app_timer_start(timer_id, 58982400, NULL)? Will that give me a 30 minute timer or not?

Thanks.

Parents Reply Children
  • Just an addition to RK answer APP_Timer is 24 bit. The number you mentioned 58982400(0X3840000) does not fit, trying to write it will write (0X840000) which is 8650752 timer ticks. With prescaler 0 each tick is 30.516us. So like RK mentioned you will end of with 264 second timer.

    If you change the prescaler say to 7, then there are 4096 ticks per seconds and 7372800(0X7080000) ticks for 30 minutes. This should fit into the timer well.

Related