- Program For Digital Clock Using 8051 Programming
- Assembly Language Code For Digital Clock Using 8051
- Program For Digital Clock Using 8051 Microcontroller
- Program For Digital Clock Using 8051 Microcontroller
- Program For Digital Clock Using 8051 Switch
Hello friends, hope you all are fine and having fun with your lives. In today's post, I am going to share Interrupt based Digital clock with 8051 Microcontroller. In the previous post, I have explained in detail How to use Timer Interrupt in 8051 Microcontroller.We have seen in that post that we can use two timers in 8051 Microcontroller which are Timer0 and Timer1. Digital Clock using 8051 Microcontroller In this project, we are going to demonstrate making a RTC Clock using 8051 microcontroller. If you would like to do this project with Arduino, check this digital clock using Arduino. The major component of this project is DS1307 which is a real time digital clock IC. Digital Clock using 8051 Microcontroller. Codes are not working properly. After reset It shows Default time 5:5:5 and Date. With the help of 3 Switches I can Changes only Year but no other field. Also no time increments from RTC appears. I have changed the RTC Chip also but no improvement! RTC I am using DS1307. Real time digital clock is a very accurate digital clock made by using 8051 microcontroller and ds1307 real time clock chip. Ds1307 chip run the time accurately by using 32.768 KHz Crystal oscillator. 8051 microcontroller sends the command to ds1307 to configure and read the time date day and year. Real time clock is very easy to made and components are easily available in the market. Now the source code written in assembly, basically implements the I2C protocol. The assembly source written for Keil download here clock.asm and the direct hex file for programming the controller from here clock.hex. The schematic for the Digital clock is available in PDF format can be downloaded from here clock.pdf.
You might be seeing a wall clock running with a 1.5V battery or a digital watch running with lithium or silver oxide. But, an interesting thing is, if you want to tick a clock in real time applications, the only solution is to use RTC (Real Time Clock) to get Date and Time.
In the previous tutorial, I have explained how to use RTC DS3231 with microcontroller and display date and time on LCD.
In this article, I will show how to display date and time on PC using 8051 serial communication.
RTC Schematic of DS3231
RTC code for DS3231
This embedded C program evaluates the working of DS3231 RTC with 8051 Microcontroller and displays time and date on PC.
The below code snippet shows the macros used for RTC registers. The addresses correspond to the slave address of DS3231, second, minute, hour, second, date, month, and year, hour format.
The below code shows the macros used for i2c communication with 8051.
Program For Digital Clock Using 8051 Programming
![Using Using](/uploads/1/0/5/6/105645959/444822745.jpg)
Assembly Language Code For Digital Clock Using 8051
The below code explains the serial communication with 8051 and RTC.
The header file has been created for accessing the global variables.
Program For Digital Clock Using 8051 Microcontroller
The delay function has been used to set some lag for sending byte by byte to PC.
Proteus Simulation
Program For Digital Clock Using 8051 Microcontroller
Conclusion
I hope you understand how to use Real Time Clock (RTC) to display the date and time on the serial terminal.
Program For Digital Clock Using 8051 Switch
There are multiple ways to monitor the data. It might be an LCD, PC or a serial debugger.
This DS3231 RTC code is tested on 8051 microcontroller. The date and time will be shown on the serial terminal at 9600 baud rate. The software can be putty, real term, dock light, and hyper terminal, etc.