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

time keeping during sleep

Hello experts,

I am getting into the word of Nordic and hence here is my first question. Kindly help.

Software version: SDK-14 Hardware revision: nRF52832 DK (PCA10040)

I am using BLE_CENTRAL mode on nRF52832 and it works great out of the box :) For certain reasons, I need to keep track of certain jobs in my project and hence I need a functionality similar to RTC. When browsed through the forum, I found that for RTC timekeeping, having a separate HW module was recommended. Instead of this, I went ahead with my design using "application_timer" and my solution just works great.

My device is battery operated and and now I want to save some battery life. Below is the sequence of operations I would like to do in my software.

  1. Run software and do desired actions.
  2. Note down the sleep entry "timestamp" & then enterr sleep mode to save power.
  3. Wake up on button push interrupt.
  4. Now record the button push time stamp.

Above said sequence will help me to determine the total sleep duration.

Any suggestions?

Thanks

Parents
  • No one would recommend external RTC component unless you want to get time triggers when nRF5x chip is in SYSTEM OFF mode. In normal operation (when it switches between normal operation of MCU and SYSTEM ON SLEEP when it waits for event/interrupt) you can use internal RTC for basic time keeping and periodical wake-ups. Most people use app_timer library (see SDK examples) but indeed you can write simpler custom "library" if you need/want.

  • If you want to scan it can be done only as periodic activity;) That's how BLE works, there is no magic which would wake you up once some 2.4GHz photons hit your antenna... in addition while CPU is in SLEEP any HW peripheral can continue in autonomous operation so you can run RTC and simply check counter once you wake-up. There are examples of all the basics in nRF5 SDK, I'd say spend few weeks with it to get familiar and then most of things will be clear.

Reply
  • If you want to scan it can be done only as periodic activity;) That's how BLE works, there is no magic which would wake you up once some 2.4GHz photons hit your antenna... in addition while CPU is in SLEEP any HW peripheral can continue in autonomous operation so you can run RTC and simply check counter once you wake-up. There are examples of all the basics in nRF5 SDK, I'd say spend few weeks with it to get familiar and then most of things will be clear.

Children
No Data
Related