Are there any public information regarding an embedded NTP client ? I need to build a microcontroller based module to display the time aquired from a NTP server via the Ethernet connection.
- posted
18 years ago
Are there any public information regarding an embedded NTP client ? I need to build a microcontroller based module to display the time aquired from a NTP server via the Ethernet connection.
"Eugen COCA" schreef in bericht news: snipped-for-privacy@g43g2000cwa.googlegroups.com...
If resources allow, run Linux and there's no problem left. Since you need to implement ethernet anyhow, the overhead might be acceptable.
Since NTP is based on UDP and since it mens you only have one connection at a given time cooking something around code talking to the network hardware is fairly simple. The biggest challenge IMHO is probably the DNS resolver. This makes sense cause for this kind of application you may want to use pool.ntp.org as the time server and not a fixed IP.
There's a technote from TI describing a little webserver implementation with one of their micros. You can download it here.
That's overkill since you don't need TCP, but it would show you how to implement the ethernet & IP parts. Leaving TCP out and adding UDP should then be fairly simple.
Using Linux as another poster sugested is of course possible, but to me it looks like using a spaceshuttle to go to the next 7-11 store...
If you are in a hurry and quantity is low, I recommend rabbit cores for this. They are dirt cheap and the SDK contains what you want.
HTH
Markus
After reading your post once more I realize that I may have misunderstood you. If you only need information on how to use NTP, simply use the RFC. NTP is extremly simple. You actually only format one UDP segment, send it to the NTP server and get one back in reply. You then read out the time and your are done.
HTH
Markus
For displaying the time on a clock you probably want SNTP "simplified NTP." The full NTP client does some statistical modeling to remove clock errors among multiple servers. for a display clock there is no point in any acuracy better than 100msec or so.
Thus use SNTP, send a single UDP packet and recieve a single UDP packet. One could probably do this without any kind of TCP/IP stack, just a direct manipulation of the ethernet hardware.
Getting an IP address (DHCP,) and resolving a server name (DNS) are a bit more complicated, but al three of these protocols are UDP based, so you only need the UDP portion of a TCP/IP stack.
A simple NTP client is one of the example programs that ships with all of our network development kits.
Paul CTO Netburner.com
As a follow up .. SNTP is RFC 2030.
Paul
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.