This clock works in 12 hour mode and is configured by programming the microcontroller. The program uses a delay function for producing a delay of 1 second.
Code and Proteus simulation is given in the ‘Downloads’ section at the bottom of this page. The program took from me the whole night though good to know that the project is still at testing phase. For this I'm expecting your feedback if any bug found or development needed :)
The Proteus simulation is shown below.
On reset, the LCD prompts the user to set time first. The hour and minute components can be set by entering the corresponding valid values using the keypad. The AM/PM mode is set by entering 1 or 2. Give 1 for am while 2 for pm. After that the LCD prompts the user to set date components which is day, month and year.
The set time and date is displayed on LCD screen and changes as the time passes on. Seconds are increased after every one second by making use of delay function uses timer 0 with mode 1. As second reaches 59, minute is incremented by one and second is reset to 0. Similarly, as minute reaches 59, hour is increased by one and minute is set to 0. After hour reaches 11, minute reaches 59 and second reaches 59, the AM/PM mode is changed accordingly. The date is changing by the same concept taking into account the difference values for its components.
Features
- The possibility of setting time and date
- Simple circuit and min components
- Acting as real time clock
Downloads
The code was compiled in Kiel uVision 4 and simulation was made in Proteus v7.8 SP2.
To download code and simulation click here