Digital Clock Using Microcontroller 89C52/89S52




Are you a beginner in micro controller projects?and are you stuck where to start from?if yes,then this is one of the simplest mini projects that you can start from . This mini project will give you a clear understanding of programming your micro controller. we sometimes look at our watch and wonder ” how does this thing work”. Well, in this digital clock project, you will gain some insight on how micro controller can be used to make it work as a Digital Clock.

Digital Clock Using Microcontroller 89C52 89S52 Components required:

  • 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
  • 16×2 LCD display
  • 1 resistor-10k

Software you will need

This 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.
Digital Clock Using Microcontroller 89C52 89S52 Schematic

The detail explanation of the code is done below:

#include “REGX52.H”
#include “delay.h”
#include “lcd.h”
void main(void)
{int hr=0; /*initiate hour=0 */
int min=0; /*initiate minutes=0 */
int sec=0; /*initiate seconds=0 */
P1=0xff; /*set port 1 as input port */
P2=0x00; /*set port 2 as output port*/
while(1)
{ LCD_INIT(); /*initialize LCD*/
if (P1_4==0)/*if P1_4 is grounded enter the 12hr loop */{




Current Project / Post can also be found using:

  • ckt diagram of digital clock using 89c52
  • project on digital clock using microcontroller pdf
  • 89c52 microcontroller based digital clock pdf
  • 89c52 microcontroller pdf

Leave a Comment

*
= 5 + 1

Read previous post:
Analogue TV still huge for chip makers
Analogue TV still huge for chip makers

The Si2178/58/48/38/28 is Silicon Labs' fourth-generation hybrid TV tuner family supporting all worldwide terrestrial and cable TV standards. Requiring no external...

Close
Scroll to top