sparkfun / SparkFun_RV-1805_Arduino_Library

A SparkFun Arduino library for the extremely low power, very precise, and highly configurable RV-1805-C3 Real Time Clock from Micro Crystal.
Other
7 stars 43 forks source link

Re-calibration? #5

Open lewispg228 opened 6 years ago

lewispg228 commented 6 years ago

Does anyone know about a way to re-calibrate these modules? We received some from our supplier, that are off by 5 seconds every 17 hours, and I was just wondering if there is any hope in re-calibrating these from an arduino? (I'm not sure how our supplier calibrates them, but I'm assuming it has something to do with accurate temperature and a known good clock source).

mgrusin commented 6 years ago

Whoa that's really far off. I think this is the manual: PSW https://www.microcrystal.com/fileadmin/Media/Products/RTC/App.Manual/RV-1805-C3_App-Manual.pdf. I haven't calibrated this particular part but usually you route the internal clock to a pin (PSW seems to work) for checking against a (good) frequency meter (I don't think an Arduino will be good enough by itself) while you mess with the calibration registers. But I'd definitely let the supplier know.

AndyEngland521 commented 6 years ago

@mgrusin This is correct, configure a square wave at the highest frequency on the XT oscillator, check it against a known good. You can also simply wait for the error to stack up over a couple million seconds and calibrate using that. We could calibrate a single RTC using the scope method, then have an arduino set a repeating alarm on both for a given amount of time,and read the difference in time between the alarm pulses to calibrate, but this would require a mux as the RTC has only one available address.

AndyEngland521 commented 6 years ago

We could calibrate a single RTC using the scope method, then have an arduino set a repeating alarm on both for a given amount of time,and read the difference in time between the alarm pulses to calibrate, but this would require a mux as the RTC has only one available address.

This method should yield an uncertainty of 4 ppm, as we are calibrating the rtc to within 2 ppm of a signal that is within 2 ppm of "real time". More than reasonable.