Embedded NTP client

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.

Reply to
Eugen COCA
Loading thread data ...

"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.

Reply to
karel

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.

formatting link

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.

formatting link

HTH

Markus

Reply to
Markus Zingg

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.

formatting link
is your friend here.

HTH

Markus

Reply to
Markus Zingg

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.

formatting link
and we have several existing customer shipping commercial "clocks".

Paul CTO Netburner.com

Reply to
pbreed

As a follow up .. SNTP is RFC 2030.

formatting link

Paul

Reply to
pbreed

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.