RTC clock too fast by 2 Min in 10 hours?

rin67630
Posts: 55
Joined: Sun Mar 11, 2018 5:13 pm

RTC clock too fast by 2 Min in 10 hours?

Postby rin67630 » Sun Apr 15, 2018 8:17 am

How accurate is the RTC clock of the ESP32.
My datalogger based on a ESP WROOM-32 Chip is ESP32D0WDQ6 (revision 1) is too fast by 2 Min in 10 hours.
That drift is really not an acceptable value.
According to the data sheet it has a xtal 40MHz+/-10ppm built in, so the drift after 10 hours should barely be noticeable.

My sketch goes to light sleep every second for 900mS.
Can it be the light sleep? I will check without it and report this tomorrw...

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

Re: RTC clock too fast by 2 Min in 10 hours?

Postby ESP_igrr » Sun Apr 15, 2018 9:57 am

In light sleep and deep sleep, RTC clock is used for timekeeping. This is either the internal 150kHz oscillator, or external 32kHz XTAL. The internal 150kHz oscillator is +/-5%.

rin67630
Posts: 55
Joined: Sun Mar 11, 2018 5:13 pm

Re: RTC clock too fast by 2 Min in 10 hours?

Postby rin67630 » Sun Apr 15, 2018 10:53 am

ESP_igrr wrote:In light sleep and deep sleep, RTC clock is used for timekeeping. This is either the internal 150kHz oscillator, or external 32kHz XTAL. The internal 150kHz oscillator is +/-5%.


Thank you for the fast reply.

Thats really bad news. :-(
So without an external xtal, sleep is unusable for any serious data logging.

If I connect a 32kHz XTAL to IO32 and IO33, will it be automagically recognized or will it need some specific code?
I am programming on the Arduino IDE.

Thank you for your help.

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

Re: RTC clock too fast by 2 Min in 10 hours?

Postby ESP_igrr » Sun Apr 15, 2018 1:11 pm

rin67630 wrote:If I connect a 32kHz XTAL to IO32 and IO33, will it be automagically recognized or will it need some specific code?
I am programming on the Arduino IDE.


No specific code is needed, however you need to change CONFIG_ESP32_RTC_CLOCK_SOURCE option in sdkconfig. This is not something you can do from Arduino IDE. However if you use ESP32 Arduino core as IDF component, you can make this change using "make menuconfig".

Who is online

Users browsing this forum: No registered users and 2 guests