Microcontroller provides timer function
Tito Smailagich, ENIC, Belgrade, Yugoslavia -- EDN, 1/4/2001

The circuit in
Figure 1 is a µC-based programmable timer with two output channels. The first channel, activated by pressing the red switch, S
3, has a red LED at its output. This channel is active until it reaches its desired time-out point. The second output channel connects to a green LED and is active after a preselected time-out period. The second channel remains active until the next depression of the red switch. You can deactivate both channels at any time by pressing the green switch, S
1. In normal mode, the display shows the current remainder of the desired time in seconds. The display decrements by 1 until it reaches 0. The timebase in seconds derives from the main oscillator of the µC, which generates a real-time interrupt every 8 msec. The µC multiplies the 8 msec by 125, yielding a timebase of 1 sec. You program the desired time interval by pressing the yellow switch, S
2; the display shows the programmed value. If you need to change the programmed value, pressing the red switch decrements the value by 1 until it reaches 0, after which it starts with 99. If you need to put the timer interval into memory, press the green switch, and the µC writes the value in its internal EEPROM.
Click here to download the software for the MC68HC11E1 µC.