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

Using app_timer to implement RT clock & calendar?

Hi,

In my application I need to keep both time and date so I need a real time clock & calendar (RTCC). I was planning to use on the nRF51 real time counter (RTC) to implement my own RTCC, but RTC0 is used by the S110 and RTC1 is used by the app_timer library which I'm using.

I was also planning to use the RTC compare interrupts to generate alarms at given times.

So, is it reasonable to implement an RTCC with the app_timer library and still keep the whole thing low power or I'm better off using an external RTCC chip?

Thanks

Parents
  • No real difference between using an app_timer and using a free RTC, which you are correct in this case you don't have as both RTCs are in-use. It's still interrupt-based, it still wakes up on a regular interval and increments a counter, doing it via app_timer instead of a dedicated RTC runs more code because the app_timer is reasonably complicated, but it's still basically pretty low power, especially if you're waking up often for bluetooth events to occur anyway.

    Accuracy may not be particularly great however, a few seconds a day of drift is possible. The RTCC chips also often provide calendar functions with rollover and leap years and useful stuff, so if that's important to you as well as low power, that might be another reason to use a separate chip.

Reply
  • No real difference between using an app_timer and using a free RTC, which you are correct in this case you don't have as both RTCs are in-use. It's still interrupt-based, it still wakes up on a regular interval and increments a counter, doing it via app_timer instead of a dedicated RTC runs more code because the app_timer is reasonably complicated, but it's still basically pretty low power, especially if you're waking up often for bluetooth events to occur anyway.

    Accuracy may not be particularly great however, a few seconds a day of drift is possible. The RTCC chips also often provide calendar functions with rollover and leap years and useful stuff, so if that's important to you as well as low power, that might be another reason to use a separate chip.

Children
No Data
Related