Page 1 of 1

RTC calibration

Posted: Fri May 24, 2024 9:26 pm
by gmag11
Hi everyone,

I am working on a project that involves taking time measurements and requires high accuracy. To achieve this, I am using a GNSS receiver with a 1PPS signal to trigger an interruption and synchronize the internal time every second. Estimated CPU frequency is about 239.99886 MHz.

However, I've observed that my ESP32 drifts at a rate of 5 ppm every second. I measured this drift using the

Code: Select all

portGET_RUN_TIME_COUNTER_VALUE
values.

Is there a way to calibrate the internal clock through code to correct this drift using the 1PPS signal as a reference? If so, is there any documentation available on this?

Thank you in advance for your help!

Regards,
Germán

Re: RTC calibration

Posted: Mon May 27, 2024 10:48 pm
by MicroController
How about dedicating one of the hardware timers to your timekeeping and keep adjusting its period to match the 1pps?