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

I have a simple question about the timer.

Hello, everyone.

I am using sdk v17 and I am looking into timer.
I used the app_timer simply, but I don't know the nrf_drv_timer because I've never seen it before.
Can I find an example related to nrf_drv_timer?  And can both the app_timer and the nrf_drv_timer operate simultaneously?

Thank you in advance.
Parents
  • Hi,

    App_timer and nrf_drv_timer can operate simultaneously. App_timer runs off a single RTC instance for creating multiple software timer instances, while the TIMER driver can utilize any of the available HW TIMER instances.

    The RTC runs off the 32.768 kHz Low-Frequency Clock, which gives much lower current consumption than the TIMERs running off the 16 MHz High-Frequency Clock. The advantage of TIMER vs RTC is that TIMERS have much better resolution (62.5 ns) than RTC (~30.5 us). For operations where timing accuracy is essential, TIMERS are preferred. For long-time task planning, etc, RTCs/app_timer are usually better.

    A timer example is available in the SDK.

    Best regards,
    Jørge

Reply
  • Hi,

    App_timer and nrf_drv_timer can operate simultaneously. App_timer runs off a single RTC instance for creating multiple software timer instances, while the TIMER driver can utilize any of the available HW TIMER instances.

    The RTC runs off the 32.768 kHz Low-Frequency Clock, which gives much lower current consumption than the TIMERs running off the 16 MHz High-Frequency Clock. The advantage of TIMER vs RTC is that TIMERS have much better resolution (62.5 ns) than RTC (~30.5 us). For operations where timing accuracy is essential, TIMERS are preferred. For long-time task planning, etc, RTCs/app_timer are usually better.

    A timer example is available in the SDK.

    Best regards,
    Jørge

Children
Related