Software


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:
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:
CommandProcedureInstructions
0Set Current TimeSet Hour value. Toggle LMS. Set Minute Value. Toggle LMS. Verify Time. Toggle LMS
1Set Alarm TimeSet Alarm Hour value. Toggle LMS. Set Alarm Minute Value. Toggle LMS. Verify Alarm Time. Toggle LMS
2Toggle Alarm On/Off StatusAlarm state is toggled and alarm time is displayed. Reset LMS to return to current time.
3Set Current DateSet Month value. Toggle LMS. Set Day Value. Toggle LMS. Verify Date. Toggle LMS
4Display the Current DateCurrent Date is displayed until LMS is reset.

Copyright David Coss 2014
RSS AvailableAdd to Google