ESP32-S3 RTC accuracy
ESP32-S3 RTC accuracy
Hello All,
I am using the ESP32-S3 (ESP32-S3-WROOM-1U-N4R2), and we need an accurate RTC.
At the hardware I have connected a 32.378Hz crystal clock at pin 8 (IO15) and pin 9 (IO16).
We use the ABS07-32.768KHZ-T crystal and have load capacitors of 15pF.
The problem is that the clock is very inaccurate. We expect about 20ppm, but we measure about 850ppm difference.
Changing the stray capacitance does not make any difference. We tried 6.8pF instead of the 15pF, but still the same difference...
Visual GDB:
- IDF version: 4.4.2
- See attachments
Can anybody please assist me solving this problems?
Manny thanks!
I am using the ESP32-S3 (ESP32-S3-WROOM-1U-N4R2), and we need an accurate RTC.
At the hardware I have connected a 32.378Hz crystal clock at pin 8 (IO15) and pin 9 (IO16).
We use the ABS07-32.768KHZ-T crystal and have load capacitors of 15pF.
The problem is that the clock is very inaccurate. We expect about 20ppm, but we measure about 850ppm difference.
Changing the stray capacitance does not make any difference. We tried 6.8pF instead of the 15pF, but still the same difference...
Visual GDB:
- IDF version: 4.4.2
- See attachments
Can anybody please assist me solving this problems?
Manny thanks!
- Attachments
-
- VisualGdb_Timer.jpg (109.08 KiB) Viewed 4731 times
-
- VisualGdb_RTC.jpg (73.79 KiB) Viewed 4731 times
-
- Posts: 9713
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S3 RTC accuracy
Check the bootup messages; if the crystal is tried but fails calibration for the RTC, ESP-IDF will fallback to the (inaccurate) internal oscillator but will also complain in the bootup messages.
Re: ESP32-S3 RTC accuracy
Hi,
I checked if the external crystal is running normally at my application firmware and that is the case.
So the RTC does not run at the internal oscillators.
I checked it by short circuiting the crystal. Then I get a message in my debug output, the internal oscillator is taking over.
I checked if the external crystal is running normally at my application firmware and that is the case.
So the RTC does not run at the internal oscillators.
I checked it by short circuiting the crystal. Then I get a message in my debug output, the internal oscillator is taking over.
-
- Posts: 9713
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S3 RTC accuracy
How, specifically, do you measure the time drift? As in: duration of test, sleep mode active, how do you get the time, ...?
Re: ESP32-S3 RTC accuracy
The firmware does not goto sleep.
I reset the clock and 24hours later I check it.
In 24 hours the time drift is about a minute.
I retrieve the clock with the gettimeofday function.
I reset the clock and 24hours later I check it.
In 24 hours the time drift is about a minute.
I retrieve the clock with the gettimeofday function.
-
- Posts: 9713
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S3 RTC accuracy
This is from memory and it's been a while, but I don't think the ESP32 uses the RTC clock signal when not in deep sleep; it uses the (normally more accurate) 40MHz clock instead. Could there be something wrong with that crystal?
Re: ESP32-S3 RTC accuracy
Is there anybody who has implemented a 32kHz crystal clock at the ESP32-S3-WROOM-1U-N4R2?
If so, is your circuit accurate?
Can be please share your circuit with me? It would be very helpful...
Many thanks in advance!
If so, is your circuit accurate?
Can be please share your circuit with me? It would be very helpful...
Many thanks in advance!
Re: ESP32-S3 RTC accuracy
Well the whole idea is to use an accurate 32khz crystal clock for the RTC.
Normally these crystals are more accurate then the main clock. (I see that it actually is 10ppm, which is not bad...)
Now I am testing without going to deep sleep, but later deep sleep is a must.
So then we also need the 32kHz RTC.
Normally these crystals are more accurate then the main clock. (I see that it actually is 10ppm, which is not bad...)
Now I am testing without going to deep sleep, but later deep sleep is a must.
So then we also need the 32kHz RTC.
Re: ESP32-S3 RTC accuracy
Hello All,
I have found a problem which causes the deviation of the RTC clock.
It seems be be in software somewhere.
When I use the rtc_time_get() function the clock is accurate.
When I use the gettimeofday() function the clock deviation is about 700ppm.
The gettimeofday() is inaccurate both when I set calibration time to 0 or 5000.
So maybe someone can tell me why this difference occures in software??
Thanks!
I have found a problem which causes the deviation of the RTC clock.
It seems be be in software somewhere.
When I use the rtc_time_get() function the clock is accurate.
When I use the gettimeofday() function the clock deviation is about 700ppm.
The gettimeofday() is inaccurate both when I set calibration time to 0 or 5000.
So maybe someone can tell me why this difference occures in software??
Thanks!
-
- Posts: 9713
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S3 RTC accuracy
Do you have some minimal example code that shows the issue?
Who is online
Users browsing this forum: benrank and 38 guests