"What time is it?" aksed the microcontroller

Assume that we have a group of computers. Some of them are PCs and others are small microcontroller boards of different types. Some of the PCs running
Linux and others running Windows, vxWorks or QNX. Microcontroller boards have no operating system but some embedded program that we are going to provide.
Our mission is "some how" synchronize their time as accurate as possible. What we are going to debate is the following special cases; 1. All computers (PCs and controllers) are placed next to each other and we are free to connect them together any way we want (freedom in electronics and in sw). 2. Computers are in the same room but separated from each other with few meters 3. Computers are in different rooms of the same building. 4. Computers are in the same campus. 5. Computers would be anyware (in the same town or city, country, continent, on the world or near Earth orbits).
What would be your suggestions ? How to connect them together? Which sort of HW and SW would you use ? How accurate the time sync. you would acheive (minute, secont, milli sec, micro sec, nano sec )?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
jiang wrote:

What class is this for? If I give you an answer, do I get the credit for the grade in the class?
I don't know how to compensate for the time of travel of a the signal (only an issue for the last situation), but WWV in Colorado USA broadcasts a time signal that can be used anywhere on earth if you can receive the signal. By synchronizing to a common source, you can sync all your computers. Another common source is the GPS system, but again, you have to be able to receive the signals which precludes some locations.
--

Rick "rickman" Collins

snipped-for-privacy@XYarius.com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Another option is IEEE 1588, it's a time sync protocol.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
<jiang> wrote:> What would be your suggestions ?
... use ... never mind :)
my next suggestion is to NOT x-post to so many newsgroups and try to focus on one, or two at the most
lastly, since you're setting a followup to *.students newsgroup, this tells us you're trying to get others to do your homework. try to figure this stuff out in the future on your own, otherwise, you're just cheating yourself in the longrun
--
<< http://michaeljtobler.homelinux.com/
Fourth Law of Revision: It is usually impractical to worry beforehand
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Assume that someone find a magical way to sync all omputers with the accuracy you want. How can you verify that?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Mon, 24 May 2004 00:45:29 +1000, "Michael" <Michael Mich> wrote:

Easy ... just use Thiotimoline based components and slave them all to a common clock source.
George ============================================Send real email to GNEUNER2 at COMCAST o NET
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Fri, 28 May 2004 05:29:57 -0400, George Neuner

Don't forget to use Black Hole Diodes at the end of the chain or the excess energy will be sucked back in time and kill your grandfather.
--
-| Bob Hauck
-| To Whom You Are Speaking
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Fri, 28 May 2004 05:29:57 -0400, George Neuner

But wouldn't that require you to throw all the systems into a vat of water (simultaneously)? Might be hard on the non-thiotimoline components...
Regards,
-ve
--
Change is inevitable, progress is not.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Fri, 28 May 2004 13:55:34 GMT, snipped-for-privacy@hotmail.com (Dave Hansen) wrote:

Nope. Thiotimoline was a salt which could be added to other materials. In the proper crystaline structure, the 4th dimensional bond would create an alternate conductivity path having an effective zero propogation delay. Asimov himself speculated on this use and included the idea in some of his stories.
George ============================================Send real email to GNEUNER2 at COMCAST o NET
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I wonder how closely related this is to how tunnel diodes work?
Cheers! Rich
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
<jiang> wrote on Sat, 22 May 2004 03:16:59 +1000

The OP did not ask the question in the proper set of newsgroups.
http://mentifex.virtualentity.com/variable.html#t does not apply.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@victoria.tc.ca (Arthur T. Murray) wrote:

We spent a lot of time thinking about clock sync because we supported tightly-coupled mulitple processors both master/slave (where no sync was an inconvenience) and SMP (where sync was a necessity). In addition to having each clock on each processor have the same time, we were also wrestling with the problem of the operator entering the wrong time during startup (boot of the whole system). The only infallible solution we could think of was to hang a cheap device that would call up the country's master clock and get the time from it.
I don't think accuracy can be in the nanoseconds because electricity is very slow.
Also note that this does isolate time-setting to a single point failure which is another aspect that you will need to consider.
<snip nutter>
/BAH
Subtract a hundred and four for e-mail.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@aol.com wrote: <snip> >We spent a lot of time thinking about clock sync because we supported

[MUTTERing emoticon here who can't stop thinking about the old problem]
I don't know how GPS devices work but assume there has to be a clock ticking around somewhere in the signal exchange.
The problem with getting a timestamp over the net is that you don't have any idea how many times the comm message went round the world before getting delivered to the program waiting for the time _right now_.
Note that the meaning of "right now" can have interesting problems all of its own.
Does "right now" mean the time when I sent the request or does it mean the time I received the answer or does it mean something else?
I almost guarantee that any PC will always be late. Mine "loses" about an hour/month.
/BAH
Subtract a hundred and four for e-mail.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@aol.com wrote:

Mine synchronizes to a standard at least daily and at every boot up.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Bill Vajk wrote:

Which standard ? Do you use the "Net" or do you have a local standard?
I have here (not in use) a VME buss card that can take a IRIG signal and make the time and date available to the VME buss processors.
Bill K7NOM
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Isn't the standard clock resolution on a PC 55 ms? This would exceed GPS, and IRIG, but not all NET time varances/delays.
Cheapest way is Net time (several places, freeware) and they should get you within 5 seconds or so.
GPS would be the most accurate, need a card, should get to perhaps 300 ns, theoretically to 30 ns averaging for 15 min or so. But your PC wouldn't know, he's thinking slowly, and delivers time to the rest of his system on descrete time boundries.
It takes a few nanoseconds for a signal to cross a single NAND gate, and that time varies with temperature of the die quite a bit, more than 2:1.
wrote:

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

There is a lot of misinformation going on on this thread, which is basically because it has been cross-posted to several irrelevant newsgroups (I'm taking out the time travel one, from the followups, as that is more than irrelevant).
Old PCs have clock resolution of a little better than one microsecond and modern ones can read to about a nano-second.
55 ms is the MS-DOS clock interrupt rate, and is, I think, the slowest possible rate for the counter-timer based software clock with the standard crystal frequency.
Most Unix and Unix like systems use 10ms (NT might use 20 - I'm not sure). However, any modern Unix system will interpolate by reading the balance count of the counter value (on older machines) and the CPU cycle counter (on newer ones). Some versions of Linux attempt to use 1ms interrupt periods, but often lose interrupts.
The speed of electrical signals is almost as fast as it can get; in co-ax cables, it is about two thirds of the speed of light. (Most of the propagation will actually be as light in optical fibres, which are likely to have no worse velocity factors; most delays are in routers.)
One way propagation delay only matters as a second order effect as, good protocols, like NTP, halve the round trip delay to cancel out first order effects. It is quite common to be within a few 10s of ms round trip time from an accurate GPS or atomic reference, so the error is quite tightly bounded, anyway.
Time isn't just part of the protocol for GPS, it is fundamental to its operation. It needs absolute time so that it knows exactly where the satellites where when they transmitted the signal (they are in ~12 hour orbits). It also needs to know the relative time between the satellites with rather more accuracy, because it uses that to work out where the receiver is in relation to the instantaneous positions of the satellites. GPS is specified as being able to provide a time accurate to around 50ns, although simple navigation receivers don't provide that accuracy externally. GPS satellites carry atomic clocks and the GPS formulae actually have to make general relativity corrections to the frequencies of those clocks!
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Mon, 24 May 04 21:52:21 +0100, snipped-for-privacy@djwhome.demon.co.uk (David Woolley) wrote:

Single processor NT systems 10 ms (100 Hz) while multiprocessor systems 15.625 ms (64 Hz). When the multimedia timers are enabled, the sleep time granularity can drop to 1 ms, but the time of day is still updated at 10 or 15.625 ms steps.
On single processor NT systems, the 64 bit performance counter reading grows at the 1.19 MHz rate, while on multiprocessor kernels, directly at the time stamp counter (TSC) frequency, which is the CPU clock frequency.
Some NTP implementations on both NT and x86 Linux seem to be using the TSC directly for higher resolution.
Paul
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.