RTC / gettimeofday overflow

kostyan5
Posts: 50
Joined: Mon Mar 06, 2017 3:16 pm

RTC / gettimeofday overflow

Postby kostyan5 » Mon Mar 27, 2017 6:45 pm

How quickly does RTC / gettimeofday overflow? On ESP8266 it was something around 7 hours. I can't find any details on gettimeofday implementation.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: RTC / gettimeofday overflow

Postby ESP_igrr » Tue Mar 28, 2017 1:10 am

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.

ESP_Sprite
Posts: 8926
Joined: Thu Nov 26, 2015 4:08 am

Re: RTC / gettimeofday overflow

Postby ESP_Sprite » Tue Mar 28, 2017 3:08 am

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.

Who is online

Users browsing this forum: snehapawar# and 116 guests