PDA

View Full Version : 1307 RTC accuracy?



amgen
- 5th October 2008, 13:32
How come a $5 LCD watch can be accurate for years but
my RTC 1307 losses about 4-5 seconds/day, the sparkfun boards original xtl was at 32,764 hz measured at the sig-out pin set to xtl freq and it lost time. Then i soldered a new xtl which is at 32,768 hz and the time gains that 4-5 sec each day.

thanks,
don

Jumper
- 5th October 2008, 14:45
Hi,

Do you have a nice clean power supply and a fresh backup battery?

Is it always loosing/gaining the same much every day or it is depending on the temperature?

Is the PIC always running or is it asleep?

If the pic is always running and the error is always the same you simply adjust for it in your code i.e add 4 seconds per day running

If the pic is asleep you need to know when you wake up how many days it was since you last corrected this problem. i.e sleep for 25 days... wake up... read DS ... realize it was 25 days ago.... add 25*4 seconds to the current time....store last correction date... do your stuff.... go back to bed

All RTC's has a built in error, some more, some less but they all have it. And the trick to get it accurate is to compensate for it in the code by + or - the right amount of seconds.

Done properly in a stable temperature environment you can adjust n sec per day, x sec per week, y sec per month and z sec per year.

Then you can run it för a million years :-)

or you can buy 1000 x-tals and measure them all and pick the best one ;-)

/me

Melanie
- 5th October 2008, 14:46
Are the crystals you are using the same Capacitance as that required by the RTC - ie 12.5pF? Probably not. Is your xtal 32768.0000000Hz? Probably not. Is your xtal in an environmentally controlled and regulated oven? Probably not. Have you added any Trimming Capacitors to get the frequency spot-on? Probably not. Have you Phase Locked the xtal to WWV? Probably not. At only 5 seconds/day, you're doing damn good!!!

In any event, the Maxim RTC's are not that great. They work, sure, but not that spectacular, and they are hellishly overpriced for what they are. $1 for a DS1307? Who are you kidding Maxim!

Archangel
- 5th October 2008, 19:25
Are the crystals you are using the same Capacitance as that required by the RTC - ie 12.5pF? Probably not. Is your xtal 32768.0000000Hz? Probably not. Is your xtal in an environmentally controlled and regulated oven? Probably not. Have you added any Trimming Capacitors to get the frequency spot-on? Probably not. Have you Phase Locked the xtal to WWV? Probably not. At only 5 seconds/day, you're doing damn good!!!

In any event, the Maxim RTC's are not that great. They work, sure, but not that spectacular, and they are hellishly overpriced for what they are. $1 for a DS1307? Who are you kidding Maxim!

Hi Melanie,
Yet to address his question, the $5 watch has no oven or PLL . . . , but may have the correct xtal, and trimmer caps, and as far as Maxim's overpriced RTC . . . I'm guessing you know a better I. E. cheaper solution . . . YES?

amgen
- 6th October 2008, 01:16
how stupid of me to think that a REAL-TIME-CLOCK could actually keep real time. actually I would totally agree with all the measures, but it seems that should give mabye 5 year accuracy or something like that. I have seen the correction routines in some PLC's but that also seems , well OLD. I think you would need several days to TUNE your clock. The xtal I got from digikey was of the type, for rtc timing. ME, you are probably right that the 32,768 can't be 32,768.725 which would calculate out to x-added seconds.
Intersil has a RTC chip with some error adjustment registers, but same basic data format as 1307.
Who can make a small circuit board for SO-small outline 8 pin device and stuff, and how do you solder junk that small anyway.
don

sayzer
- 6th October 2008, 07:33
2pf caps to the xtall sometimes is good.

eXPerience !


Here is the linkie:
http://www.maxim-ic.com/appnotes.cfm/an_pk/58

Accuracy
The frequency accuracy of a crystal-based oscillator circuit is mainly dependent upon the accuracy of the crystal and the accuracy of the match between the crystal and the oscillator capacitive load. If the capacitive load is less than the crystal was designed for, the oscillator runs fast. If the capacitive load is greater than what the crystal was designed for, the oscillator runs slow.

In addition to the errors from the crystal and the load match, crystals vary from their base frequency as the ambient temperature changes. Dallas RTCs use "tuning fork" crystals, which exhibit an error over temperature, as shown in Figure 2. An error of 20ppm is equivalent to approximately 1 minute per month.


_______________________________

Luciano
- 6th October 2008, 09:00
$5 watch has no oven

Hi,

A 5$ wristwatch is warmed by your body.
(The body temperature is constant).

Best regards,

Luciano

sayzer
- 6th October 2008, 10:07
Hi,

.....(The body temperature is constant).


Luciano

The body temperature is constant ?

Mine changes from time to time.

________________

aratti
- 6th October 2008, 10:36
What Luciano meant is that body temperature variations will never be as great as ambient.

sayzer
- 6th October 2008, 11:47
What Luciano meant is that body temperature variations will never be as great as ambient.

Comeon aratti!

Get the point there!


----------------

Bruce
- 6th October 2008, 13:51
I dunno. I've left my watch in my truck for several days during winter, and it still kept perfect time. And it gets really cold here in winter...;o}

sayzer
- 6th October 2008, 14:23
I dunno. I've left my watch in my truck for several days during winter, and it still kept perfect time. And it gets really cold here in winter...;o}

The watch must be more expensive then the truck then. :)


____________

skimask
- 6th October 2008, 14:36
Same thing here... I've got a cheap watch that's wrapped around my rear view mirror year-round. Except for resetting it twice a year for daylight savings time, it holds time well, and we get wild temp variations up here. (and yes, the watch probably costs more than the car, at least you'd think so if you saw the car :) )

Pic_User
- 6th October 2008, 15:11
Thanks for the interesting discussion.

This is a handy online ppm calculator:
http://www.maxim-ic.com/tools/calculators/index.cfm/calc_id/rtc

This calculator converts timekeeping accuracy measurements from parts per million (PPM) to real-time accuracy described in seconds per day and minutes per year.

mackrackit
- 6th October 2008, 16:38
The clock radio in my truck keeps good time also. Temperatures a little on the high side in SW Arizona.

I have noticed it will loose a bit of time on long trips. Normal short trips and it is fine.
Maybe it has something to do with speed and how long the speed is maintained changing time.

Luciano
- 6th October 2008, 17:56
I have noticed it will loose a bit of time on long trips.
Normal short trips and it is fine.
Maybe it has something to do with speed and how long the speed is maintained changing time.

Hi,

Einstein's Theory of Relativity?

* * *

Crystal Considerations with Dallas Real-Time Clocks (RTCs)
http://pdfserv.maxim-ic.com/en/an/AN58.pdf

Considerations for Maxim Real-Time Clock Crystal Selection:
http://pdfserv.maxim-ic.com/en/an/AN616.pdf

Best regards,

Luciano

skimask
- 6th October 2008, 18:03
Einstein's Theory of Relativity?

That's the answer! MAXIM makes their chips around 40 degrees north, the original post'er lives on the equator. The earth rotates faster at the equator... Makes perfect sense! :D