Tutorial Microcontroller 8051
 
 
 
 
 
   

AT89C4051 as RTC

Ajay Bhargav, ajay_bhargav@hotmail.com

It is a digital clock which make use of AT89C4051 to work as a Real time clock.

Figure 1: Circuit Diagram for Digital Clock

Figure 1 shows the circuit diagram for the digital clock. Port 1 of the controller (AT89C4051) is used as the data lines for the LCD (starting from pin 7- pin14 of LCD). Here I am using a 16 x 2 lines LCD display. The first line shows "DAY" and "DATE" in the second line. Time format "TIME" is 12:00 with am/pm.

Port 3 is used for the clock setting and it also provides the necessary control signals for the LCD. As shown in the diagram, switch 3 will be used to select the parameters which need to be changed, switch 1 and 2, are used to increase or decrease the selected parameter value.

When the power supply is switched on it will give you the default date and time, but later you can change it to the desired value.

The source code for the project was written in C-language, and compiled using Keil C compiler. You can download the c-code, schematic, and if you don't have a cross compiler then you can directly burn the HEX file on to your chip easily, clock.zip ( C clock file and clock circuit schematic )

NOTE: If you think that there is a problem in the availability of 89C4051, then you can also use AT89C51/AT89C52, make sure that you are using the same port for LCD and switches which are there in the C-file or in the schematic.

The schematic contains the power supply module also, which is not shown in the figure above. For any help regarding the project please mail me anytime.

Best Link

 

BACK

 

Lesson 1:
T o o l
1.1. Programmer
1.2.
Edsim 51
1.3. MIDE-51
1.4. ATMEL ISP

Lesson 2:
Input Output
2.1.LED
2.2.Swicht
2.3.7 Segmen
2.4.LCD Character
2.5.ADC
2.6.DAC
2.7.Motor Stepper
2.8.Keypad

Lesson 3:

Timer Counter

3.1.Basic
3.2.Mode 0
3.3.Mode 1
3.4.Mode 2
3.5.Mode 3

Lesson 4:

Serial Comm.

4.1.Basic
4.2.LED
4.3.Rotate LED
4.2 ADC
4.3.LCD

Lesson 5:
Interuption

5.1.Basic
5.2.Timer
5.2.External