4
\$\begingroup\$

I am building clock with ultimate precision.

There are few known ways to improve precision: temperature controlled environment and multiple crystals. I am implementing both.

I was going to use 5 crystals on separate uC's (2$ each in retail). But then I've thought: maybe I can just build crystal generators on inverters (2 generators per 0.2$ chip), and feed multiple 32khz signals to single uC?

Will the precision of inverter-based generators be inferior to uC-based ones?

Obviously inverters look very attractive - in the same budget I can have 2-3 times more crystals.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ Not an answer as to whether invertors or uCs are better but beware that multiple crystals can, through EMI coupling, end up in phase and so will drift together. Are you looking for absolute accuracy or low tempco or low long term drift or low immunity to other external factors? What about the effect of voltage, vibration, loading, external fields? If you use a passive component to calibrate, that could drift. \$\endgroup\$
    – Martin
    Commented Feb 16, 2011 at 12:52
  • \$\begingroup\$ long term drift is the main goal. Temperature & voltage will be very stable (+-0.1C, +-0.01V). Also, temperature controlled box will be EMI-shielded. So possible coupling might be a problem... \$\endgroup\$ Commented Feb 16, 2011 at 13:19
  • \$\begingroup\$ Sounds like a fun statistics problem to me. \$\endgroup\$
    – Kellenjb
    Commented Feb 16, 2011 at 16:08

5 Answers 5

1
\$\begingroup\$

Sounds like an interesting project.

All microcontroller datasheets I've read so far all have the same crystal oscillator configuration -- a single inverter in the Pierce oscillator configuration.

It will make no difference to the precision of a Pierce oscillator whether you use such a microcontroller or a SSI discrete logic chip to drive the crystal -- it's a simple inverter either way.

While most of the Pierce oscillators I've seen use exactly 2 capacitors, one per crystal pin, some people insist that the right way to built a Pierce oscillator is with 4 capacitors, one to ground and one to VCC at each crystal pin.

Sometimes I wonder if a "gentle" sine-wave oscillator such as a Wien bridge oscillator would be better at driving a crystal than the digital on/off of a Pierce oscillator. Perhaps you could build a couple of each kind of circuit and compare them.

Wikipedia claims that thermal noise influences the stability of crystal oscillators. Would putting one of your crystals in a little Peltier cooler at a constant cold temperature work any better than the more common approach, putting the crystal in a little oven at a constant hot temperature?

The Spark Fun Wall Clock has a few pointers on getting a clock to read GPS time.

\$\endgroup\$
5
  • \$\begingroup\$ Brooke Clarke maintains a fascinating page about time and frequency measurements: prc68.com/I/timefreq.shtml \$\endgroup\$
    – markrages
    Commented Feb 18, 2011 at 23:16
  • \$\begingroup\$ Hmm... When I probed crystal connected to Atmel uC, I've seen a sine wave, not square... \$\endgroup\$ Commented Feb 19, 2011 at 10:05
  • \$\begingroup\$ Actaully the inflection point of the quartz crystal (e.g. AT or SC, etc.) determines the best temperature to operate the crystal at, if you want to minimize drift due to temperature variations. 25-35 °C for AT, and roughly 90 °C for SC-cut. So an "oven" (resistive heater) is normally used rather than a Peltier cooler \$\endgroup\$
    – mctylr
    Commented Feb 22, 2011 at 0:26
  • \$\begingroup\$ @mctylr: Yes, the minimum frequency offset per degree is at those temperatures. However, it is not at all obvious to me: What is the best trade-off between frequency error due to small unavoidable temperature variations (best at the special temperatures you mentioned) vs. frequency error due to thermal noise (better at lower temperatures)? \$\endgroup\$
    – davidcary
    Commented Mar 4, 2011 at 6:26
  • \$\begingroup\$ I haven't looked at the numbers, but I assume that the long-term stability drift swamps (much larger) the short-term noise from thermal, and noise has the benefit of being typically unbiased randomness - thus cancelling itself out over time, whereas long-term stability can be due to properties such as aging, which are likely to distort in a biased fashion. \$\endgroup\$
    – mctylr
    Commented Mar 11, 2011 at 23:33
10
\$\begingroup\$

I am building clock with ultimate precision.

Are you really talking best precision possible, i.e. a primary time standard (e.g. Cesium foundation based time-standard)?

There are few known ways to improve precision: temperature controlled environment and multiple crystals. I am implementing both.

There are far more than just those two. It is possible to design temperature compensation circuits, which result in a circuit that is self-adjusting to be independent of (slow) temperature fluctuations, such as used in a Temperature-compensated crystal oscillator (TCXO). You can use quartz crystals with a different cut, than the most common AT cut, such as the SC-cut quartz crystal, which is typically used in a oven controlled crystal oscillator (OCXO).

With multiple standard (AT-cut, not temperature compensated or in a thermally stable chamber such as a crystal oven) quartz crystals I don't believe you are going to gain much improvement, because you are not certain which reference is correct.

For long term stability, using an external time standard (such as WWV/WWVH, WWVB (USA), CHU (Canada), DCF77 (Germany), JJY (Japan), etc.) or GPS/GLONASS/Galileo GPS-disciplined oscillators using a timeing GPS receiver (ideally, many common receives produce a high-quality Pulse-Per-Second, PPS, signal with microsecond accuracy). One of the cheapest (and moderate quality) external time sources would be the AC mains, which in the long time will average to the nominal value (e.g. 50/60 Hz) so as to keep AC powered clocks stable. This can be accessed using a diode detector from the AC voltage from the secondary windings of a transformer.

I didn't get into Microcomputer/microprocessor Compensated Crystal Oscillator (MCXO) which are cost-effective high-quality oscillators.


I would strongly recommend reading through the archives of the time-nuts, and their member's web pages, who were profiled in Wired magazine a few years ago. And a presentation given by John Vig in 2007.

Depending on the cost / budget, and exactly how accurate you want to be, I would suggest as a design starting point, start with considering using a Maxim DS3232, DS3234, DS32B35, or DS32C35 Real-Time-Clock (RTC) IC which includes an integrated TCXO making it trivial to build a low-cost clock with far better than typical accuracy and stability compared to common free running AT-cut quartz crystals. One chip would cost roughly $5 USD, 4 Euros.

Next for high quality long term stability, you need to add an external time reference, such as LF/HF time signal from a station such as WWVB, CHU, MSF, DCF77 or a GPS module with a decent PPS output combined with the standard GPS NMEA messages via serial. There are commercially available radio receiver modules for WWVB, and I believe DCF77 and MSF radios, which covers much of North America and Europe.

I think these two considerations would be far better gain in time reference quality (accuracy and precision) than messing about with trying to use multiple crystals in Phase-Locked-Loop, PLL, or Frequency-Locked-Loop, FLL, circuits to get marginal improvements.


Added:

Will the precision of inverter-based generators be inferior to uC-based ones?

No. The crystal oscillator built into a microprocessor / microcontroller is often just a single inverter.

Using a parallel-resonant crystal with thermally stable capacitors (e.g. silver mica, or C0G / NP0 ceramic) of the correct values would make a bigger difference.

I don't think I've seen a FLL circuit based upon several identical frequencies for comparison. I suspect that it would be terribly slow (e.g. days) to determine which signal to lock to that the decision may be invalid before it reaches a lock. And I suspect a digital attempt to compare these signals of the same frequency would just be futile without spending a fortune on high-end ADCs and support circuits.

Without a specific (or at least more specific) target for "ultimate precision", I suggest either buying a used Cesium standard or a GPS-displined oscillator, where the local oscillator is a single high-quality SC-cut quartz OCXO such as the HP/Agilent 10811A oscillator that are readily available on the surplus / second-hand market.

\$\endgroup\$
3
\$\begingroup\$

Multiple crystals isn't a good way to improve accuracy as they will all be sublect to similar drift mechanisms. There are well-proven ways to get high stability- TXCO's and OCXO's

\$\endgroup\$
1
  • \$\begingroup\$ Well, in fact I am building OCXO, but using multiple crystals to filter out failing ones, and averaging the rest. I don't trust TXCO factory calibration, i need to be better than that :-) \$\endgroup\$ Commented Feb 16, 2011 at 16:58
2
\$\begingroup\$

The easiest way to get a high-stability clock is to lock it to a suitable radio transmission, such as the Droitwich 198 kHz BBC transmitter.

\$\endgroup\$
2
  • \$\begingroup\$ This would not work for Russia. Anyway, I can use GPS/Glonass clock which is even better, but I need to have independent clock. It will be calibrated by GPS. \$\endgroup\$ Commented Feb 16, 2011 at 17:01
  • \$\begingroup\$ You should be able to receive that transmission in Russia. \$\endgroup\$ Commented Feb 16, 2011 at 17:21
0
\$\begingroup\$

I'll flesh out this answer when I have more time but I would look at a clock distribution IC.

They come in various forms but most simply a single crystal drives a programmable (or fixed) PLL in the IC which then provides multiple clock outputs. These are generally very good at matching each output with very low jitter. I've used them several times in audio systems that required many devices running off the same clock. They also come in forms that allow multiple crystals, usually used for multiple clock frequencies, but you could probably use some sort of averaging logic with the same rate and perhaps improve accuracy.

In terms of an accurate clock, anything you do will become out of sync over time. Consider an internet connection on the device and periodic syncing with network time servers (NTP protocol). This should provide accuracy within the milliseconds range synced to global atomic clocks.

\$\endgroup\$
2
  • \$\begingroup\$ How do you suggest getting NTP to a device like this? I've had a hard time figuring out how to get the signal with that high of accuracy. \$\endgroup\$
    – Kellenjb
    Commented Feb 16, 2011 at 18:28
  • \$\begingroup\$ depends on the processor, the NTP protocol is very simple, I've implemented it on PIC18's before, I think its included in microchip's stack now. The processing required is fairly low you would have to include processing time in the clock setting on something like a PIC to get higher accuracy. \$\endgroup\$
    – Mark
    Commented Feb 16, 2011 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.