At89c2051
Kit Modifications
The kit includes a 2-pin header marked «3V» which can be used to provide a battery backup for the clock. If you wish to use a battery backup with your kit, there are some modifications you will need to make. Either do not install, or remove resistors R3 and R4. These are 4.7k pull-up resistors for the two buttons. When 5V power (VCC) is pulled random button presses are read by the MCU. The MCU’s internal pull-ups can be used instead of these resistors and the clock will continue to operate normally when 5V power is pulled from the circuit.
Resistor R6, I believe, is being used to trickle-charge a rechargeable backup battery. If you are using a non-rechargeable battery you may consider not installing/removing this resistor. The current might not be enough to damage a non-rechargeable battery, but it’s worth noting.
Operation
There are two buttons, the left (B1) and right (B2) buttons.
Short B2 presses cycle through displaying the current time in HH:MM and MM:SS format as well as the 12/24-hour display format option. A short B1 press while on the 12/24-hour display format will toggle the setting. A short B2 press will then enter the timer mode. A short B1 press will toggle the start/stop of the timer. A long B2 press will reset the timer. The timer will continue to increment (if running) even when cycling through other modes. Timer currently resets after 60 minutes.
A long B1 press while viewing the current time in HH:MM format will enter the set time mode. The hours section will begin to blink. Short B2 presses will increment the hour by 1. Holding B2 down will cause the clock to increment quickly after 1 second. A short B1 press will then move to the minutes where operation is similar to setting the hour. Another B1 press will exit set time mode and the clock will return to display the current time.
Short B1 presses cycle through setting and enabling the alarm. When viewing the currently set alarm time, the display will blink. This is done to differentiate between viewing the current time and the currently set alarm time. While viewing the alarm time, a long press of B1 will enter the set alarm mode, at which point only the digits being set will blink. Setting the alarm is similar to setting the current time.
A short B1 press while viewing the alarm or exiting out of setting the alarm will enter the enable/disable alarm mode. A short B2 press will toggle this setting. A short B1 press exist to the display current time mode.
While setting the current time or alarm in 12-hour mode, the colon will be off to indicate AM and is on to indicate PM.