On Sunday, May 30, 2021 3:09:16 PM EDT Pluess, Tobias wrote: > Besides that, I also thought about adding a NTP. That would not require a > MAC with PTP capability. Any thoughts on that? has anyone ever written > their own NTP server on a microcontroller?
I have, twice — once for the Arduino Uno (ATmega328) with W5100 Ethernet (not great; the W5100's own processor adds quite a lot of jitter, but it was still good to better than 100us), and once for an Arduino Due clone (ATSAM3X8E) using the internal Ethernet MAC. Both of them are up on GitHub: https://github.com/arodland?tab=repositories&q=ntp Probably most of it is not much use to you, but the NTP protocol implementation at lines 27 - 216 of https://github.com/arodland/Due-GPS-NTP-Server/blob/master/ethernet.cpp might be educational. One trick to keep in mind when doing NTP on a micro is: you don't need to bother with an ARP implementation, just swap the src and dst MAC addresses along with the src and dst IP addresses when you send your reply. Cheers, Andrew KC2G _______________________________________________ time-nuts mailing list -- [email protected] -- To unsubscribe send an email to [email protected] To unsubscribe, go to and follow the instructions there.
