Why is RTC timer lost during deep sleep?

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Why is RTC timer lost during deep sleep?

Postby tve » Sat Oct 03, 2015 2:44 pm

Is it a design feature that the RTC timer is lost during deep sleep? I observe the following (using SDK 1.3):
    The chip is awakened from deep sleep after a timer expiration using a gpio16->ext_rst connection
    The RTC memory (system_rtc_mem_read/write) is preserved during deep sleep
    The RTC clock must be running during deep sleep since it awakens the chip
    When the chip awaken, the RTC clock (system_get_rtc_time) is reset to 0
Why?

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Re: Why is RTC timer lost during deep sleep?

Postby tve » Sat Oct 03, 2015 3:01 pm

By the way, is it expected that after a deep sleep system_get_rst_info->reason == REASON_EXT_SYS_RST and not REASON_DEEP_SLEEP_AWAKE ?

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Re: Why is RTC timer lost during deep sleep?

Postby dkinzer » Sat Oct 03, 2015 11:16 pm

tve wrote:is it expected that after a deep sleep system_get_rst_info->reason == REASON_EXT_SYS_RST and not REASON_DEEP_SLEEP_AWAKE ?
That is a bug in v1.3.0 (and probably earlier) of the SDK. It was fixed in a special build of v1.3.0 but I haven't checked to see if the correction made it into v1.4.0.
Don Kinzer
Beaverton, OR, USA

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Re: Why is RTC timer lost during deep sleep?

Postby tve » Sun Oct 04, 2015 2:12 am

Thanks for the note about the reset reason, it is fixed in 1.4!

The fact that the RTC clock is reset is still a puzzle.

torntrousers
Posts: 11
Joined: Thu Oct 08, 2015 2:31 pm

Re: Why is RTC timer lost during deep sleep?

Postby torntrousers » Thu Oct 08, 2015 2:35 pm

I'm interested in this question too -

When the chip awaken, the RTC clock (system_get_rtc_time) is reset to 0

It would be really useful if there was a way to prevent that happening.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: Why is RTC timer lost during deep sleep?

Postby ESP_Faye » Tue Oct 13, 2015 9:47 am

Hi,

Sorry for the inconvenience.

ESP8266 designed like this, wake up from deep-sleep, the RTC timer will be reset, but the data stored in RTC memory will not.

You could call system_get_rtc_time before deep-sleep and write the value into RTC memory by system_rtc_mem_write.

eriksl
Posts: 159
Joined: Fri May 22, 2015 6:22 pm

Re: Why is RTC timer lost during deep sleep?

Postby eriksl » Thu Oct 15, 2015 3:50 pm

Interesting though, because the RTC is supposed to keep running in deep sleep, because it needs to be able to wakeup the rest of the chip...

Dmytro
Posts: 1
Joined: Mon Aug 10, 2015 9:24 pm

Re: Why is RTC timer lost during deep sleep?

Postby Dmytro » Thu Dec 03, 2015 1:31 am

Reset RTC to 0 is real problem for me, I use deep-sleep, and during sleep time interrupt from external sensor may occur. External sensor connected to RESET line of ESP8266 and must wake up module, but after wake-up I can't calculate time was sleeping (and time left). Can you give some mechanism for direct RTC control? I didn't found detailed description of RTC module (registers, control bits and so on).

eriksl
Posts: 159
Joined: Fri May 22, 2015 6:22 pm

Re: Why is RTC timer lost during deep sleep?

Postby eriksl » Sat Dec 05, 2015 7:32 pm

Add external RTC, their very cheap (using I2C for example).

SpenZerX
Posts: 41
Joined: Thu Apr 16, 2015 9:30 pm
Location: Germany
Contact:

Re: Why is RTC timer lost during deep sleep?

Postby SpenZerX » Mon Dec 14, 2015 4:56 pm

Will RTC timer keep running in deep sleep when connecting PIN VDD_RTC?

Who is online

Users browsing this forum: No registered users and 305 guests