- 1 microcontroller 89C52(89S52 will also do)
- 2 ceramic capacitors-22pF
- 1 switch(button for reset purpose)
- 1 electrolytic capacitor-10uF,25V
- 1 crystal oscillator-11.0592MHz
- 16x2 LCD display
- 1 resistor-10k
Software you will needThis project has been done in proteus software.If you are new to proteus software, the tutorials given below may get you started with the software.note:if you are familiar with proteus you can skip this part.
The programming of the microcontroller is done using keil compiler.port 2 of 89C52 is used as the output port.whereas port 1 is used as the input port.when P1_4 is grounded the 12 hr mode is activated and when P1_5 is grounded the 24 hr mode is activated.In the schematic diagram P1_5 is grounded so the 24hr mode is activated.it is as shown below
The detail explanation of the code is done below:
you can download the .hex file here
you can add more functions to this digital clock since 2 ports of 89C52 are still unused.For instance, you can connect a buzzer to port 4 such that the buzzer sounds at a specified time or you can connect a keypad to port 0 such you can set the timings externally.
Please comment if you would further like to improve the project.