EmbeddedRelated.com
Forums
Memfault Beyond the Launch

"What time is it?" aksed the microcontroller

Started by Unknown May 21, 2004
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 )?


<jiang> wrote in news:40ae398e$0$31679$afc38c87@news.optusnet.com.au:

Note: you have exceeded the polite, 3 newsgroup cross-post limit. Please
don't blast you question to every newsgroup on the planet. 

> 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.
Have you read the RFC for NTP? What features of NTP might you make use of in solving your problem? Re-inventing the wheel becomes quite boring. -- - Mark -> --
>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 )?
Take a look at the NTP protocol ( RFC1305 ). IMHO this covers fairly well what you need. Markus
jiang wrote:
> > 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 )?
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 rick.collins@XYarius.com Ignore the reply address. To email me use the above address with the XY removed. Arius - A Signal Processing Solutions Company Specializing in DSP and FPGA design URL http://www.arius.com 4 King Ave 301-682-7772 Voice Frederick, MD 21701-3110 301-682-7666 FAX
Another option is IEEE 1588, it's a time sync protocol.


"rickman" <spamgoeshere4@yahoo.com> wrote in message
news:40AE4A9C.28B57BAC@yahoo.com...
> jiang wrote: > > > > 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 )? > > 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 > > rick.collins@XYarius.com > Ignore the reply address. To email me use the above address with the XY > removed. > > Arius - A Signal Processing Solutions Company > Specializing in DSP and FPGA design URL http://www.arius.com > 4 King Ave 301-682-7772 Voice > Frederick, MD 21701-3110 301-682-7666 FAX
NTP as previously suggested, or if the units are external to the building, GPS
is very good for this.




On Sat, 22 May 2004 03:16:59 +1000, <jiang> wrote:

>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 )? >
<jiang> wrote:
> 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.
Use NTP. <http://www.ntp.org/> -- "cbbrowne","@","ntlug.org" http://www3.sympatico.ca/cbbrowne/postgresql.html First Rule of Computer Security - Only forbid that which can be made impossible. - Facilitate the possible. - Have the wisdom to explain the difference. -- Mark Miller
How much sybc accuracy can be achieved with NTP (minute, secont, milli sec,
micro sec, nano sec )?
Isn't the non-deterministic nature of ethernet is a problem for high
accuracy?
I think GPS is a good choice of otdoor environment but it is not be an
option for indoor applications. Also GPS gives 1Hz timing signal isn't it?

> NTP as previously suggested, or if the units are external to the building,
GPS
> is very good for this. >
jiang wrote:
> How much sybc accuracy can be achieved with NTP > (minute, secont, milli sec, micro sec, nano sec )?
NTP will yield between 1mS (same subnet) and 100mS (cross-Internet) accuracy, depending on infrastructure between the server and client.
> Isn't the non-deterministic nature of ethernet is > a problem for high accuracy?
That depends on what you mean by high accuracy. For most computing purposes, 0.1 to 0.001 second accuracy is very adequate. More specialized applications use GPS sources with direct time signalling, both of which adjust for cable lengths. Or extreme-accuracy clocks (e.g., cesium) which are periodically referenced to a NIST atomic clock or GPS. These can offer better than 40nS accuracy. See http://www.symmetricom.com for a wide spectrum of products with the kinds of outputs and accuracies you're asking about. These guys pretty much own the market on time sync products. For NTP, read the reference given earlier at http://www.ntp.org. It's loaded with FAQ, info, source code, etc.
> I think GPS is a good choice of otdoor environment > but it is not be an option for indoor applications. > Also GPS gives 1Hz timing signal isn't it?
GPS is an excellent option for internal use in fixed installations. Antenna on the roof feeds to an interior device of your choosing, which serves time using the interface of your choice. It's not uncommon for organizations to sync their root NTP servers this way. GPS can sync to 40nS accuracy. The cycle of the GPS signal isn't really relevant - it's used to keep an internal clock sync'd. If a master clock needs to correct drift more than once a second, a better internal clock is probably in order. Consider also - do you need accurate time, or just synchronized time? Presumably you want your devices sync'd to each other; that's the first part. Then, does your application need sync to UTC?
On Sat, 22 May 2004 23:08:15 -0700, Richard <rh86@azglobal.com> wrote:


>Consider also - do you need accurate time, or just synchronized time? >Presumably you want your devices sync'd to each other; that's the first >part. Then, does your application need sync to UTC?
If only synchronised time but not absolute time is needed and all devices are connected to the same synchronised national/continental AC power grid, it can be used to generate a common clock signal to all devices. The problem is to identify the correct cycle to be used as a reference point, but if you can reach about 5 ms timing accuracy by other means at least once, it is possible to identify a common cycle and also into which phase in the three phase power distribution network the devices are connected. Since the practical wave shape is far from a pure sine wave these days, using a zero crossing detector or peak detector is not very reliable. Instead use some form of phase locked loop with a several second integration time. This is also useful if the mains is lost for a few seconds due to lightning over voltages and other short disruptions. The short time frequency accuracy is much worse than what is obtainable from even a bad crystal oscillator, but if the main purpose is only to register a common event by multiple devices, the absolute timing is not so critical. Also the field and line sync pulses from a local TV-transmitter (or TV satellite) has been used in the past to synchronise receivers far apart, with timing accuracy well below the 64 us line time. Of course, you have to compensate for the propagation delay. Since analog (satellite/terrestrial) TV-transmissions will not last for many more years, this might not be a good solution for new systems any more. Paul

Memfault Beyond the Launch