RTC (Real-Time Clock): 32.768 kHz Timebase, Alarms & Timestamps
← Back to:Reference Oscillators & Timing
RTC is a low-power 32.768 kHz timebase + calendar/alarms/timestamp block that must be budgeted, validated, and kept leak-free to stay accurate for years. This page turns “RTC accuracy and battery life” into a repeatable engineering workflow: design → bring-up → production calibration → field monitoring.
What an RTC is — and what it is not (Scope & boundary)
An RTC (Real-Time Clock) is a low-frequency timebase (typically 32.768 kHz) plus calendar/alarms and timestamp capture. Engineering success is judged by four outcomes: accuracy (seconds/day), power (VBAT-domain current), reliability (start/hold behavior across temperature and contamination), and verifiability (tests that prove those claims on real boards).
- Seconds tick (1 Hz) and steady timekeeping cadence
- Calendar time (Y/M/D/h/m/s) for logs and schedules
- Alarm interrupt (wake/schedule) with status flags
- Timestamp register (event time capture) for traceability
- “Is an RTC needed?” Decide by: power-loss time retention, alarm wake requirements, and timestamp evidence needs.
- “MCU has an RTC but it is not accurate.” Treat accuracy as a budget: timebase tolerance + temperature drift + aging + board parasitics + calibration residual.
- “Need calendar/alarms/timestamps.” Focus on atomic read/write, flag behavior, and capture timing—not just register names.
This page does not expand into backup-power switchover hardware, tamper/signed-time security, or TCXO disciplining loops. Use the dedicated sibling pages for those topics: RTC Backup & Switchover, Secure RTC / Time-Stamping, TCXO-Based RTC.
RTC architecture in one page (Block-level mental model)
A robust RTC is best treated as a chain of deterministic blocks. Each block has a small set of knobs (design/configuration choices) and a small set of observable symptoms (test points). This mental model prevents common failure patterns: “it runs in the lab but fails after assembly”, “it keeps time but misses alarms”, and “VBAT current does not match datasheet”.
Timebase (32 kHz) → Prescaler → Seconds counter → Calendar (Y/M/D/h/m/s). Accuracy errors originate upstream (timebase + load + temperature + aging), while calendar correctness errors are usually firmware sequencing and atomicity issues.
- Knobs: crystal/XO choice, load strategy, drive/enable modes
- Symptoms: start/stop across temperature, fixed ppm offset, sensitivity to contamination
- Knobs: 1 Hz tick routing, update/hold bits (if present)
- Symptoms: off-by-one reads, jumps after time set, inconsistent “seconds tick” behavior
- Knobs: mask/compare fields, one-shot vs periodic
- Symptoms: missing alarms, double-fires, IRQ stuck due to flag semantics
- Knobs: trigger source, latch/clear sequence
- Symptoms: one-second ambiguity, race with reads, event-to-register latency assumptions
- Knobs: ppm trim step, update timing, storage of calibration metadata
- Symptoms: fixed offset remains, temperature-dependent residual, field drift beyond expectations
- Knobs: retention scope, interface availability on VBAT
- Symptoms: unexpected VBAT current, loss of registers, flags that reset on VCC loss
- Timebase: confirm 32 kHz presence and stable frequency without probe loading artifacts
- Accuracy: convert ppm to seconds/day and log across temperature points
- VBAT current: measure by mode (osc on/off, interface retention on/off, CLKOUT on/off)
- Alarm & timestamp: validate flag semantics, interrupt behavior, and atomic read sequence
Timebase options at 32.768 kHz (Crystal vs XO vs internal RC)
Timekeeping accuracy becomes intuitive when expressed as seconds per day. A useful rule of thumb is 1 ppm ≈ 0.0864 s/day. Timebase selection is therefore a trade among accuracy (initial + temperature + aging + parasitics), VBAT current, and bring-up/manufacturing risk.
- Crystal (32.768 kHz): lowest power and lowest BOM cost, but most sensitive to start margin (ESR), board parasitics (CL error), and contamination/leakage.
- XO / integrated oscillator: fastest bring-up and stable start behavior; typically higher cost and VBAT current. Accuracy is product-dependent (initial tolerance, temperature drift, aging).
- Internal RC (if available): suitable for “time sense” (relative timing / coarse wake windows), not for “true clock” (calendar-grade time, compliance logging, or long holdover). Expect large temperature and voltage dependence.
- Accuracy target: define an allowed s/day error over the required temperature range.
- VBAT budget: decide whether the backup domain must stay in the low-µA class or can tolerate higher steady current.
- Manufacturing environment: contamination risk, long routing, connectors, or humidity push the design toward solutions with lower board sensitivity.
This section does not expand into phase-noise/jitter budgeting (high-speed clocking), disciplining loops (GNSS/network), or backup switchover hardware. Those topics belong to their dedicated pages.
32.768 kHz crystal basics that actually bite (CL/ESR/drive/parasitics)
A 32 kHz crystal node is high-impedance and easily disturbed by board parasitics, leakage, and probe loading. “Correct part number” is not sufficient; robust timekeeping requires controlling CL accuracy, start margin vs ESR, and drive level while preventing contamination-driven leakage paths.
The crystal’s specified load capacitance (CL) is the effective capacitance seen by the resonator. External capacitors and board parasitics both contribute. A practical approximation is:
- High ESR reduces start margin; cold temperature and contamination often push a marginal design into no-start.
- Qualification should include temperature corners and “dirty board” sensitivity, not only room-temperature startup.
- Prefer designs with clear oscillator-fail indicators (flags or CLKOUT) to simplify bring-up and production screening.
- Excessive drive level can accelerate aging and increase long-term drift.
- Keep the design within the crystal’s recommended drive range; avoid “extra margin” strategies that raise excitation unnecessarily.
- Long-term accuracy must consider aging rate and the calibration residual that remains after trimming.
- No oscillation: ESR limit, leakage/contamination, cold-corner start margin.
- Fixed fast/slow time: CL mismatch, Cstray underestimation, capacitor asymmetry.
- Temperature-sensitive failures: ESR vs temperature, mechanical stress, layout asymmetry.
- Drift grows over months: over-drive, aging rate, unstable calibration metadata.
Oscillator circuit & layout for 32k (Placement, guarding, leakage)
The 32.768 kHz oscillator pins form a high-impedance, low-signal analog node. Robust start and stable accuracy depend more on placement, symmetry, guarding, and cleanliness than on the crystal part number alone. This section focuses only on the micro-sensitivity of the RTC 32k node (not system-wide EMI topics).
- Keep the crystal close to the OSC pins (short, direct, minimal vias).
- Route symmetrically: similar length, geometry, and ground environment on both pins.
- Stay away from fast edges: DC/DC SW nodes, gate drives, PWM, high-speed IO.
- Avoid human-touch zones: connectors, buttons, exposed edges (contamination/leakage risk).
- Guard ring (GND) around the crystal and both traces reduces field coupling and gives leakage a preferred return.
- Use continuous ground beneath the 32k region (no splits, no slots under the oscillator).
- Do not cross a GND gap with OSC traces; the parasitic environment changes abruptly and reduces margin.
- Keep heavy return currents away from the oscillator corner (avoid narrow “choke” ground paths).
Flux residue, humidity, fingerprints, and dust can create microamp-to-nanoamp leakage paths that collapse start margin and pull frequency. The 32k node is especially vulnerable due to its high impedance.
- Define a cleaning step in the build flow (clean → dry → store dry).
- A/B verification: compare start success and seconds/day before vs after cleaning (or dry vs humid exposure).
- If sensitivity is high, consider local protection (keep-out, coating strategy) without changing the oscillator physics.
- Match C1 and C2 (same value, tolerance, dielectric, and package) to minimize asymmetry.
- Do not rely on typical CL; account for parasitics and capacitor tolerance in the accuracy budget.
- Prefer deterministic tuning (estimate parasitics → choose C → measure seconds/day → adjust) rather than “swap until it works”.
- Start: cold start + warm start + humidity/handling sensitivity checks.
- Accuracy: evaluate in seconds/day using a low-intrusion output (e.g., 1 Hz/CLKOUT if available).
- VBAT current: measure by mode (osc on/off, retention on/off, clkout on/off).
- Reproducibility: check across multiple boards and multiple assemblies (not one “golden” sample).
This section intentionally stays at the RTC 32k node level. It does not expand into full-system EMI compliance, backup-power switchover circuits, or disciplining loops.
Accuracy budget: ppm today, drift tomorrow (Temp, aging, initial tolerance)
RTC accuracy should be budgeted and verified in seconds per day, not as a single “ppm” slogan. A practical conversion is 1 ppm ≈ 0.0864 s/day. Total error comes from multiple sources (initial tolerance, temperature drift, aging, and board loading), and any calibration leaves a residual that must be tracked.
- Initial tolerance (@25°C): the baseline offset at room temperature.
- Temperature drift: the full-range curve behavior across the required temperature envelope.
- Aging (ppm/year): slow drift over months/years, often becoming visible in long holdover use cases.
- Load/parasitics: CL mismatch, asymmetry, and contamination-induced leakage pulling the oscillator.
- Calibration residual: what remains after trimming (and what must be verified, not assumed).
- Worst-case thinking: budgets should use corner behavior and guardband, not only typical numbers.
- Dominant term first: identify which bucket dominates before optimizing smaller contributors.
- Short vs long horizon: daily error is often initial+temp; multi-year error must include aging and contamination sensitivity.
Calibration is no longer optional when the combined initial + temperature buckets consume most of the allowed seconds/day budget, or when the product requires stable performance across wide temperature, humidity, and lifetime conditions.
- Tight target: the allowed seconds/day leaves little room for drift and parasitics.
- Wide environment: outdoor temperature swings, condensation risk, or large handling variability.
- Long life: multi-year accuracy expectations where aging becomes a measurable term.
- Initial: measure seconds/day at room temperature against a trusted reference.
- Temperature: measure at multiple stabilized points (soak) across the specified range.
- Aging: trend the drift over time and preserve calibration metadata in a reproducible way.
- Parasitics: compare clean vs contaminated handling and across board lots.
- Residual: record before/after calibration and confirm the remaining error stays inside the target.
This section stays within RTC timekeeping accuracy. It does not expand into high-speed clock jitter/phase-noise topics or GNSS/PTP disciplining loops.
Calibration & compensation (Digital trim, temperature strategy, field flow)
RTC calibration improves timekeeping by correcting repeatable frequency error (ppm or seconds/day). A stable workflow is a closed loop: measure → compute → write → verify → store → monitor. It should not chase non-repeatable board leakage or contamination effects.
- Coarse / fine trim: pull large offset back into range, then converge residual with smaller steps.
- Add / sub tick: insert or delete ticks periodically to correct long-term average rate.
- PPM trim register: program an offset in ppm-equivalent units (best for versioned workflows).
- Factory one-time: controlled environment, stable reference, narrow temperature exposure, predictable assembly.
- Field periodic: wide temperature, long lifetime, holdover use, or measurable drift over time.
- Trigger definition: time-based, ΔT-based, drift-threshold-based, or post-event (battery swap, long power-off).
Store calibration as metadata + applied trim with a recoverable history. Prefer formats that support validation and rollback (CRC + version).
- Before/after delta: same measurement window, same reference, measurable improvement in seconds/day.
- Temperature coverage: validate at representative temperature points, not only one point.
- Residual tracking: record residual after trim; monitor slope/step changes as drift signals.
- Reproducibility: repeat the loop and confirm the result is stable (no random “flip”).
- Limit degrees of freedom: avoid complex curves when noise/parasitics dominate.
- Separate compute vs verify: validate using different temperature points or time windows.
- Respect the residual floor: stop trimming below the practical limit set by measurement + parasitic variability.
- If trim distribution explodes: investigate layout/cleanliness/leakage before adding algorithm complexity.
This section covers RTC-local calibration loops only. GNSS/PTP disciplining belongs to timing/synchronization pages.
Power, backup domain, and leakage (What kills battery life)
Backup current on VBAT is not a single number. It is the sum of RTC core, oscillator, retention / interface paths, and board leakage (often the dominant risk). Diagnosis must isolate variables in a controlled order.
- RTC core: calendar counters and timekeeping logic.
- Oscillator: 32k resonator or XO sustaining current.
- Retention / I²C / INT: any kept-alive registers, pull paths, wake logic.
- Board leakage: ESD parts, contamination, humidity films, fixtures, pullups, and back-power paths.
- Start with the RTC alone: VBAT only, main rails off, disconnect optional externals.
- Disable optional paths: CLKOUT, interface keep-alive, external pullups, unused interrupts.
- Add back stepwise: reconnect one path at a time and log the delta current.
- Check cleanliness: clean/dry vs humid/handled comparison to expose contamination leakage.
- Check temperature sensitivity: strong temperature slope often points to leakage components.
- Large drop after removing pullups/IO: external paths dominate.
- High sensitivity to humidity/cleaning: contamination leakage dominates.
- Still high with everything disconnected: revisit RTC mode config and back-power paths.
- Repeatable current: consistent across multiple boards and repeated measurements.
- Mode-defined: current matches the documented feature set enabled on VBAT.
- Stable after cleaning/drying: no order-of-magnitude swings under controlled handling.
This section focuses on backup-domain current and leakage diagnosis. Backup switchover (coin-cell/supercap) belongs to a dedicated page.
Calendar, alarms, and timestamping (Behavior, edge cases, firmware hooks)
RTC functional correctness depends on deterministic calendar rollover, alarm compare semantics, and timestamp capture integrity. Time zone and daylight-saving adjustments are typically handled by the system layer; RTC should provide a stable local time base and predictable event hooks.
- Leap-year / month-end / year-end: verify rollover behavior and invalid-value handling.
- Atomic read: prefer latch/shadow registers, or re-read until consistent to avoid mid-tick field mismatch.
- Safe set sequence: freeze updates (if supported), write fields in a defined order, then release and read-back.
- Time zone / DST: treat as system policy; do not embed into RTC counting logic unless explicitly required.
- One-shot vs periodic: periodic alarms are typically implemented via field masks (granularity defines behavior).
- Mask granularity: compare-to-second vs compare-to-minute changes trigger windows and jitter sensitivity.
- Flag & interrupt: confirm set/clear semantics (write-1-to-clear vs read-to-clear) and level vs edge interrupts.
- Wake latency: alarm time is not MCU execution time; define acceptance using a system-specific latency budget.
- Triggers: external pin, internal event, interrupt line, or scheduled capture (implementation-dependent).
- Latch point: capture seconds-counter or full calendar fields; multi-byte reads require consistency handling.
- Overrun risk: single-deep latches can be overwritten by back-to-back events; define an overrun policy.
- Read/clear order: read status → read timestamp → clear flag to avoid missing or mis-associating events.
This section focuses on RTC counting, alarms, and timestamp capture integrity. System time services (time zone/DST policies) belong to the software layer.
Validation & measurement traps (How to prove your RTC is good)
RTC validation must separate accuracy, power, and robustness. The most common failure mode is proving the wrong thing due to measurement loading, incomplete mode definitions, or mixing short-term and long-term drift concepts.
- Probe capacitance: measuring at the crystal pins can shift frequency or stop oscillation.
- Instrument input impedance: frequency counters and long ground leads can inject coupling and bias.
- Preferred nodes: measure buffered outputs (1 Hz / CLKOUT) when available, not high-impedance resonator pins.
- A/B proof: compare “probe connected” vs “no probe” as a quick loading detector.
- Bench (minutes-hours): quantify initial offset and repeatability in a stable environment.
- Temperature: measure after soak/stabilization at representative points; avoid transient ramps.
- Aging (days-months): log long-term trend with consistent reference and event annotations (calibration, power loss).
- Define mode: oscillator on/off, retention/interface enabled, pullups present, CLKOUT enabled.
- Separate domains: measure VBAT domain alone first, then add external paths one-by-one.
- Event peaks: alarm/timestamp interrupts may create short peaks; capture and include in life estimates.
- Accuracy spot-check: quick 1 Hz / CLKOUT rate check within a defined window.
- Alarm self-test: configure → trigger → verify interrupt/flag clear semantics.
- Timestamp self-test: inject event → read status/TS → clear flag → verify no mis-order.
- VBAT mode current: sample by mode definition; flag outliers for leakage investigation.
- Accuracy: bench + temperature points meet the budget, and long-term trend is logged and explainable.
- Power: VBAT current is repeatable by mode; event peaks are measured and accounted for.
- Function: alarm and timestamp behave deterministically under defined concurrency and clear rules.
- Robustness: cleanliness/handling/fixture variables are controlled and quantified.
This section focuses on RTC validation and measurement pitfalls. Full system battery modeling and switchover circuits belong to dedicated power pages.
Engineering checklist (Bring-up → production → field)
This checklist compresses the RTC work into stage gates. Every line is written as Action → Evidence → Pass criteria, so design reviews, lab bring-up, production SOP, and field logs stay aligned without expanding into unrelated system topics.
How to use this checklist
- Keep the stage order: schematic → layout → bring-up → production → field. Skipping stages usually hides leakage, loading, or flag semantics issues.
- For any failure, log conditions (temperature, supply state, firmware version, probe/fixture used) before changing variables.
- Stay within RTC scope: 32.768 kHz timebase, calendar/alarms/timestamp behavior, backup-domain current, and verifiable diagnostics.
1) Schematic review (before PCB)
- Action: Confirm the intended topology (internal load caps vs external CL, series R if recommended).
- Evidence: CL target and board parasitic budget written in design notes.
- Pass: Crystal CL/ESR/drive limits are compatible with the oscillator spec and intended temperature range.
- Action: Draw a “VCC-off, VBAT-on” pin-state matrix (I²C, INT, CLKOUT, GPIO).
- Evidence: Schematic notes show which nets may back-power or pull current from VBAT.
- Pass: No unintended pull-ups/ESD devices/IO states create a VBAT drain or reverse-bias path.
- Action: Ensure oscillator-fail / missing-tick / alarm / timestamp flags are readable and logged.
- Evidence: Firmware interface spec defines flag read order and clear semantics.
- Pass: The design can prove “oscillator running” and “timestamp captured” without probing high-impedance crystal pins.
2) Layout review (placement, symmetry, guarding, cleanliness)
- Action: Place the 32 kHz crystal next to the pins; same layer preferred; minimize vias.
- Evidence: Layout screenshot annotated with crystal-to-pin distance and via count.
- Pass: The crystal nets are short, symmetric, and avoid split planes and high dv/dt aggressors.
- Action: Add a ground guard/keepout strategy around high-impedance nodes (where appropriate).
- Evidence: Guard ring/keepout is explicitly shown in the layout review checklist.
- Pass: No test pads or long stubs are attached to crystal pins; any measurement uses buffered outputs.
- Action: Define cleanliness/flux-residue controls for the crystal area and backup domain.
- Evidence: Manufacturing notes specify cleaning, handling, and humidity constraints for sensitive nodes.
- Pass: The design has a documented plan to prevent leakage from residue, moisture, and handling.
3) Bring-up (prove it runs, then prove it behaves)
- Action: Confirm oscillator start using buffered outputs (1 Hz / CLKOUT / status flags), not direct crystal probing.
- Evidence: Startup time and “stable-running” condition recorded at room temperature.
- Pass: Startup is repeatable and flags show “running” after each power cycle.
- Action: Run minimal alarm and timestamp use-cases (single event + back-to-back event).
- Evidence: Logs show correct flag set/clear semantics and no lost/duplicated timestamps.
- Pass: Alarm IRQ and timestamp registers behave deterministically across reboots and sleep/wake cycles.
4) Production (calibration + records + fast screen)
- Action: Measure offset → compute trim → write trim register → verify → lock/store metadata.
- Evidence: “Before/after” error logged using a consistent measurement window.
- Pass: Post-cal error meets the product target (define as s/day or ppm in your requirement).
- Temperature (and soak status if applicable)
- Trim value + algorithm version
- Firmware version + timestamp of calibration
- Pass/fail signature + operator/fixture ID
- 1 Hz / CLKOUT spot-check (no high-Z probing)
- Alarm trigger + flag clear check
- Timestamp capture + overrun behavior check
- VBAT current spot-check by mode (define mode list)
5) Field (monitor drift, trigger re-cal, raise alarms)
- Action: Trend RTC offset versus a known reference (short snapshots + long-term logs).
- Evidence: Drift history stores temperature, power state, last trim, and firmware version.
- Pass: Offset stays inside the allowed envelope; exceeding it triggers a controlled re-cal strategy.
- Action: Log and act on diagnostics (osc fail / missing tick / alarm stuck / timestamp overrun).
- Evidence: Field logs include raw flags + clear sequence results.
- Pass: Faults are distinguishable (silicon vs board leakage vs firmware misuse) without lab-only instruments.
Applications & IC selection notes (RTC-only)
Selection should start from the task: required time error (s/day), whether calibration is needed, timestamp/alarm behavior, and the VBAT current budget by mode. Avoid turning RTC selection into a product list—use the template below to compare on evidence.
A) RTC-driven application groups (constraints that matter)
- Goal: Preserve wall-clock time and event ordering across power loss.
- Key constraints: Timestamp flag semantics, overrun behavior, and audit-friendly logs.
- Minimal validation: Power-cycle loop + timestamp bursts + flag read/clear sequence.
- Goal: Multi-year battery life with reliable alarm wake.
- Key constraints: Mode-by-mode VBAT current and board leakage dominance.
- Minimal validation: VBAT current breakdown (core/osc/IO pulls/leakage) + alarm latency checks.
- Goal: Predictable long-term drift with a repeatable calibration story.
- Key constraints: Temperature sweep coverage, aging logs, and re-cal trigger criteria.
- Minimal validation: Temperature soak points + before/after trim + trend logging.
- Goal: Cheap “time sense” where large error is acceptable.
- Key constraints: Document the allowed error as s/day and enforce it in testing.
- Minimal validation: Define and verify acceptable drift across temperature and supply states.
B) Selection field template (use cards instead of wide tables)
Fill these fields for every candidate. A candidate should be rejected quickly if any “Quick reject rule” fails.
Why: Determines bring-up risk and board sensitivity.
Quick reject: Timebase option does not match VBAT/current constraints or manufacturing capability.
Why: Board leakage often dominates; mode definitions prevent false conclusions.
Quick reject: Cannot measure or specify VBAT current per mode consistently.
Why: Determines whether production/field calibration can reach the target s/day.
Quick reject: No usable trim path while the product requires tight drift control.
Why: Many “RTC bugs” are really flag/ordering mistakes.
Quick reject: No clear way to avoid race conditions or prove capture correctness.
Why: Enables reproducible lab tests and field audit without invasive probing.
Quick reject: No diagnostics to distinguish silicon vs board leakage vs firmware misuse.
C) Concrete reference part numbers (starting points only)
The following MPNs are provided to speed up datasheet lookup and lab comparison. Always verify package/suffix, voltage range, backup-domain behavior, and availability for your region and temperature grade.
- NXP PCF85063AT/AY (PCF85063A family; I²C RTC + offset trim)
- NXP PCF8563T/5,518 (widely used legacy RTC; check “new designs” guidance)
- Microchip MCP7940N-I/SN (SOIC-8) / MCP7940N-I/MS (MSOP-8)
- Texas Instruments BQ32000D (SOIC-8) / BQ32000DR (packaging variant)
- Micro Crystal RV-3028-C7-32.768kHz-1ppm-TA-QC (ultra-low power class module)
- Micro Crystal RV-8803-C7-32.768k-3PPM-TA-QA (high-accuracy module class; verify QA/QC suffix)
- Epson RX8900CE:UA0 (I²C RTC module family; verify suffix like :UA0/:UB6)
- Analog Devices / Maxim DS3231SN# (integrated TCXO + crystal; low BOM, accuracy-focused)
- Epson FC-135 32.7680KA-A (SMD family; check CL option e.g., 12.5 pF / 9 pF)
- Abracon ABS07-32.768KHZ-1-T (12.5 pF variant family)
- Micro Crystal CM7V-T1A-32.768KHZ-12.5PF-20PPM-TB-QA (example suffix; verify CL/grade)
- NDK MU00530-32.768K (7 pF example; verify CL/ESR and footprint fit)
- Match CL to the oscillator design target after subtracting board parasitics.
- Keep ESR inside the oscillator’s startup capability across temperature.
- Respect drive level to prevent accelerated aging or field failures.
- Prefer buffered outputs (1 Hz/CLKOUT) for validation; avoid loading crystal pins.
Recommended topics you might also need
Request a Quote
FAQs (RTC troubleshooting — actionable, scope-limited)
Each answer is intentionally short and executable: Likely cause → Quick check → Fix → Pass criteria. Scope stays within RTC (32.768 kHz timebase, calendar/alarms/timestamp behavior, backup-domain current, and verifiable diagnostics).
Crystal is populated but RTC never starts—what’s the first ESR/CL check?
Quick check: Avoid probing crystal pins; verify “osc running” using 1 Hz/CLKOUT or an oscillator-fail flag (OSF/OF/XTALFAIL or equivalent). Confirm the crystal CL rating matches the design target (after subtracting estimated parasitics).
Fix: Use a crystal with lower ESR (same CL), remove/shorten any stubs/test pads, and correct external CL values (or select “internal-cap” mode consistently). Clean the crystal area if leakage is suspected.
Pass criteria: Oscillator starts reliably across ≥10 cold power cycles; oscillator-fail flag stays clear; 1 Hz/CLKOUT is stable without touching the crystal pins.
Time is consistently fast/slow by a fixed amount—how to confirm CL mismatch vs trim setting?
Quick check: Read and log trim-related registers (coarse/fine ppm trim or add/sub tick control) and confirm they match the expected configuration. Compare the observed time error against a stable reference over a fixed window (e.g., 1–4 hours).
Fix: Reset trim to a known baseline, re-measure, then re-apply calibration intentionally. If the offset remains near-constant, adjust CL strategy (external caps or crystal CL selection) with parasitic budgeting.
Pass criteria: After baseline reset + re-cal, time error matches the target envelope (expressed as s/day or ppm) and is repeatable across reboots.
Drift changes a lot with temperature—what data should be logged first (temp points, ppm, mode)?
Quick check: Log (1) temperature at the crystal/RTC location, (2) power state (VCC vs VBAT, CLKOUT on/off), (3) time error as ppm or s/day at ≥3 soak points (cold/room/hot), using the same measurement window.
Fix: Stabilize measurement (soak + consistent window), then apply a temperature-aware trim strategy only if required. Reduce thermal gradients by placement/keepout and avoid heat sources near the 32k network.
Pass criteria: Drift vs temperature becomes explainable and repeatable; residual error after compensation stays within the product envelope at the defined temperature points.
VBAT current is 10× higher than datasheet—what’s the quickest leakage isolation sequence?
Quick check: Isolate in this order: (1) remove external pullups to any always-on nets, (2) force GPIO/INT/CLKOUT pins to a known “no-drain” state, (3) disconnect external devices on the bus, (4) then compare “RTC-only” VBAT current.
Fix: Re-route pullups to the correct domain, add domain isolation (series resistors or FET isolation where appropriate), and enforce cleaning/handling controls around the crystal + backup domain.
Pass criteria: VBAT current returns to within a justified factor of datasheet (after including enabled blocks like CLKOUT) and scales predictably when each external path is re-enabled.
Alarm sometimes misses or fires twice—what register/flag race should be checked?
Quick check: Log the exact sequence around alarm setup: write alarm registers → clear alarm flag → enable alarm/IRQ → verify status. Confirm whether the IRQ is edge vs level and whether the alarm flag must be cleared before re-arming.
Fix: Enforce a single canonical sequence (clear flags before enabling, and clear flags immediately after handling). If supported, use “latch” or “one-shot” interrupt mode to avoid repeated firing.
Pass criteria: Over ≥100 cycles, the alarm triggers exactly once per scheduled event with no misses; flags and IRQ behavior match the defined state machine.
Timestamp captures look “off by one second”—what latch/atomic-read sequence is wrong?
Quick check: Use one I²C burst read (or a documented latch/freeze mechanism) for the entire timestamp/time tuple. Log: event edge time, TS flag set time, and the exact register read order.
Fix: Adopt a stable sequence: read STATUS/TS flag → burst read TS registers (and time if needed) → then clear TS flag. Avoid multi-transaction reads around the seconds rollover.
Pass criteria: With repeated event tests (including events near rollover), the timestamp ordering is consistent and the “±1 s” anomaly disappears.
RTC is accurate at room temp but bad after reflow—what contamination/cleaning sign points to leakage?
Quick check: Compare VBAT current and frequency/time error before vs after cleaning. Inspect the crystal area (visual/microscope) and look for residue paths between the crystal pins, caps, and ground guard.
Fix: Enforce cleaning process, keep crystal nets short with guard/keepout, and avoid exposed test pads on crystal pins. If behavior persists, swap the crystal and re-validate.
Pass criteria: After cleaning (and/or crystal replacement), VBAT current and drift return to the pre-reflow baseline and remain stable over humidity exposure tests.
Oscillator works on bench but fails in enclosure—what thermal gradient placement issue is typical?
Quick check: Measure local temperature near the crystal/RTC in the enclosure and compare to the bench. Correlate “fail-to-start” or drift with temperature and airflow conditions (fan on/off, lid open/closed).
Fix: Move the crystal/RTC away from hotspots, add thermal shielding/keepout, and ensure the oscillator network is not routed through heat gradients.
Pass criteria: Across enclosure conditions (worst-case airflow and temperature), oscillator start is repeatable and drift remains within the defined envelope.
After firmware time set, it jumps back—what write order/hold bit is commonly missed?
Quick check: Log the exact write sequence (register order + whether a hold/stop bit is used). Immediately read back all time registers in one burst read and confirm the oscillator-stop flag and status bits are cleared per datasheet.
Fix: Use the documented set-time procedure: enter hold/freeze (if available) → write time registers in required order → exit hold/freeze → clear relevant status flags → verify with a burst read.
Pass criteria: After setting time, repeated reads over multiple seconds show monotonic time progression and no reversion after sleep/wake or power transitions.
Production calibration looks great, but field drift grows—how to distinguish aging vs temp model error?
Quick check: In the field log, record (1) temperature, (2) mode (VCC/VBAT/CLKOUT), (3) current trim value + version, and (4) observed time error at periodic intervals. Plot error vs temperature and error vs time.
Fix: If temperature-correlated, refine temp-point coverage or compensation mapping; if time-correlated, schedule periodic re-cal or widen guardbands to account for aging.
Pass criteria: Error is decomposed into a predictable component (temp) and a slow component (aging), and re-cal triggers keep the total error within the product envelope.
32k output looks distorted—how to tell loading/probing artifact vs real oscillation issue?
Quick check: Do not probe crystal pins directly. Use CLKOUT/1 Hz output, or measure through a high-impedance active probe/buffer point if provided. Compare “probe on” vs “probe off” behavior.
Fix: Move validation to buffered outputs; if the oscillator is marginal, reduce parasitics, remove stubs, improve guarding/cleanliness, or select a crystal with appropriate ESR/CL.
Pass criteria: “Probe-on” does not change oscillator start/stop behavior; buffered outputs remain stable and frequency/time error matches expectations.
Why does enabling CLKOUT increase VBAT current—what block did I wake up?
Quick check: Measure VBAT current with CLKOUT off vs on, and log the exact control bits (CLKOUT enable + frequency select + output drive). Confirm whether CLKOUT is sourced from backup-domain power.
Fix: Keep CLKOUT disabled in backup mode (enable only under VCC), reduce CLKOUT frequency/drive if supported, or use 1 Hz only during lab validation.
Pass criteria: The delta current matches the datasheet “CLKOUT enabled” mode, and the product battery-life budget remains satisfied in the intended power state.