Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

Real Time Clock using 8051 Microcontroller and RTC IC DS1307

Description

Comments

hai

22pf is compulsory in this circuit or not plz tell me

 

 

you can use capacitor with value near to 22pf..

hello dear ur awesome to do this circuit as well as output demonstration ............

 

 

thank u

 

thank u

 

very very very much

Working good smiley

It is not working ......nothing is displayed on LCD..

r/w isn't mentioned in the code for LCD.......it is working fine when r/w is given in code.....but the time is not running ??......can you please help me how to run the time.. 

 i need code for 

Real Time Clock using 8051 Microcontroller and RTC IC DS1307

above code works ....u can use that....

Yaaaa, its working....But i m using 89C51 m.c using Protues the time is displaying in LCD..

But in hardware up to "starting to RTC.........." only displaying after that time is not coming whats the problem.... plzzzz help me

fix or rotate the potentiometer of LCD ..

For working of display 16*2 please connect R/W pin to ground....

thanqqqqqqqqqqqq........

thx

thx

plz send me code

send me the source code

Source code is on website itself..

login to get source code..

this helpful  for my project

bvcbcvbcvb gffhfh

gooddddddddddddddddddddddddd

hiii sir,

can you tell me how to connect pin no.7  of ds1307 IC to contoller.

 

I have not used pin 7 in this project. Pin 7 is square Wave Output you can use this with pull-up resistor...

Sorry for late reply...

thank you 

can you please eleobrate some functions you use in this program:

1. void send_byte();

2. void receive_byte();

i need seven segment display rather than lcd display..so plz send me code for this.

You can use multiplexed 7 segment display by writing appropriate functions. I dont have code for this.

yeah i mean to say code for the multiplexed seven segment display.

sir you dnt try to write for this..so plz write once..

 

can u please provide me the assembly code for the same

I have not tried to write ASM code

is rtc works in the power failure condition???

Rtc has coin cell with it..in power failure it will depend on the cell

Thanks Lakshay for reply
Yes it works with coin cell in case of power failure.

Thank you, please how can I use  this code to ring a bell for 11secs and delay for 40minutes for 8 periods in a day from 0800hrs

thaks

 

thank you sir once again .....

 

very goood

Hi.

I used the library of my development board hy-51. My format Brazil.

 
#include<reg52.h> //?????,?????????,???????????????
#include<intrins.h>
#include<i2c.c>
 
sbit RS = P2^4;  
sbit RW = P2^3;
sbit EN = P2^2;
 
#define RS_CLR RS=0 
#define RS_SET RS=1
 
#define RW_CLR RW=0 
#define RW_SET RW=1 
 
#define EN_CLR EN=0
#define EN_SET EN=1
 
#define DataPort P0 // all port 0 to LCD
 
void _nop_(void);
void LCD_Write_Com(unsigned char );
void LCD_Write_Data(unsigned char );
void LCD_Clear(void);
void LCD_Write_String(unsigned char ,unsigned char ,unsigned char *) ;
void DelayUs2x(unsigned char );
void DelayMs(unsigned char );
void start(void);
void stop(void);
void send_byte(unsigned char);
unsigned char receive_byte(unsigned char);
void write_i2c(unsigned char, unsigned char, unsigned char);
void set_value(void);
void stpwtch(void);
unsigned char read_i2c(unsigned char, unsigned char);
 
/*------------------------------------------------
 uS????,?????? unsigned char t,????
 unsigned char ??????????,??????
 0~255 ??????12M,?????????,????
 ???? T=tx2+5 uS 
------------------------------------------------*/
void DelayUs2x(unsigned char t)
{   
 while(--t);
}
/*------------------------------------------------
 mS????,?????? unsigned char t,????
 unsigned char ??????????,??????
 0~255 ??????12M,?????????
------------------------------------------------*/
void DelayMs(unsigned char t)
{
     
 while(t--)
 {
     //????1mS
     DelayUs2x(245);
DelayUs2x(245);
 }
}
 
bit LCD_Check_Busy(void) 
 { 
 DataPort= 0xFF; 
 RS_CLR; 
 RW_SET; 
 EN_CLR; 
 _nop_(); 
 EN_SET;
 return (bit)(DataPort & 0x80);
 }
 
 void LCD_Write_Com(unsigned char com) 
 {  
 while(LCD_Check_Busy()); //????
 RS_CLR; 
 RW_CLR; 
 EN_SET; 
 DataPort= com; 
 _nop_(); 
 EN_CLR;
 }
 
void LCD_Write_Data(unsigned char Data) 
 { 
 while(LCD_Check_Busy()); //????
 RS_SET; 
 RW_CLR; 
 EN_SET; 
 DataPort= Data; 
 _nop_();
 EN_CLR;
 }
 
 void LCD_Clear(void) 
 { 
 LCD_Write_Com(0x01); 
 DelayMs(5);
 }
 
 void LCD_Write_String(unsigned char x,unsigned char y,unsigned char *s) 
 {     
 if (y == 0) 
  {     
LCD_Write_Com(0x80 + x);     //?????
  }
 else 
  {      
  LCD_Write_Com(0xC0 + x);      //?????
  }        
 while (*s) 
  {     
 LCD_Write_Data( *s);     
 s ++;     
  }
 }
 
 void LCD_Write_Char(unsigned char x,unsigned char y,unsigned char Data) 
 {     
 if (y == 0) 
  {     
  LCD_Write_Com(0x80 + x);     
  }    
 else 
  {     
  LCD_Write_Com(0xC0 + x);     
  }        
 LCD_Write_Data( Data);  
 }
 
 void LCD_Init(void) 
 {
   LCD_Write_Com(0x38);    /*??????*/ 
   DelayMs(5); 
   LCD_Write_Com(0x38); 
   DelayMs(5); 
   LCD_Write_Com(0x38); 
   DelayMs(5); 
   LCD_Write_Com(0x38);  
   LCD_Write_Com(0x08);    /*????*/ 
   LCD_Write_Com(0x01);    /*????*/ 
   LCD_Write_Com(0x06);    /*????????*/ 
   DelayMs(5); 
   LCD_Write_Com(0x0C);    /*????????*/
   }
   
void main(void) 
 
LCD_Init(); 
//LCD_Clear();
//init_rtc(); // set all regs => unsigned char clock[] = {0x00, 0x53, 0x20, 0x03, 0x29, 0x06, 0x16};
//    write_i2c(0xd0, 0x01, 0x44); // set one register add,reg,value => 44 minutes
 
while (1) 
 {  
 
c = read_i2c(0xd0, 0x02); // hour
LCD_Write_Char(2,0,(c / 16) + 48);
LCD_Write_Char(3,0,(c % 16) + 48);
LCD_Write_String(4,0,":");
c = read_i2c(0xd0, 0x01); // minute
LCD_Write_Char(5,0,(c / 16) + 48);
LCD_Write_Char(6,0,(c % 16) + 48);
LCD_Write_String(7,0,":");
c = read_i2c(0xd0, 0x00); // seconds
LCD_Write_Char(8,0,(c / 16) + 48);
LCD_Write_Char(9,0,(c % 16) + 48);
 
LCD_Write_String(0,1,s[read_i2c(0xd0, 0x03)]); // day of week
 
c = read_i2c(0xd0, 0x04); // date
LCD_Write_Char(4,1,(c / 16) + 48);
LCD_Write_Char(5,1,(c % 16) + 48);
LCD_Write_String(6,1,"/");
 
    c = read_i2c(0xd0, 0x05); //month
LCD_Write_Char(7,1,(c / 16) + 48);
LCD_Write_Char(8,1,(c % 16) + 48);
LCD_Write_String(9,1,"/20");// two digits year
 
    c = read_i2c(0xd0, 0x06); //year
LCD_Write_Char(12,1,(c / 16) + 48);
LCD_Write_Char(13,1,(c % 16) + 48);
DelayMs(500);
 
 }
}

i need the code for glcd  based digital based calender and clock with alaram set 

This clock is 12 h or 24h

if i want to use the pin 7(sqw) of ds1307 for 1kHZ then plese help me ? plese give me a code..

 

Kindly provide the clear circuit diagram of above image
Good to understand
Awesome project sir bt send me more information plz Rohitghadge84@gmail.com is my mail id sir plz send me..ma final year project bsc students..plz send me sir