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.

RTC with16F877A DS1307 16*2 lcd ressets every time supply Iis switched ON/OFF

Status
Not open for further replies.

NILESH PATEL

Newbie level 3
Joined
Feb 17, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
Hi, Friends
My RTC clock program using 16F877A as master I2C and DS1307 and 2*16 LCD in ASSEMBLY works fine at actual hardware but when main 230volts A.C/5volt D.C is switched off and restarted then it re writes the time in related locations of DS1307 in RTC and then displays the time from starting and then works ok until 5 volts supply of MCU is again switched off means it restarts from beginning every time supply is switched OFF and ON.
I have provided separate 3 volt battery for DS1307 it is ok , but I Have not provided any stand by supply OR Battery provision for MCU.to continue working When 5 volts is switched off. Also I have not used SLEEP OR WAKE UP and I don’t know how to use theme and how to connect stand by supply to MCU in hardware and software both also.LCD should not glow during mains is off but I don’t know how to implement it.
So friends are requested to help to solve the problem to take a clock in actual working condition.
Thanks in advance.
 

3volt battery is the basic requirement. Whenever a power reset occured what time you get than? Is 00:00:00 or any other specific time always? I think you are getting one time always instead of 00:00:00 if m right than problem lies on your code startup. Check startup program you may be writing specific time at start
 
DS1307 need 3 Volts battery to run even if the power is off, so your board is ok. In your startup procedure check if DS1307 is running (CH==0 -- CH is bit 7 from register w. address 0x00); if yes do not update date and time. There you can find a tutorial how to use DS1307 and a link to DS1307 library
 

Probably in the code, in the initialization part, you are writing some value to DS1307. This may be the problem. Or your battery could be dead.

Hope this helps.
Tahmid.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top