RTC calibration

gmag11
Posts: 4
Joined: Fri Nov 20, 2015 5:42 am

RTC calibration

Postby gmag11 » Fri May 24, 2024 9:26 pm

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

MicroController
Posts: 1552
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: RTC calibration

Postby MicroController » Mon May 27, 2024 10:48 pm

How about dedicating one of the hardware timers to your timekeeping and keep adjusting its period to match the 1pps?

Who is online

Users browsing this forum: No registered users and 71 guests