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

NRF51822 sleep modes and ESB

Hi

I am making some low-power wireless sensors powered by coin cells, which will sleep for long intervals between readings/transmits. I am using the micro ESB libraries without a softdevice. Because I want the sensor to wake up without external input, I am putting the system into SYSTEM ON ,waking up after a defined interval.

-I have successfully got the sensors to communicate with a base station with the micro USB libraries

  • I have successfully put them into SYSTEM ON sleep-mode, wake up after an interval, and transmit a new reading, but this is with HFCLK on and therefore draws ~1mA

  • I have successfully turned off the TWI peripheral and the HFCLK before going into SYSTEM ON, and driven current consumption down to ~3uA (great!)

  • BUT when the sensors no longer communicate with the base station if I have turned the HFCLK off before going into SYSTEM ON

I think there is something that I should be doing to prepare the radio before going into SYSTEM ON, or wake it up properly afterwards, but am unsure what.

  • What is the correct sequence of instructions to put the system to sleep with HFCLK off, and wake it back up again, if I am using micro esb without a softdevice?
  • Do it need to shutdown and reinitialise the radio?
Parents
  • Hi Gavin

    I think the solution is to use the 32kHz RTC timer in order to wake up again. The RTC timer requires a 32kHz clock source in order to operate. The clock source can be either the internal 32kHz RC or the 32kHz external crysal. If you have an external crystal, that is most accurate and consumes the least power. If you use the RC you need to calibrate it.

    • The current consumption of RTC + 32kHz crystal is typically <1uA
    • The current consumption of RTC + 32kHz RC is typically <10uA

    You must manually start the 32kHz clock source before using the RTC, which is either RTC0 or RTC1. You can see a code example e.g. here. Look at the lfclk_config() and rtc_config() functions.

    You can set a CC compare register to get an event after a certain time. You can set up the RTC interrupt so that the CPU wakes up, then start the HFCLK before starting the radio.

    You can also set up a PPI channel to start the HFCLK on the RTC CC compare event, similar to what is done in the linked example.

    More on LFCLK here

Reply
  • Hi Gavin

    I think the solution is to use the 32kHz RTC timer in order to wake up again. The RTC timer requires a 32kHz clock source in order to operate. The clock source can be either the internal 32kHz RC or the 32kHz external crysal. If you have an external crystal, that is most accurate and consumes the least power. If you use the RC you need to calibrate it.

    • The current consumption of RTC + 32kHz crystal is typically <1uA
    • The current consumption of RTC + 32kHz RC is typically <10uA

    You must manually start the 32kHz clock source before using the RTC, which is either RTC0 or RTC1. You can see a code example e.g. here. Look at the lfclk_config() and rtc_config() functions.

    You can set a CC compare register to get an event after a certain time. You can set up the RTC interrupt so that the CPU wakes up, then start the HFCLK before starting the radio.

    You can also set up a PPI channel to start the HFCLK on the RTC CC compare event, similar to what is done in the linked example.

    More on LFCLK here

Children
No Data
Related