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.

  • Update: 3/12/2015

    Stefan, Can you explain this a bit more ? We (I and manjunatha) do that configuration where we have reduced RTC_COMPARE_OFFSET_MIN to 1 since our prescaler was the largest that we could set (0xFFF), would this actually cause the drift ? Can this happen in System ON mode when CPU is not sleeping as well ?

    Also, the large prescaler we set was due to the power considerations, setting RTC_COMPARE_OFFSET_MIN to default value and reducing the prescaler to 0x1FFF (15.625) would then affect my power numbers wouldn't they ?

Reply
  • Update: 3/12/2015

    Stefan, Can you explain this a bit more ? We (I and manjunatha) do that configuration where we have reduced RTC_COMPARE_OFFSET_MIN to 1 since our prescaler was the largest that we could set (0xFFF), would this actually cause the drift ? Can this happen in System ON mode when CPU is not sleeping as well ?

    Also, the large prescaler we set was due to the power considerations, setting RTC_COMPARE_OFFSET_MIN to default value and reducing the prescaler to 0x1FFF (15.625) would then affect my power numbers wouldn't they ?

Children
No Data
Related