Close

Boards ordered

A project log for GPS Clock

A simple desk clock that gets extremely accurate time from GPS

nick-sayerNick Sayer 11/25/2016 at 19:180 Comments

I've ordered the first prototype boards from @oshpark. A screen capture from EAGLE is in the gallery. We'll see what happens when they come back.

In the meantime, I've been working on the firmware.

For the purpose of the 1K contest, the firmware is going to be stripped down. It'll work, and it will display UTC time, but if you go beyond the 1K space limit, there will be timezone and DST support (there will be a #define in the code to select the 1K version of the code).

To make DST support happen, I wrote a method that takes the GPS day and figures out the state of DST for that day - whether DST is in effect or not, but also whether it begins or ends on that day. For those days where DST begins or ends, the code will make the adjustment based on the hour. For other days, it will unconditionally make the adjustment (if DST support is enabled).

To figure out when DST begins and ends, I wrote a method that takes the month and year and returns the day-of-month for the first Sunday (to get the second Sunday, you just add 7 to that). That method only works for years between 2000 and 2099, but that's ok, since the century is left off from the GPS NMEA output anyway. If you're planning on being alive in 2099, then that's a potential Y2.1K bug for you to deal with.

Still to do is UI support - specifically for handling the two buttons. The intent is for a simple SELECT/ENTER style menu to allow selecting the timezone, enabling or disabling DST, and enabling AM/PM or 24 hour display. At the moment, you do this by writing values into EEPROM, but the menu system will allow doing that at runtime.

Discussions