We detect you are using an unsupported browser. For the best experience, please visit the site using Chrome, Firefox, Safari, or Edge. X
Maximize Your Experience: Reap the Personalized Advantages by Completing Your Profile to Its Fullest. Update Here
Stay in the loop with the latest from Microchip. Update your profile while you are at it. Update Here
Complete your profile to access more resources. Update Here

Real-Time Clock (RTCC) FAQs

What Is an RTCC?


Many electronic systems need to be able to tell time. Real Time Clocks (RTCs), also known as Real Time Clock/Calendars (RTCCs), are often the timekeepers for these electronic systems. While a system clock counts ticks to control the internal timing of a digital system, an RTCC tracks time in an hours/minutes/seconds format so the time information is relevant and comprehensible to humans. This makes an RTCC critical in many applications where providing a record of time is essential.

An RTCC works in conjunction with a precision oscillator, normally a crystal, which can be internal or external to the RTCC device. The RTCC counts the oscillations to keep track of the time and date. A communication interface is required to configure the device and set or fetch the time. RTCCs typically also have alarms which can be set to alert the system at specific times and dates.

How Does an RTCC Work?


An RTCC uses 32.768 kHz oscillations to provide a clock to the internal counters as shown in the figure on the right. A 15-bit counter overflows every 32,768 clocks (which is every second), providing a consistent time base. The counter feeds additional counters, which count the seconds, tens of seconds, minutes and so on, up to tens of years. If available, alarms compare the current values of the time counters to the alarm registers. If there is a match, the RTCC will modify a flag bit in an internal register or change the state of an output pin.

How Does the RTCC Begin Oscillation?


As noted above, an RTCC works with an oscillator, which is typically a quartz crystal that is shaped to vibrate at a specific frequency. Most RTCC devices use a 32.768 kHz quartz crystal, which is often referred to as a watch crystal. They also typically use an internal inverting amplifier circuit, as shown in the figure on the right, to resonate the crystal. The amplifier is configured with two feedback paths between its output and input that cause it to resonate or oscillate.

The oscillator circuit is not resonating before the RTCC's amplifier is enabled. When the amplifier is enabled, any thermal or background noise picked up by the oscillator circuit is amplified and causes the system to begin to oscillate. The oscillations quickly grow in amplitude.

The internal resistor (Rf) provides a non-frequency-specific feedback path around the amplifier. This assists in starting oscillations, but it has relatively high impedance. The crystal has much lower impedance at the rated frequency and rapidly dominates over the internal resistor to set the frequency of the oscillations. Capacitors (C1 and C2) ensure stable oscillation. Their values are determined by the crystal used and any other capacitance in the oscillator circuit.

How Does Temperature Affect Timekeeping?


Crystals only resonate at their rated frequency at a specified temperature. This is typically 25°C for 32.768 kHz tuning-fork watch crystals. The crystal will resonate at lower frequencies at other temperatures. This is a highly predictable property of the thermal expansion of quartz. While minor changes in temperature may not be an issue, as temperatures move further away from 25°C, the variance in frequency may cause the RTCC to lose significant amounts of time. Therefore, many RTCC devices offer a digital trimming or analog compensation scheme that can adjust for the frequency error to ensure accurate timekeeping.

When Would You Use an RTCC?


An RTCC can be used any time your system needs to keep a track of time. You could use the counter/timer in a microcontroller, but an RTCC offers some key benefits. It provides battery backup so the time is not lost when the system loses power. A processor can offload time and alarm handling to an RTCC to avoid the periodic software time updates and comparisons required with alarms. The power difference between being in an idle, low-power standby mode and actively executing instructions can be substantial in a processor. Using an RTCC to handle timekeeping and to wake the processor on alarms or other events can lower the overall system power consumption.

What Is Battery Backup?


Without battery backup, an RTCC's recorded time would reset when the system loses power. Battery backup allows the RTCC to switch to an alternate power source when system power is not available. This alternate power source manages the timekeeping counters, oscillator circuitry and alarm circuits, allowing the RTCC to continue to operate during a power loss. To reduce power consumption and enable longer operation, the communications portion of the RTCC is disabled when operating from the alternate power source. Because of their low cost, widespread availability and convenient cell voltage, lithium coin cell batteries are often used as the alternate power source for RTCCs.

Live Chat

Need Help?

Privacy Policy