Real-Time Clock (RTC) Drift Management#
Drift Characteristics with Internal Resistor-Capacitor (RC) and External 32 kHz Crystal (XTAL)#
RTC accuracy depends on the low-frequency clock (LFCLK) source:
RC 32 kHz oscillator
As specified in the data sheet, the typical frequency variation is about ±1.2% across temperature and voltage.
This is ~12,000 parts per million (ppm) (that is, up to ~1,030 seconds/day (approximately 17 minutes)).
Strongly temperature dependent and the drift may be in the order of tens of ppm of per °C.
Acceptable for watchdogs, coarse wake-up timers, or applications that can frequently resync.
XTAL 32.768 kHz oscillator
Combined accuracy (tolerance + error due to temperature variation + load error): ±250 ppm maximum.
Typical high-quality crystal (per AN1335 recommended parts): ±20 ppm → ~1.7 s/day drift.
Much better stability across Sleep cycles and temperature changes.
Recommended for real-time clocks, wireless sync, and low-drift applications.
Numerical Error Examples#
Clock Source | Accuracy (ppm) | Error per Hour | Error per Day |
|---|---|---|---|
RC 32 kHz | ±12,000 ppm (±1.2%) | ~43 seconds | ~17 minutes |
XTAL 32.768 kHz | ±250 ppm | ~0.9 seconds | ~21.6 seconds |
XTAL 32.768 kHz (High-quality) | ±20 ppm | ~72 milliseconds | ~1.7 seconds |
Techniques for Managing RTC Drift#
Sleep Clock Calibrator (SCC) through the Calendar Calibration componentOnce enabled through the Calendar calibration service, the SCC hardware automatically and repeatedly measures the selected low-frequency (LF) clock (RC 32 kHz) against the 40 MHz reference and updates the RTC time base accordingly.
Note: The XTAL 32.768 kHz path does not require calibration. Use RC calibration only when operating without an external crystal.
Application-level resynchronization
Periodically synchronize the Calendar time to a trusted source such as the Network Time Protocol (NTP) server or a wireless beacon or time synchronization function (TSF).
Recommended for wirelessly connected devices that require accurate long-term timekeeping.
Drift Behavior across Sleep-Wake Cycles#
RTC continues in the Ultra-Ultra-Low-Power (UULP) domain across sleep.
With RC sources, drift increases if temperature or voltage changes while sleeping.
With XTAL, drift is stable and predictable (ppm level).
After Wake-Up, the calibrator can be run to re-adjust RC before resuming.