EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Re: Accurate millisecond Time Keeping

Started by GB April 1, 2009
Thank you very much for your responses.

My system will be deployed in a building, so I expect 20C to 25C degrees and both crystals will be the same.
The systems are both wireless and they will need to sync in this way (more than likely).

I would consider the GPS 1PPS. It might be somewhat expensive and impractical in some situations, as you mentioned.

Considering all the options, it would be somewhat unnecessary to use something more than a good crystal since drif will occur anyway and synchronization will be needed anyway, so I prefer to spend my time working on that than on adding some extremely expensive component that will not solve the issue completely.

Thank You
--- On Tue, 3/31/09, Alan Zubatch wrote:

> From: Alan Zubatch
> Subject: RE: [msp430] Re: Accurate millisecond Time Keeping
> To: m...
> Date: Tuesday, March 31, 2009, 11:59 AM
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Augusto,
>
>
>
> I agree completely. Wherever the system design and ppm
> tolerances will
>
> allow, the relative synch pulse with the option of a very
> good base clock is
>
> the best solution.
>
>
>
> I'm also anxiously waiting for NIST to get done working
> on the chip-scale
>
> atomic clock and get some into production. Depending on
> price it will render
>
> other options obsolete.
>
>
>
> http://tf.nist.
> gov/timefreq/ ofm/smallclock/ index.htm
>
>
>
> az
>
>
>
> > -----Original Message-----
>
> > From: msp430@yahoogroups.
> com [mailto:msp430@yahoogroups.
> com] On Behalf
>
> > Of Augusto Einsfeldt
>
> > Sent: Tuesday, March 31, 2009 10:10 AM
>
> > To: msp430
>
> > Subject: RE: [msp430] Re: Accurate millisecond Time
> Keeping
>
> >
>
> > Alan,
>
> >
>
> > You are right. I forgot to evaluate the 20ppm in
> system difference and
>
> > not just solo variation. And after all you have
> provided more complete
>
> > and detailed options.
>
> >
>
> > Regarding the synchronization between boards I have
> used not an
>
> > absolute timekeeping, only relative. So, if synch
> pulse comes long
>
> > before the ppm tolerance expires all system devices
> will be in synch to
>
> > each other's timers no matter enviromental
> differences. The local time
>
> > would follow the master's ppm setup and the time
> counting shall be very
>
> > accurate between system devices.
>
> > A very precise clock source could be used only at
> master's site,
>
> > reducing system cost in great deal and resulting in
> increase system's
>
> > accuracy.
>
> >
>
> > -Augusto
>
> >
>
> >
>
> >
>
> >
>
> > De:msp430@yahoogroups.
> com
>
> >
>
> > Para:msp430@yahoogroups.
> com
>
> >
>
> > Cia:
>
> >
>
> > Data:Tue, 31 Mar 2009 09:33:50 -0500
>
> >
>
> > Assunto:RE: [msp430] Re: Accurate millisecond Time
> Keeping
>
> >
>
> > Augusto,
>
> >
>
> > I think you've done a great write up of the
> options available but I
>
> > would
>
> > argue for a more conservative estimate of 1ms error
> every 25 seconds by
>
> > assuming the worst case differential of +20ppm on
> one crystal and -
>
> > 20ppm on
>
> > the other. Not likely if they are in same environment
> like you mention
>
> > but
>
> > that may not be an accurate assumption.
>
> >
>
> > OP -
>
> >
>
> > Yes the DS32khz will be better than a stock +-20ppm
> crystal, it also
>
> > costs
>
> > more :)
>
> >
>
> > Accurate timing, low-power, low-cost.... ..sliding
> scales and the
>
> > further out
>
> > on any one scale you go the more drastically it
> affects the other 2.
>
> >
>
> > Next step up would be something in the Maxim DS4026
> list of options,
>
> > higher
>
> > cost but temperature and uC controlled that specs at
> <1ppm with
>
> > pullability
>
> > in the 1ppb range (that's b as in billion).
>
> > http://www.maxim-
> ic.com/quick_ view2.cfm/ qv_pk/5408
>
> >
>
> > Then maybe if you need even more accuracy...somethin g
> from the Valpey
>
> > Fisher
>
> > line of OCXO's? Adjustable in the few parts per
> billion and holds 1-2
>
> > parts
>
> > per million accuracy over a year or so. Higher power
> draw here.
>
> > http://www.valpeyfi
> sher.com/ Products. aspx?ProductCode =OCXO
>
> >
>
> > Lots of options in this range for different price
> points and power
>
> > draws for
>
> > various controlled oscillators OCXO, TCXO, VCXO, MCXO.
> Another part
>
> > that
>
> > finds use on lots of test systems are the Stanford
> Research Systems
>
> > oscillators. http://www.thinksrs
> .com/products/ SC10.htm
>
> >
>
> > Q-tech had an awesome though expensive MCXO part that
> would sync to a
>
> > 10MHz
>
> > input (use a good one) and hold that in the few parts
> per billion over
>
> > a
>
> > year while consuming relatively little power.
> Unfortunately they lost
>
> > asic
>
> > manufacturer and don't have enough demand to do
> the next IC spin. If
>
> > you
>
> > need lots you could do your own asic :)
>
> >
>
> > You could buy a bench iridium or cesium source and
> buffer that for use.
>
> > Extremely impractical but listing for completeness.
>
> >
>
> > Also, not sure where it would fit in and really only
> useful in outdoor
>
> > environment would be to use a GPS and key off of the
> 1PPS to tweak
>
> > something
>
> > like the DS4026 as needed to maintain accurate
> inter-second time while
>
> > the
>
> > 1PPS provides the seconds counts. GPS receivers have
> gotten pretty
>
> > cheap and
>
> > low power so not so unrealistic in some systems.
>
> >
>
> > One other thing I've tried and had some success
> with but only started
>
> > to
>
> > evaluate would be to connect two boards with cheap
> crystals together
>
> > (like
>
> > Augusto mentioned) and declare one of the boards as
> the master and
>
> > calculate
>
> > and software correct for the difference in crystal
> frequency. A lot of
>
> > testing would need to be done to determine how long
> and how often this
>
> > correction would need to be done to ensure accurate
> timekeeping over
>
> > temperature and voltage variations. This could even be
> done wirelessly.
>
> >
>
> > Lots of options but it really depends on how badly you
> really need the
>
> > ms
>
> > accuracy as there is no cheap, easy, low power
> solution.
>
> >
>
> > az
>
> >
>
> > > -----Original Message-----
>
> > > From: msp430@yahoogroups.
> com [mailto:msp430@yahoogroups.
> com] On
>
> > Behalf
>
> > > Of Augusto Einsfeldt
>
> > > Sent: Tuesday, March 31, 2009 8:03 AM
>
> > > To: msp430
>
> > > Subject: Re:[msp430] Re: Accurate mili second
> Time Keeping
>
> > >
>
> > > I think the OP need an accuracy of 1ms in a given
> clock timer. So,
>
> > with
>
> > > 20ppm 32KHz cristal he can divide by 32 (if it is
> 32000Hz crystal and
>
> > > not the watch crystal that is 32768Hz) and get
> 1ms interrupts.
>
> > > 20ppm means one error in 50,000 so every 50,000ms
> (50 seconds) he may
>
> > > be 1ms up or down compared to other device with
> same hardware and
>
> > > software (given that both devices are under
> similar enviromental
>
> > > conditions).
>
> > > Using the mentioned correction scheme the
> accuracy increases and the
>
> > > 1ms error will happen every 100 seconds.
> Corrections will compensate
>
> > > enviromental differences and that error could be
> sustained even if
>
> > one
>
> > > device is at -40C and the other is at +85C.
>
> > > The only system I know that can keep an accuracy
> of 1ms for longer
>
> > > periods would be GPS and I am not sure the
> resolution you can get. If
>
> > > you can get 1ms resolution GPS in the time stamp
> it is more accurate
>
> > > than fine tunning a crystal.
>
> > > Fine tunning a crystal system (buying precise
> crystal along with
>
> > > software compensation, precise VCC supply, etc)
> you may get 5ppm or
>
> > > lower. This would increase the synch interval to
> 200 seconds or
>
> > > something above but not a whole day.
>
> > > If you can synch each device's clock at least
> every 50 seconds than
>
> > you
>
> > > can live with a 20ppm 32KHz crystal.
>
> > > When I need this or even better time stamp
> resolution what I do is to
>
> > > elect one device in the system as synch master.
> Then it sends a pulse
>
> > > every N miliseconds to clear the timer in all
> other devices at same
>
> > > time.
>
> > > Of course there are several different schemes but
> all depends on your
>
> > > system design.
>
> > > -Augusto
>
> > >
>
> > >
>
> > >
>
> > > De:msp430@yahoogroups.
> com
>
> > >
>
> > > Para:msp430@yahoogroups.
> com
>
> > >
>
> > > Cia:
>
> > >
>
> > > Data:Tue, 31 Mar 2009 05:56:07 -0000
>
> > >
>
> > > Assunto:[msp430] Re: Accurate mili second Time
> Keeping
>
> > >
>
> > > I have used ~20ppm watch crystals and achieved
> <10ppm accuracy by
>
> > > calibration and application of temperature
> compensation.
>
> > >
>
> > > I do not know what you mean by accuracy of mili
> seconds. 10ppm means
>
> > > 0.864 second per day. Or, about 26 seconds per
> month.
>
> > >
>
> > > --- In msp430@yahoogroups.
> com, GB wrote:
>
> > > >
>
> > > >
>
> > > > Hey,
>
> > > >
>
> > > > In a project I'm working on with an
> MSP430F1611, I need to measure
>
> > > delay with accuracy of mili seconds.
>
> > > > However, from everything I read it seems
> that the 32khz crystal
>
> > > drifts, ending up with several seconds of error
> in a day, which
>
> > > suggests that very quickly it will loose
> accuracy.
>
> > > > I have two msp430F1611 and they both have to
> be synchronized to the
>
> > > same time with ms accuracy.
>
> > > >
>
> > > > I guessed my first job is to try and
> stabilize the crystal with a
>
> > > good layout and temperature compensation, but it
> seems it won't be
>
> > > enough.
>
> > > > Does anyone have any experience or ideas
> that they can share about
>
> > > this?
>
> > > >
>
> > > > It doesn't have to be the 32khz crystal.
> Perhaps I need to use some
>
> > > larger HF crystals or something similar for more
> resolution, even
>
> > > something fancy like a TCXO.
>
> > > > I see Maxim-IC makes the DS32Khz, could this
> be used to replace the
>
> > > 32khz and give much better performance?
>
> > > >
>
> > > > I'm sorry if I'm casting a wide net
> but it seems there are many
>
> > > possible solutions and I'm trying to find the
> correct one.
>
> > > >
>
> > > > Thank you very much
>
> > > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > [Non-text portions of this message have been
> removed]
>
> > >
>
> > >
>
> > >
>
> > > ------------ --------- --------- ------
>
> > >
>
> > >
>
> > >
>
> > >

Beginning Microcontrollers with the MSP430


The 2024 Embedded Online Conference