Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

code for digital clock using ds1307+pic16f877a+lcd

Status
Not open for further replies.

anila

Newbie level 1
Joined
Sep 4, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
kerala
Activity points
1,298
digital clock using pic16f877a

pls send me the code for digital clock(calender)using pic16f877a,ds1307and lcd.i am using mplab ide and hi-tech c compiler
 

a simple clock using ds1307 + pic16f877a

Hello!

Any other request?
I guess you also want it ASAP, you need source code with useful
comments, and with complete documentation?

Dora.

anila said:
pls send me the code for digital clock(calender)using pic16f877a,ds1307and lcd.i am using mplab ide and hi-tech c compiler
 
  • Like
Reactions: jujan

    jujan

    Points: 2
    Helpful Answer Positive Rating
Re: digital clock using pic16f877a

pls send me the code for digital clock(calender)using pic16f877a,ds1307and lcd.i am using mplab ide and hi-tech c compiler

i need the program for digital clock using pic16f877
 
  • Like
Reactions: jujan

    jujan

    Points: 2
    Helpful Answer Positive Rating
Dear friend,

Here i post a code for digital clok using pic16f877a,ds1307 and 2*16 lcd.Here i use MikroC.

char sec,minu,hour,day,month,year,date;

char m1,s1,h1,d1,dt,y1,mo1;
void write()
{
// I2C_Init(100000); // initialize full master mode
Lcd8_Out(1,1,"write");
I2C_Start(); // issue start signal
I2C_Wr(0xd0); // address DS1307
I2C_Wr(0); // start from word at address (REG0)
I2C_Wr(0x80); // write $80 to REG0. (pause counter + 0 sec)
I2C_Wr(0); // write 0 to minutes word to (REG1)
I2C_Wr(0x12); // write 12 to hours word (24-hours mode)(REG2)
I2C_Wr(0x05); // write 5 - Thursday (REG3)
I2C_Wr(0x25); // write 25 to date word (REG4)
I2C_Wr(0x09); // write 9 (September) to month word (REG5)
I2C_Wr(0x08); // write 08 to year word (REG6)
I2C_Stop(); // issue stop signal

I2C_Start(); // issue start signal
I2C_Wr(0xD0); // address DS1307
I2C_Wr(0); // start from word at address 0
I2C_Wr(0); // write 0 to REG0 (enable counting + 0 sec)
I2C_Stop();

}
void read()
{

Lcd8_Out(1,1,"read");
I2C_Start();
I2C_wr(0xD0);
I2C_wr(0);
I2C_Repeated_Start();
I2C_wr(0xD1);
sec=I2C_Rd(1);
minu=I2C_Rd(1);
hour=I2C_Rd(1);
day=I2C_Rd(1);
date=I2C_Rd(1);
month=I2C_Rd(1);
year=I2C_Rd(0);
I2C_Stop();

}
void display()
{
LCD_Out(1,1,"display");
s1=Bcd2Dec(sec);
Lcd8_Chr(2,7,(s1/10 +48));
Lcd8_Chr(2,8,(s1%10 +48));
Lcd8_Out(2,6,":");

m1=Bcd2Dec(minu);
Lcd8_Chr(2,4,(m1/10 +48));
Lcd8_Chr(2,5,(m1%10 +48));
Lcd8_Out(2,3,":");

h1=Bcd2Dec(hour);
Lcd8_Chr(2,1,(h1/10 +48));
Lcd8_Chr(2,2,(h1%10 +48));

d1=Bcd2Dec(day);
Lcd8_Chr(1,5,(d1/10 +48));
Lcd8_Chr(1,6,(d1%10 +48));
Lcd8_Out(1,11,"/");

dt=Bcd2Dec(date);
Lcd8_Chr(1,9,(dt/10 +48));
Lcd8_Chr(1,10,(dt%10 +48));

mo1=Bcd2Dec(month);
Lcd8_Chr(1,12,(mo1/10 +48));
Lcd8_Chr(1,13,(mo1%10 +48));
Lcd8_Out(1,14,"/");

y1=Bcd2Dec(year);
Lcd8_Chr(1,15,(y1/10 +48));
Lcd8_Chr(1,16,(y1%10 +48));
}
void main()
{
trisc.f4=0;
trisc.f3=0;
Lcd8_Config(&portc,&portb,0,2,1,7,6,5,4,3,2,1,0);
Lcd8_Out(1,1,"start");
Delay_ms(1000);
I2C_Init(100000);
write();
while(1)
{

read();
display();
}
}
 
Andd...here we have the sponsor......Just posting the code will do nothing. Guess the OP will ask for Complete description of the code, Flow charts, PCB layouts, and project description too. Be ready for that too.

Celebrating with bottles of Champagne...Cheers
 

If you have PROTEUS simulation software with you ,it has the same project what you want in its example/sample projects.
Regards,
Jerin.
 

plz help out...i need a circuit diagram of digital clock using pic 16f877a+ds1307+lcd.....a clear diagram with all the values provided..
wud be very helpful
 

@ kavita_negi

check this link

**broken link removed**


please search in google before posting....
 

thankyou very much but m using lcd display instead...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top