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

RTC1 behavior in low power mode

I intend to keep a long running clock in the system and use the app_timers(hence RTC1) in a soft device enabled nrf51822 firmware. I basically have a minute tick and update local time every minute, However, I've observed that once I call the sd_power_mode_set(NRF_POWER_MODE_LOWPWR), I see the RTC not being updated regularly and begin to see a drift in the local clock because of this. The code would then mainly be at WFE() - is this correct ? Is this a possibility, what is the accuracy of RTC1 when in low power mode? I am using a 32Khz NRF_CLOCK_LFCLKSRC_XTAL_20_PPM and internal RTC1 via app_timer approach to keep track of time.

Parents
  • Thanks Stefan, Yes, the logic doesn't necessarily uses a app_timer, the ticks are extracted out of RTC1 counter and added to my local time. So, even if the app_timer interrupts are delayed the RTC1 counter should reflect that shouldn't they ? i.e. my logic is not say add "60" seconds to my local time every minute started with app_timer called minute_timer, However, whenever requested (by BLE application), convert_to_seconds(RTC1 counter) + "previously set time from phone". This RTC1 counter can go wrong only on reboot, or roll-over, with my logic making sure I don't roll over.

    So, there is a high chance that no timers, BLE events, system events are called in my system for huge time (with prescaler set to 0xFFF, roll over happens after 590~ hours). Could this be a concern ?

    Unlikely with the crystal accuracy - it is said to be 20ppm.

  • I do not realize what tick frequency you actually need, but you should keep the RTC_COMPARE_OFFSET_MIN to 3 in order to ensure normal operation, regardless if you are in low power mode or constant latency mode. Did you try already to set RTC_COMPARE_OFFSET_MIN as 3? Does the problem persist? As I understand your problem, you are missing some RTC interrupts and that is what is expected if you have RTC_COMPARE_OFFSET_MIN as 1.

    Changing the prescaler should not have any effect on the power consumption of the device. The RTC consumes ~0.1uA regardless of prescaler settings. It is the actual interrupt frequency that will effect the power consumption as higher interrupt frequency would require higher CPU activity.

Reply
  • I do not realize what tick frequency you actually need, but you should keep the RTC_COMPARE_OFFSET_MIN to 3 in order to ensure normal operation, regardless if you are in low power mode or constant latency mode. Did you try already to set RTC_COMPARE_OFFSET_MIN as 3? Does the problem persist? As I understand your problem, you are missing some RTC interrupts and that is what is expected if you have RTC_COMPARE_OFFSET_MIN as 1.

    Changing the prescaler should not have any effect on the power consumption of the device. The RTC consumes ~0.1uA regardless of prescaler settings. It is the actual interrupt frequency that will effect the power consumption as higher interrupt frequency would require higher CPU activity.

Children
No Data
Related