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.

[SOLVED] Real time clock 1307 stopping for some time , and sometimes even getting erased

Status
Not open for further replies.

burrow

Full Member level 2
Full Member level 2
Joined
Dec 15, 2014
Messages
147
Helped
3
Reputation
6
Reaction score
3
Trophy points
18
Visit site
Activity points
1,148
Hai,
my project which uses pic18f4520 and RTC 1307 was working fine. But i noticed a problem since last many days. Some times the time freezes ( the clock stocks ticking ) for a long time and then it starts ticking on its on. Which is forcing me to correct its time every 2 days or so.

I am not using Time write code in my program . ( i initially write code to place time in registers and then burn and once time is set, i remove that portion of code )

Also i noticed sometimes the Rtc looses memory, it replaced portion of time or date with "?" marks.

SDA AND SCL is using a pull up resistor of 2.2k ohm
The Backup battery is fine
Its using 32.768khz crystal.
their is load capacitace too.
Their is 100nf decoupling capacitor across 1307.
Their is filtering capacitor for the whole circuit
The 5v supply is from a 7805 regulator
 

Show your schematics, pcb and real device photos. There are a lot of errors could be found.


Sorry for the late reply.. i was away for a while.

I have attatched a pcb layout. I hope you can figure out things from the image. Forgive me if their is any mistakes in layout or practical implementation as it is my first project :).

let me brief out things.

This unit consist of PIC18F4520, A DS 1307 connected to it and a RS 232 IC.

Their is another unit placed some distance away which consist of PIC16F628A and rs 232. all the sensor feeds the values to this mcu and it communicates to first unit via UART.


First unit is powered by 12v dc which is fed into 7805 ic, also a 9v rechargeable battery is kept in parallel.

I have noticed that most of the time , the RTC crash occurs when MCU restarts frequently (it happens once in a while ).when it crashes It starts displaying question marks for some values( sometimes its for hours, sometimes minutes,sometimes every values )


Restarting of pic occurs most of the time due to watchdog timeout, and i am yet to find the exact cause. seems like its issue with uart communication.

i would have quoted the program here, but its just too long. And my program writing discipline is very bad, so i am sure most people will find it quite difficult to read it. :)
11072715_803965976347895_65113920_n.jpgCircuit 2.jpg

B
 

This will never work stable. Make a high quality product.

:).. This was actually a project i started out of excitement when i first learned about microcontrollers.

So you don t think their is a way to fix my problem with present setup ?
 

i guess the problem was that i was reading from i2c too often.
now i modified everything and started using timer 1 based RTC. initially the time and date will be fetched from DS 1307 and then the time will be kept using timer 1.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top