Close

NTP time synchronize

A project log for IV-18 Arduino Clock

Clock build from IV-18 VFD tube and Arduino

will-whangWill Whang 09/29/2015 at 10:230 Comments

Just build three of them so far, and the problem of synchronize between these clocks surfaced.

I modify the NTP code, now it will handle all of the timestame (uint64_t), also count in latency

then I can delay the decimal in timestamp so the system will synchronize in microseconds.

But the problem is that RTC chip handles Synchronize differently, the two RTC chip I'm using is DS1338(DS1307 3.3v version)

and PCF8563 , PCF8563 is tricky because it will not clear the counter after writing new time, so I have to wait the 1Hz clock output goes low, then stop the RTC clock, then write the new timestamp, also note that the time waiting for Clock output must also count in.

For DS1338, just write the second reg and it will clear the counter, much easier then PCF8563.

Discussions