3-button AT89C2051 clock kits.

I wanted some simpler-to-use firmware for these kits. I’m not bothered about having timers, alarms, countdowns, etc. The features I did want were:

  • Easy and intuitive method of setting the time, accurate to the second.
  • Ability to dim the display (less dazzle at nighttime, and also lower power draw when running from batteries).
  • Twelve-hour or twenty-four-hour clock mode.

I achieved these aims, as follows:

  • Load different firmware to swap between 12-hour and 24-hour modes.
  • The left-hand button (nearest the hour display) always advances the hour by one, without affecting minutes or seconds.
  • The middle-button (nearest the minute display) always advances the minute by one, and zeros the seconds. To set the time, accurate to the second, you can hold the button down, and release it when your reference clock reaches zero seconds.
  • The remaining, right-hand, button has the dual function of changing the brightness setting (four available brightness levels are cycled through) and (by holding the button down for a second) changing the way the separator colons work: always on, always off, or flashing once for each second.

Here’s the firmware (hex files) to load to the AT89C2051:

12-hour version: clock12h.ihx

24-hour version: clock24h.ihx

And the source code:

12-hour version: clock12h.c

24-hour version: clock24h.c

Original (as supplied in kit) firmware: kitAsSupplied.hex






Leave a Reply

Your email address will not be published. Required fields are marked *