Design Ideas: July 7, 1994
Some µP-based systems need a real-time clock. The µP's built-in timer can do the work, but it usually requires several milliamps of current to keep the timer running. If the main power drops, the clock requires a backup battery to operate. The size of the backup battery depends mainly on how long the clock must run without main power supply and how much current the µP draws. Usually, during the main power supply's dropping period, the only task the µP should perform is to update the real-time clock.
However, there is an alternative way to run the real-time clock. Most CMOS-based µPs have stop or sleep modes in which the µP consumes only a few microamps of current. Instead of running all the time, the µP goes into stop or sleep mode if it detects a main power drop. Under these conditions, you can use an external interrupt source to awaken the µP and cause it to update the real-time clock and then return to sleep mode. Because the real-time-clock update takes only a short time, the µP still spends most of its time in sleep mode.
Fig 1's circuit provides an interrupt every 0.5 sec. The HA7210 (Harris Semiconductor, Melbourne, FL) low-current crystal oscillator consumes about 4 mA with a 32,768-Hz crystal. The CD4060 14-stage binary counter divides the output signal from the HA7210 down to a 0.5-sec square wave and consumes 7 mA more. You can set the µP to positive- or negative-edge-trigger interrupt mode. If the average µP current is 9 [mu]A, the total current with the interrupt circuit is around 20 mA. (DI #1556)