Why on Earth Don’t You Include a Clock in Your Design?

September 18, 2018

Jim Harrison By: Jim Harrison
Guest Blogger, Lincoln Technology Communications


I don't get it! After we have a power failure at home I have to go to both the stove and the microwave and reset the clocks. Why on earth don’t they have a simple battery-backed, real-time clock (RTC) in them? There are great ones available, they don’t cost much, and they are pretty easy to design in.

They are telling us that stoves and microwaves will soon be connected to the web so that Google and/or Amazon can keep track of our eating habits. Then my oven can get the correct time from the cloud—as another member of the IoT. So, then we won’t have this problem.

Thinking about a different application for such clocks, if you're designing an industrial or transportation system, you will need a very accurate and very stable over temperature RTC. And those are readily available also.

Let's have a quick look at three example RTC chips.

RTC with Nonvolatile Memory

The first one is the DS1338 from Maxim. Maxim considers RTCs to be a "hero" in the world of analog ICs for their ability to strengthen designs with their punctuality and predictability. The DS1338 is a very low-power serial RTC with 56 bytes of nonvolatile SRAM. Data comes out in BCD form via an I2C port. The chip counts seconds, minutes, hours, dates, months, days of the week, and years with leap-year compensation valid up to the year 2100. It needs a 1.7V to 5.5V supply at 200µa maximum (at 3.3V) and 125µa in standby mode.

The few external components needed for a DS1338 RTC design

Figure 1: The few external components needed for a DS1338 RTC design.

The IC uses an external 32.768kHz crystal with 12.5pf capacitance, and that’s about the only external component required, except for the 1.3V to 3.7V backup battery. It comes in a SOIC8 or SOIC8 package. You can also choose the DS1338C version with an integrated crystal in a 32-pin SO package. On the first application of power to the device, the time and date registers are reset to 01/01/00 01 00:00:00 (DD/MM/YY DOW HH:MM:SS). The time and calendar are set or initialized by writing appropriate register bytes.

All versions operate over a -40° to 85°C temperature range. You might use a battery like the easy-to-find ML1220 12.5mm coin-cell 3.0V device. This lithium/manganese dioxide (Li/MnO2) rechargeable battery has a capacity of 15mAh (to 2.0V).

A Super-Accurate RTC Solution

The DS3231M is a cost-efficient, extremely accurate RTC with an I2C interface. It incorporates a MEMS resonator to provide the long-term accuracy and reduce part count and provide ±0.432 second/day accuracy over an operating temperature range of -40° to 85°C. The DS3231M is available in the same 8-pin or 16-pin SO package footprints as the popular DS3231 device.

The DS3231 8-pin SO package

Figure 2: The DS3231 8-pin SO package.

Its I2C serial port yields seconds, minutes, hours, days, dates, months, and years in BCD format. Maximum operating supply current is just 200µa. The chip has a battery-backup input requiring 70µa maximum and just 3.0µa for basic time-keeping. It has two programmable time-of-day alarms and a 1kHz reference output. A reference design kit can be found with the part number DS3231MZEVKIT.

An I²C RTC with a Trickle Charger

The DS1340 clock IC, like the other devices, provides BCD time and date via an I2C serial line. The cost-effective chip uses an external 32.768kHz crystal. Accuracy depends entirely on the crystal. The DS1340C version has an internal crystal with a typical accuracy of ±15ppm. Three versions are available for supply voltages of 1.8V, 3.0V, or 3.3V.

Battery-backup voltage can go as low as 1.3V with proper time-keeping, and the battery can be trickle charged at approximately 1µA. The IC provides a digital clock calibration feature to allow compensation for crystal and temperature variations. The calibration circuit adds or subtracts counts from the oscillator divider chain at the divide-by-256 stage based on five calibration bits in the control register.

A typical DS1340 board layout

Figure 3: A typical DS1340 board layout.

The chip can use a 1.8V, 3V, or 3.3V supply and offers time-keeping voltage down to 1.3V. It has automatic power-fail detect.

Timing is important in so many things. For any appliance or electronic equipment, it’s especially important. It has gotten really easy and really inexpensive to design in a RTC. So why not?