1Hz output from DS3231

Forum for posting topics and questions about anything.
Post Reply
RetroBoy
Posts: 73
Joined: Sat Feb 26, 2022 11:29 am
Location: U.K.

1Hz output from DS3231

Post by RetroBoy » Wed Apr 13, 2022 10:54 pm

I am using the 1Hz SQW from a DS3231 to count seconds, I use the same RTC for a Date/Time and DHT22 & BMP180 for Humidity/Baro/Temp/etc. I use the NEO-6m to make sure the RTC is always up-to-date, and add 1 hr on for BST.
My question concerns when the RTC & GPS do a sync, currently 4x a day ( every 6 hrs ), if the RTC is 'out of sync' would any change to the date & time affect the 1Hz output. I can say that ' this sync ' throws the seconds count out with regards to the GPS pulse.
I also ask the same question regarding whenever the DS3231 decide to make any ' internal compensation ' so the Oscillator either runs quicker / slower, would that also have any effect on the SQW outputs.
Currently I have been checking the 32k output pin and that reads anywhere between 32.758khz - 32.760khz, while the SQW 1Hz seems to sit at 1Hz. That does not make sense if the same Oscillator is providing both outputs - I would have expected somewhere between say 0. 990 - 0.999Hz.
Anyone able to shed any light on the issue ( sorry for any unitended puns ).

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 1Hz output from DS3231

Post by andrew » Mon Apr 18, 2022 8:05 am

My question concerns when the RTC & GPS do a sync, currently 4x a day ( every 6 hrs ), if the RTC is 'out of sync' would any change to the date & time affect the 1Hz output. I can say that ' this sync ' throws the seconds count out with regards to the GPS pulse.

Looking at the datasheet a change to the time would reset the 1Hz output. Here is the relevant paragraph....

The countdown chain is reset whenever the seconds register is written. Write transfers occur on the acknowledge from the DS3231. Once the countdown chain is reset, to avoid rollover issues the remaining time and date registers must be written within 1 second. The 1Hz square-wave output, if enabled, transitions high 500ms after the seconds data transfer, provided the oscillator is already running.


I also ask the same question regarding whenever the DS3231 decide to make any ' internal compensation ' so the Oscillator either runs quicker / slower, would that also have any effect on the SQW outputs.
The datasheet seems a little vague on this but as it's making very minor temperature and age corrections every 64 seconds I would expect any effect to the 1Hz output to be also very minor. Assuming of course the RTC is not experiencing rapid changes of temperature.

Currently I have been checking the 32k output pin and that reads anywhere between 32.758khz - 32.760khz, while the SQW 1Hz seems to sit at 1Hz. That does not make sense if the same Oscillator is providing both outputs - I would have expected somewhere between say 0. 990 - 0.999Hz.

If I've done my sums correctly I calculate a drift of 32.75kHz to 32.760kHz to be an error of +/-30.5ppm. That would translate to the 1Hz output drifting between 1.00003 and 0.99997Hz. Plus don't forget to factor in the measurement accuracy of your test equipment.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “General Discussion”