The Ultimate Alarm Clock


To test the clock, we ran several tests. First of all, we tested the menu system by just trying every possible combination of keys to step through the menus, making sure the program would accept the correct button presses and reject invalid keypresses. We found a problem with setting the alarm where pushing the set button resulted in the alarm setting itself and unsetting itself quickly. We discovered that the problem was due to some test code accidently left in the program that would change the set status of the alarm after the debounce routine, leading to some erratic behavior.

We also checked to be sure our timebase was accurate. We ran the clock for about 5 minutes, watching the minutes on a separate clock advance as well. Both were synchronized. It would have been nice to run the clock overnight, but we did not have the luxury of being able to leave our circuit set-up and running all night.

The clock was set to the rollover time (2359) and we made sure it reset properly to the morning. Also, when setting the clock, we made sure that the hours not only rolled over going forward, but would work being set in reverse. We started the clock at 0 and rolled backwards to 23, which worked fine. The same incrementing and decrementing worked for the minutes.

Some extensive testing went into the date routines, which are deceptively complex. We set the clock for 1159 of the 31st (or 30th) of several months, to make sure that the months switched accurately. We had some problem with February, which were corrected with some extra programming we had overlooked. The new year was also a problem. Our code was sure to prevent the month from becoming "13", but instead made the month "14". There was a small error in the year rollover which did not properly advance the month.

After making all of these small modifications, we testing a whole range of date switches. We tried February 28th in the years 2000, 2001, 2004, and other leap/non-leap years to make sure it either went to March 1st or February 29th. If it went to the 29th, we made sure it would then go to March 1st.

Webpage created by Joel Avrunin ('01) and Philip Weiss ('00).
Created May 4, 2000. Last updated May 6, 2000.