Page 1 of 1

RTC / gettimeofday overflow

Posted: Mon Mar 27, 2017 6:45 pm
by kostyan5
How quickly does RTC / gettimeofday overflow? On ESP8266 it was something around 7 hours. I can't find any details on gettimeofday implementation.

Re: RTC / gettimeofday overflow

Posted: Tue Mar 28, 2017 1:10 am
by ESP_igrr
If you enable timekeeping using the FRC1+RTC, a 64 bit microsecond counter will be used for timekeeping.
In deep sleep mode, the base value of the counter is saved into RTC controller scratchpad registers, and timekeeping continues using a 48 bit RTC slow clock (which counts at 150kHz).

If you enable timekeeping using RTC only (no FRC1), then the 48 bit RTC clock (counting at 150kHz) will be used at all times.

Re: RTC / gettimeofday overflow

Posted: Tue Mar 28, 2017 3:08 am
by ESP_Sprite
To give an indication of what to expect, this means that when not in deep sleep mode, the clock overflows once every 599730 years, while in deep sleep mode you can expect trouble after a mere 61 years.