More on leap second preservation

A project log for GPS Clock

A simple desk clock that gets time from GPS

Nick SayerNick Sayer 07/17/2017 at 14:330 Comments

I exchanged some mail with SkyTraq. While I was coding my leap second default update code, I happened to notice that the newer clocks didn't show the leap second error even when powered up without my new code. It turns out that if you preserve VBatt at all then the module will checkpoint the current GPS-UTC offset in flash when Vcc drops. From what I can tell, it's not stored in the same place, since the GPS offset command doesn't return the current value as the "default," but the supercap is preventing the 2 second delta at every power-up after the very first one.

I asked them how long VBatt must be maintained in order to have this save take place, as the clock doesn't really benefit a lot from preserving the almanac and current time for 45 minutes (with good reception it boots up in 10 seconds instead of 30), but this leap second offset save really is a good thing. If the same effect could be done with a few dozen ms worth of VBatt, then a 1000µF polymer cap instead of a 0.1F supercap would be just as good at 1/3 the price. I haven't gotten an answer from them about this, but will update this log when I do. The good news is that a suitable polymer cap would fit in the same footprint as the supercap, so future designs can pick either option.


SkyTraq got back to me with an answer. It turns out that the flash update happens on powerup, if the RAM contents have been preserved by VBatt. So a tantalum or electrolytic cap wouldn't be helpful unless the power came back really quickly. The code to reset the default when it's wrong periodically is the way to go, and with it the value of the supercap has dropped quite a bit, it turns out.