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.

Problem with RTC DS1307 and pic16f1847

Status
Not open for further replies.

gopi90ms

Newbie level 6
Joined
Apr 5, 2014
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
90
I have been doing RTC with PIC16F1847 controller .I am testing with two board rtc is working but the problem is in one board after few days rtc was stopped and second register is showing 80.

Another one board second counting is not matching with real time its step by step decreasing i dont where i made mistake.its software problem or crstal problem ...
 

I am also recently working with very similar RTC clock - ds1338. The only difference is VCC voltage. Firstly (but You probably know it) the CH bit indicates, that the clock has been disabled. According to the datasheet:
On first application of power to the device the time and date registers are typically reset to 01/01/00 01 00:00:00 (MM/DD/YY DOW HH:MM:SS). The CH bit in the seconds register will be set to a 1. The clock can be halted whenever the timekeeping functions are not required, which minimizes current (IBATDR).
When Your RTC stops, it still indicate the last remembered date? Or it resets to initial values?
Now i see a little difference in control register between the ds1307 and ds1338. Ds1338 has additional oscillator fault flag, ds1307 hasn't. It may be a problem with crystal so maybe You should set the SQW output to i.e. 1Hz and if it is a problem with crystal, the SQW output indicate it.

The second part of Your question is more complex. There is a whole note how to properly project PCB and which rules need to be taken into account. Also there are the most common causes of errors in accuracy. But even if You will properly project the board, witch is really tricky, you will not be able to perfectly match CL capacitance to crystal, because CL capacitance is within the IC and it is not possible set this capacitance like in some another RTCs. The accuracy of the RTC will be in best case as good as accuracy of crystal, that is about +/-20ppm and it is around +/-2s/day. If You need more accurate time, You should look for dsxxxx with crystal build in. I know this one: ds1338C, but its accuracy is still around +/-10ppm. There is also ds3231, which is described as "extremely accurate" and indeed it is in comparison to e.g. ds1307. Also e.g. MCP7940M has the possibility to digitally matching capacitance and hasn't internally added capacitors. Hope it help You a little.

Link to note:
 
Last edited:

This may sound stupid, but when working with breakout boards with mounted oscillators it's easy to get your fingers on top of the oscillator while handling the board.
If this happens, it may invalidate the registers. It drove me crazy once, that every time that I unplugged the board the time was lost or incorrect.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top