Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamrtc real time clock
A Real-Time Clock (RTC) is a tiny, ultra-low-power IC that keeps calendar time with typical accuracy from ±20 ppm to ±2 ppm (≈1 min/month down to ≈1 min/year) thanks to a 32.768 kHz crystal and a coin-cell backup so the count survives even when the main system is completely un-powered [1][2].
Time-base
• Crystal: 32 768 Hz (2¹⁵ Hz), allowing a simple 15-stage binary divider to obtain 1 Hz [1].
• TCXO variants (e.g., DS3231) measure on-chip temperature every 64 s and digitally trim the oscillator, reaching ±2 ppm from –40 °C to +85 °C [2].
Functional blocks
Block | Role | Typical current (backup) | Design tips |
---|---|---|---|
Oscillator + divider | Generates 1 Hz tick | 150–1000 nA | Keep crystal traces ≤ 5 mm, no ground flood under them |
Clock/calendar registers | BCD or binary | – | Verify leap-year bit |
Interface | I²C (100/400 kHz) or SPI | – | Pull-ups 2.2–10 kΩ for I²C |
Switchover | Main VCC → VBAT | < 200 nA leakage | Use Schottky diode only if IC lacks automatic mux |
Alarms / SQW | Wake MCU or provide clocks | 1–32 768 Hz | Connect to MCU interrupt to save polling |
• “Embedded TCXO-RTCs like the DS3231 have made single-digit-seconds-per-month accuracy affordable for mass-market IoT nodes” — Maxim Integrated application brief, 2023 [2].
• The RTC market is projected to reach USD 3.1 billion by 2028, CAGR ≈ 4.5 % [5].
• Secure RTCs (with SHA-256 engines) are gaining traction in metering and automotive to prevent clock tampering (e.g., NXP PCF2129AT) [3].
Hardware
a. Place crystal within 2–3 mm of the XIN/XOUT pins; keep guard ring tied to ground.
b. Match PCB stray C so that C_L = (C1·C2)/(C1 + C2) ≈ 12.5 pF (check crystal datasheet).
c. Add 0.1 µF + 10 nF decoupling close to VCC and VBAT pins.
Firmware
a. After VCC brown-out read Oscillator-Stop-Flag; if set, re-initialise clock.
b. Use burst-read to guarantee coherent time (some RTCs freeze registers on I²C address 0x3F read).
c. Periodically temperature-calibrate non-TCXO RTCs: write ±ppm trim register every 10–20 °C.
Power budgeting
Coin cell lifetime ≈ (2 mAh)/I_BAT.
Example: I_BAT = 300 nA → >7 years before reaching 1 mAh use.
• In fiscal metering or tachographs, deliberate clock tampering is fraud; many jurisdictions (e.g., EU MID directive) require tamper-evident RTCs.
• Dispose of lithium coin cells according to local e-waste regulations to avoid soil contamination.
• MEMS-based RTC resonators promise ±1 ppm over –55 °C…125 °C without crystals; long-term aging data (>10 years) remain scarce.
• Combining RTCs with energy-harvesting PMICs for “battery-less” designs is an active field.
Sources
[1] “Real-time clock”, Wikipedia, rev. 25 Jun 2024.
[2] Maxim Integrated, “DS3231 Extremely Accurate I²C-Integrated RTC”, Datasheet Rev 3, 2021.
[3] NXP, “PCF2129AT – Secure real-time clock/calendar with tamper detection”, Datasheet, 2022.
[4] Texas Instruments, App Note AN120: “Impact of Crystal Load Capacitance on RTC Frequency”, 2020.
[5] MarketsandMarkets, “Real-Time Clock Market – Global Forecast to 2028”, Oct 2023.