Open source AVR NTP clock???

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did some searching here and didn't really come up with what I was looking for. Did a little on google and found a Tuxgraphics kit, but it is almost the same price that I can buy NTP displays.

What I'm looking for is a cheap NTP display that uses 7 segment LEDs so that I can change the size as needed. Needs to connect with wired ethernet and be able to read the time from our win2003 domain controller. Getting the time from DHCP would probably be easiest, and the server is set to update clients every 5 minutes. The server is connected to NIST to keep it on time. While I could connect all the displays directly to NIST, I don't want to waste their free resources, so I would prefer connecting the displays back to my DC, and that way I only connect to NIST to update that single server.

Alternate would be to use SMPTE timecode, but running ethernet cable and using power over ethernet to power the clocks seems like a better choice.

Radio penetration inside the building is horrible, which is why the current clocks do not function properly. This will be rolled out in the college where I work, but only in our department so probably 10-12 displays total. Immediate needs are the clocks in our radio station (2-3 displays) and in our TV studio (another 2-4 displays). I'll probably end up buying displays from somewhere like ESE but thought I would check the DIY method first to see what kind of prices I could get this down too.

I can program all the 8 bit AVRs and I think the 32 bit AVRs too, but would prefer the cost of the 8 bit devices.

Thanks for any help you can provide.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely the Tuxgraphics gives you the basis of the design though - you basically just need an AVR, an ENC28J60 and a MagJack.

Tuxgraphics have the chip for E4.25 and the jack for E4.80

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My coding is not strong enough to pull off a scratch design like that. I'll look into the info on Tuxgraphics and see what I can pull together.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was thinking of a NTP clock while I was trying to fall asleep this night. What a coincidence.

I have some experience using uIP (a supersmall lightweight TCP/IP stack) with a ENC28J60. NTP protocol can't be too demanding.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The NT5DS that a Windows domain controller uses is slightly different from NTP. Just one more thing to consider. The NT5DS is part of the time sent when a computer logs into the domain controller, I think it may also use this for any DHCP client. That said I also have the NTP service running on my DC so that anything else that needs time can get it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I looked up what NTP is, and it is something way more complex then I thought :D (I thought it was more like DCF77, just a simple frame with time and date)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:
I looked up what NTP is, and it is something way more complex then I thought
SNTP would be a better fit for an AVR application.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure I can configure the DC to send SNTP (Simple Network Time Protocol).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The_village_idiot wrote:
Not sure I can configure the DC to send SNTP (Simple Network Time Protocol).
I haven't checked, but I'd be surprised if there weren't third-party applications to send (and/or receive) SNTP broadcasts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been considering a scratch build of an AVR (S)NTP clock for some time but too many other projects in front of it at the moment :P

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think the NIST offers a utility that might do the job, if not then they probably have a link.

For now it looks like I'll have to just throw some money in the budget for commercially available displays

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was looking at a recent Circuit Cellar (July 2008) which presents a mp3 player alarm clock which synchronizes time via SNTP. You can buy the article PDF from Circuit Cellar. Also, the article references additional information at http://www.circuitcellar.com/mic... and also ftp://ftp.circuitcellar.com/pub/... I imagine you'll find source code in one of those two locations.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Instead of NTP, I use the infinitely simpler RFC 867. NIST still has servers for this. It's almost trivial to parse the result which is one packet in response to one TCP or UDP packet to the server.

//////////////////////////////////////
// NIST RFC 867 format
//  0         1         2         3         4
//  01234567890123456789012345678901234567890123456789
//  54541 08-03-16 03:53:56 50 0 0 792.0 UTC(NIST) * 
//  JJJJJ YR-MO-DA HH:MM:SS TT L H msADV UTC(NIST) OTM
//  JJJJJ is the Modified Julian Date (MJD). The MJD has a starting point of midnight on November 17, 1858.
//  date and time are UTC
//  TT is 00 when Standard time is in effect, or to 50 when DST  - IN THE USA
//  L = 1 means a positive leap second will be added at the end of the month
//  H = 0, the server is healthly. If H = 1, then the server may be in error by up to 5 sec
//  msADV = 50, amount time is advanced to account for average network delay

It even takes care of daylight savings adjustments. About all you have to do is apply the UTC to local offset in hours, and use DST too if the NIST message says DST is in effect (no complicated lookup).

I have this working along with most of the other popular IETF protcols using the socket interface to the WizNet modules.