Real-Time Clock (RTC) Calibration with Internal Resistor-Capacitor (RC) Oscillator#
Definition and Purpose of Calibration#
When the Calendar/System Real-Time Counter (SYSRTC) runs from the internal ~32 kHz RC clock, its frequency varies with process, voltage, and temperature. The Sleep Clock Calibrator measures that resistor-capacitor (RC) clock against a known reference (40 MHz XTAL) and computes an accurate time period for the Real-Time Clock (RTC) tick. The corrected period is then applied to the RTC time base via the TIME_PERIOD register in 8.17 fixed-point format (see explanation below), reducing drift during Sleep and over temperature.
What does “8.17 fixed-point” mean?
The calibrated RTC tick period is stored as a fixed-point number with 8 integer bits and 17 fractional bits. In plain terms, that lets the hardware represent the tick length (in microseconds) very precisely. For example, a 32 kHz clock has a period of 31.25 µs. When written in 8.17 fixed-point, that becomes 31.25 × 2¹⁷ = 4,096,000, which is 0x003E8000 in the time-period register. The RTC then uses this value internally to step time with much finer granularity than whole microseconds, improving accuracy after calibration.
RC Clock Calibration via Calendar (32 kHz RC Clock)#
Overview#
Calibration of the internal 32 kHz RC oscillator is supported via a dedicated framework for both the Calendar and Deep Sleep timer peripherals. The legacy approach using direct Calendar APIs for RC calibration is deprecated and non-functional in current Software Development Kits (SDKs). Instead, use the 32 kHz RC calibration component.
Usage Steps#
Enable the “32 kHz RC Clock Calibration” component in Simplicity Studio or in your project configuration.
Configure calibration parameters via the component’s configuration header or Simplicity UI. For example:
Calibration interval (for example, 5 s, 10 s, 15 s, 30 s)
Temperature-change threshold to retrigger calibration
Smoothing/averaging settings for drift reduction
Calibration execution (automatic)
At each scheduled calibration event, the high-accuracy reference (for example, 40 MHz) is briefly enabled.
The 32 kHz RC clock is measured against the reference, results are smoothed/averaged.
The corrected tick time period is written into the Calendar’s time base register (often in fixed-point Q8.17 format) and synchronized into the LF domain.
Application code
No direct calibration APIs (for example,
sl_si91x_calendar_rcclk_calibration) need to be called.Remove any legacy API invocations — the component handles initialization and periodic calibration.
Your main loop remains unchanged; the calibration works transparently in the background.
Migration and Legacy API Table#
Legacy API | Current Approach | Notes |
|---|---|---|
| Disable/remove | Initialization is done by the calibration component |
| Use component configuration | Direct API no longer functional |
Important Notes#
Because the calibration sequence uses the reference clock and enables measurement hardware, current draw will momentarily increase. Adjust intervals and smoothing accordingly if ultra-low-power operation is required.
Ensure the component configuration aligns with your system’s low-frequency (LF) clock source and Deep Sleep requirements.
Notes:
The “continuous” behavior is driven by your configuration: once you enable periodic and/or temperature-based calibration, the measurements and updates run automatically in the background at the cadence you set.
If you use an external 32.768 kHz crystal (XTAL), calibration is typically not required; the XO’s parts per million (ppm) specification provides the needed accuracy.
Configuration fields (summary):
Calibration trigger control
Developers can select:The trigger rate, selectable for RC (5, 10, 15, or 30 s or longer)
Measurement and averaging parameters
Register fields control how many LF cycles are observed per calibration, how the results are smoothed (using a moving average factor often called α), and how many measurements are combined for stability.
These options let developers trade off calibration latency, noise suppression, and accuracy.Temperature-based calibration enable
Additional bits let the system enable temperature monitoring, specify a ΔT threshold (typically ≈ 5 °C), and set a check interval (1, 2, 4, or 5 s).
When the temperature changes more than the threshold, a new calibration cycle is automatically triggered.
Trigger sources and cadence:
Periodic RC: Selectable intervals (for example, 5 / 10 / 15 / 30 s). Longer intervals may be available. See the Reference Manual and Software Development Kit (SDK) for more information.
Temperature-based RC: Retrigger calibration when the measured temperature change exceeds a configurable threshold.
Note: If you use an external 32.768 kHz XTAL, calibration is typically unnecessary — its ppm stability dominates
Note on 8.17 fixed-point format (Calendar time-base):
When the RTC tick period is stored as an 8.17 fixed-point value (8 integer + 17 fractional bits), you’ll see convenient round numbers for common LF sources:32.000 kHz → period = 31.250 µs → 31.25 × 2¹⁷ = 4,096,000 = 0x003E8000
32.768 kHz → period = 30.517578125 µs → 30.517578125 × 2¹⁷ = 4,000,000 = 0x003D0900
These values are what the hardware uses internally to advance time with fine granularity.
Recommended Calibration Frequency#
Choose your calibration cadence to balance accuracy against energy consumption:
Stable / indoor conditions: RC calibration every 15–30 s is usually sufficient.
Outdoor / variable thermal environments: Enable temperature-based calibration with a threshold of about ΔT ≈ 5 °C, and check temperature every few seconds for faster response.
XTAL users: The external 32.768 kHz crystal’s ppm error is predictable and stable enough for most applications.
Tip: After long sleep intervals, run an RC calibration soon after wakeup to re-align accuracy before scheduling precise operations.
Power Consumption Considerations#
Each calibration cycle briefly enables the 40 MHz system crystal oscillator and waits for a short settle period—defined by the REF_SETTLE_LF_TICKS register (default = 64 LF ticks) — before measuring the low-frequency clock.
This causes a small energy burst per calibration; higher calibration frequency means more such bursts.
Guidelines:
Use longer intervals (15–30 s) for stationary environments, shortening only when tighter drift control is needed.
In tickless-idle systems, SYSRTC already serves as the Sleep Timer.
Schedule calibration so it does not overlap with critical wake-up events.
The Power Manager and real-time operating system (RTOS) typically add missed Sleep ticks after wake-up, so it’s best not to repurpose SYSRTC when tickless mode is active.