The clock program (HEX) written in assembly. This program displays values on 2 dual 7-seg displays.
The microcontroller stores 2 times, current time and alarm time, as well as the current month and day. Timer 0 provides
a 1Hz clock pulse, tuned by a variable resistor. Commands, listed below, are given to the microcontroller through PORTB.
When the alarm time is reached and if the alarm is on, the alarm bit on PORTA is set to logic 1; otherwise the bit is
logic 0. When the alarm bit is set, it will remain set until the next minute is reached. When the alarm is on, the left
most decimal in the 7-seg display is on; otherwise the 2nd decimal is on. Hexadecimal and Octal modes are selected by a
switch that changes a bit value on PORTA.
Commands are issued using 8 dipswitches. The left most switch(LMS) acts as a signal to the microcontroller to read the value of the remaining 7 dipswitches. The microcontroller interprets those 7 switches as a binary number, with the left most swtich being the most significant bit and on and off corresponding to 1 and 0, respectively. The following procedures are executed by the microcontroller based on the provided numbers:
|0||Set Current Time||Set Hour value. Toggle LMS. Set Minute Value. Toggle LMS. Verify Time. Toggle LMS|
|1||Set Alarm Time||Set Alarm Hour value. Toggle LMS. Set Alarm Minute Value. Toggle LMS. Verify Alarm Time. Toggle LMS|
|2||Toggle Alarm On/Off Status||Alarm state is toggled and alarm time is displayed. Reset LMS to return to current time.|
|3||Set Current Date||Set Month value. Toggle LMS. Set Day Value. Toggle LMS. Verify Date. Toggle LMS|
|4||Display the Current Date||Current Date is displayed until LMS is reset.|