Wayne's Network Time Protocol AVR Clock 


| Description |
This little and cheap project replaces your old unreliable alarm clock with a modern accurate clock that is synchronized with network servers using Simple Network Time Protocol (SNTP). All you require is a PC that is connected to the Internet with a spare serial port. This can be a permanent connection or logging into an ISP daily, weekly etc.
A small program runs on the computer that gets the time from a timeserver and then transmits the time down the serial port of your computer to the free running clock. This update process can be done each hour (ADSL or LAN connection) or every time you log into your ISP.
| Schematics |
| The Software |
Shown right is the PC Based software for Windows 9X, NT4, Windows 2000 and XP. The Program runs resident in your tray and once clicked on, displays the main screen, showing both the UTC time from the Network TimeServer and the local time. The local time is calculated from the UTC time using the TIME_ZONE_INFORMATION form windows. When Time Sync 2001 is run for the first time, the user will have to set up the program. The Software will create registry settings for this program. These settings are store in 'HKEY_CURRENT_USER/Software/Embedded Life/TimeSync'. Settings are then automatically saved to the registry every time they are changed. Comm Port Settings are required for the serial link to your cute little AVR clock. The baud rate should stay at the standard rate of 9600bps. You will have to enter the address of the NTP Server you wish to get your time from. If your ISP has one setup, use it. The server address can be a domain name or IP address and the port number should stay at the NTP port number, 123.
Re-sync time interval is the time between updates from the server in minutes. The AVR clock holds it's time well with high accuracy. (For weeks in fact!), so you should only need to updated it daily, however there is no reason you can't do it more often. For twice daily enter 720. If you have a dial up link like me (can't get ADSL here, Telstra can you fix this?), set your time to 30 minutes or so. It this case the program will check for a server every 30 minutes and therefore you clock should be updated while you are online. When you have no connection and 'Time Sync' can't find the server a red cross will appear on the Tray icon as shown here.
The "Network" button will allow you to update the external clock from the network server at the click of a button, instead of waiting for the next update interval. Great for a dial up connection and testing servers. The "Get Local" button allows the external clock to be updated from local PC time, this is useful if a network connection is unavailable. On the main screen, the radio button gives you an indication of daylight saving time. Once you have 'Time Sync' running well, add it to your startup folder, so it runs on startup of your PC. You should never be late again nor ever have to set a clock again. Great for living in California during the energy crisis of 2001. Gives you extra time to read about the crisis in the rag. After all it filled lots of pages daily!!
NOTE: I am currently using a Timeserver Port (Port 37). I need to move the software over to SNTP!
Must change to Simple Network Time Protocol (SNTP - RFC2030).
I am thinking about RF radio links for the clocks. This way I can have a small box sitting by the PC with a RS232 Transmitter, with multiple clocks with in-built receivers. Even the neighbors could have them!! The RF links are only $11AUD each.
I will get around to adding multiple timeserver address boxes, this way you can check the time from 3 servers etc.
The schematic has an MC34064P-5 low voltage reset, this should be a 3.3 volt type as the power supply is now 3.3V
| Downloads, Firmware & PC Software |
Download the file ntpclock.zip and then read the file clock.txt