Does taking a reading from a RTC chip cause the time to drift if done too often?

Hey guys.
Iv been working on a timing based project with an arduino mega and RTC chip.

Im using a DS3231 RTC and have noticed the time is drifting more than it used too now that im taking a reading from the RTC more often within my sketch after adding more functions.

Im using the DS1307RTC Library and using the call "time_t t = now()"

Is this even possible or would there be other things which could be causing this time drift? Its gone from about 1 seconds per week to around 1 seconds per 24 hours.

Thanks

If my maths is right that's 11ppm? If so it's way off as 2-3ppm would be considered normal. Why this would happen I don't know, reading it should have no effect.

DS1307RTC Library

Is that lib for the 3231 as well?

Post your code, possibly there's something in there t cause a problem although I can't think what would unless you are also setting the time as well


Rob

The sketch is around 3000 lines long so posting it wont be possible

The DS1307 library seems work fine with the DS32321...and iv read other reports that this is true.

Could the extra drift be because of the temperature being around 30 - 40 degrees C these past few weeks?

Horendus:
Could the extra drift be because of the temperature being around 30 - 40 degrees C these past few weeks?

Bingo! How south are you from the equator? :wink:

Your crystal frequency depends on temperature. To have a more accurate reading, you either get something that has a temperature sensor to compensate the reading or crystal in an oven so it is maintained at a constant temperature.

Temperature was my first thought but that's a TCXO.

Accuracy ±3.5ppm from -40°C to +85°C

So maybe you could have a 7ppm swing if it moved from the extremes. You've gone from about 1ppm to 11ppm, that seems out of spec unless I got my numbers wrong (quite possible).


Rob

A long time back (well over a year ago :|) another poster had the same problem with clock drift but I cannot find the post with the search on the forum. The cause was found to be a code error where the time was being requested from the chip to often.

Riva:
A long time back (well over a year ago :|) another poster had the same problem with clock drift

I had exactly the same thought, but I don't remember who it was. As far as I remember it, the theory was that the RTC module was so busy handling I/O that it was missing clock events.

Spurred on by PeterH remembering the same thing I finally found the thread

Interesting, and certainly a gotcha although you wouldn't read an RTC every loop.


Rob