I am experimenting with this idea: keep a DTCXO in sync with some frequency standard. I have all the parts I can afford, but I cannot figure out a way to do it.

Parts I have: Arduino Leonardo, a u-blox 6010 based GPS module with PPS output, and a proto shield with DS3231 DTCXO chip mounted.

My big idea is that DS3231 have aging registers that would affect the clock frequency. By keep counting the 8192Hz square wave output of DS3231 and keep it in sync with the 1Hz signal from the GPS module, I can keep the DTCXO in sync with a reference clock. This, in turn, would give me a relatively good 32768Hz clock reference that I can build a frequency counter on.

Both 8192Hz and PPS are interrupt driven.

Anyone have an idea on how to do it? Does this spell Artificial Intelligence on AVR, as my instructor suggests?

  • Perhaps use the 8192Hz signal as a timer clock signal? Commented Jan 14, 2015 at 19:06
  • @IgnacioVazquez-Abrams Not gonna work so well I think. The Leonardo is counting this 8192Hz and checking it against the 1Hz PPS from the GPS module, decrease the clock frequency if there is too many counts and increase it if there is too few. Commented Jan 15, 2015 at 6:06
  • And why can't you use the 1Hz signal as an interrupt to count the timer pulses? Commented Jan 15, 2015 at 14:19
  • @IgnacioVazquez-Abrams I am doing this, clocking the microcontroller at 16MHz, one interrupt counting the 8192Hz and another interrupt sensing the 1PPS. Commented Jan 15, 2015 at 14:40
  • Eh. Probably easier to use a timer. Commented Jan 15, 2015 at 14:48

1 Answer 1


Hope you get this. Trimming the aging compensation in the DS3231 is not worth the trouble. You won't significantly improve the temperature accuracy or aging drift due to the crystal used, etc. On the other hand, 10MHz Double Oven Reference Oscillators are available for under $50 on EBAY. These are good to 2x10-12 short-term, or about 1x10-6 yearly drift. For timekeeping purposes, you can ignore the short-term drift, could not measure it anyway :). On the other hand, the aging drift will be large because you do not know how long these have been in service. The good news is that aging drift is very stable if temperature is kept constant, the reason for the double ovens. So once you determine how far off frequency the OCXO is, you just periodically add a count to your divider during one period to keep it synched to the GPS signal. For more info write mhuss103athotmaildotcom

  • Those are EXPENSIVE and all I have is cheap components: $10 Arduino clone, $8 GPS module, $0.5 NOS DS3231 chip, Commented Apr 17, 2015 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.