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

Timer confusion

So the nRF51822 has one 32 bit, two 16 bit timers and two Real Time Counters.

  1. What is the difference in a timer and counter? The timer API seems to hard link RTC1 to the timer API.

  2. Can we choose which timer to use or is it abstracted by the API.

  • Hi,

    1. A timer usually holds different modes. "Counter mode" is one of these modes. What we do is that we have a Capture/Compare mode, and we emulate a counter mode by making the timer reset itself using "SHORTS" register.

    2. You can setup any timer for the purpose you'd like. If you need good resolution, use TIMER0/1/2 (16 MHz based with prescaling options). If you need a low power timer, use the RTC (32 kHz based)

    We also provide a timer library. The "app_timer" library uses the 32 kHz RTC.

    Note: If you are using the S110 stack, please see the softdevice specification to see which peripherals are blocked.

    Best regards Håkon

  • Hello, You mentioned that "app_timer.c" uses 32kHz RTC, does it mean I can use this library to using RTC in order to save more power? Or I have to stop using "app_timer.c" library but using only RTC to run the counter mode?

    Thanks.

Related