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

timer vs app_timer

I am trying to understand the difference between the timer driver and the app_timer library. First of all: It seems like timer and app_timer are two entirely different things. One is based on the RTC, the other one is not. But why are they then named in such a similar way?

When should I use app_timer and when the timer driver? The documentation is really poor on this part.

Parents
  • app_timer is a module that is usually used with the softdevice. In most of our examples app_timer will use RTC1 (since this resource isn't used by the softdevice) and it allows you to schedule multiple timers, all using RTC1, to be used for different things in your application. The BLE examples provided in the SDK initialize and use the app_timer module for timers like (when to renegotiate connection parameters). But you can use it as well for some of your application specific timers and be sure that you wont interfere with the softdevice or anything else.

    i believe the timer is just a driver for our timer peripheral (which uses HFCLK). the softdevice will use some timers so you need to be careful. also maybe the example app you are using as a template uses some timers.. you need to check this carefully (softdevice spec, look through example code). otherwise you will get some bad behavior.

Reply
  • app_timer is a module that is usually used with the softdevice. In most of our examples app_timer will use RTC1 (since this resource isn't used by the softdevice) and it allows you to schedule multiple timers, all using RTC1, to be used for different things in your application. The BLE examples provided in the SDK initialize and use the app_timer module for timers like (when to renegotiate connection parameters). But you can use it as well for some of your application specific timers and be sure that you wont interfere with the softdevice or anything else.

    i believe the timer is just a driver for our timer peripheral (which uses HFCLK). the softdevice will use some timers so you need to be careful. also maybe the example app you are using as a template uses some timers.. you need to check this carefully (softdevice spec, look through example code). otherwise you will get some bad behavior.

Children
No Data
Related