[time-nuts] The need for quartz crystals and mains frequency (was: Mains Frequency)

Attila Kinali attila at kinali.ch
Sat Feb 13 00:27:41 UTC 2021


On Fri, 12 Feb 2021 18:23:54 +0000
Andy Talbot <andy.g4jnt at gmail.com> wrote:

> Why should the microcontroller have a crystal at all?

Because you need accurate time or frequency.

E.g.: You have a USB connected device. The USB specs say
that the reference clock for the device must be accurate
to 0.2% (2000ppm) under all operation conditions (including
temperature). Yes, modern USB device implementations can get
away with a less accurate reference clock by locking the local
clock to the frame clock comming from USB. But that only works
for some classes of devices (i.e. has to run with 12MBit/s or less).
And it does not work for anything that can also be a USB host
as well (aka USB on the go).

Or: I was involved in the design of a logging device for shipment
tracking for insurance reason. Requirement from customer was to
achieve better than 10minutes over 2 years. That's 20ppm.
And we only got 10minutes after we told them that 1minute was
not physically possible given the size and power constraints.
And even that we only achieve when the parcel is constantly
in an air conditioned room, which, of course, is never the case.

Or: Any kind of radio/wireless application. Channel separation
requirements, even for low speed ISM band stuff are stringent
enough that you have to select your crystal carefully and can't
just take the cheapest one. Things that operate within the
2.4GHz band, like BT/BTLE, are even worse.

BTW: IoT devices are currently one of the major drivers behind
more accurate 32kHz crystals. Whether you have to wake up
for 10ms every hour or for 100ms makes a huge difference in
battery lifetime (in the order of factor 5). Similarly, cellphones
are a driving force behind (small) AT cut crystal accuracy.. 
or rather short-term drift. As less frequency drift means smaller
guard bands between different channels and within a channel. Which
directly translates into higher frequency utilization and thus
available bandwidth and money.

And we haven't even talked about anything that does precision
stuff, where having an accurate and stable clock source is often 
paramount for having accurate measurment. Neither have we talked 
about anything highspeed (i.e. beyond 50MHz) where timing margins 
become low enough that being even 0.1% off would not do.


> Many have factory trimmed RC oscillators, typical 1% accuracy, because
> accurate timing for other than timekeeping is rarely needed.

Keep in mind that the 1% RC oscillator is something relatively
new and they are 1% only at 25°C. Just 10 years ago, you
were lucky to get a device with an internal oscillator that would
be +/-10% at 25°C and 30% over temperature. Even a modern device
like the STM32F7xx family (IIRC 2-3 years old) is spec'ed at 4%
over temperature.

> A minute per month is 10ppm, typical of a bog standard crystal, and given
> the choice of that or mains timing for a clock, I'd use the latter any day.

A standard AT cut crystal is 10-100ppm accuracy out of factory
at 25°C and with 100% accurate capacitive loading. After soldering,
you are probably off by another 10-30ppm. And, depending on the 
actual cut angle, temperature variations add another 20-100ppm
on top of that. Yes, the "10ppm" value is misleading.

If you are talking about a 32kHz crystal, than its quadratic
temperaturure becomes a problem, E.g. at 0° you are already
off by an addtional -22ppm, at -10°C it's -43ppm. If we go
to the other extreme, it's -71ppm at 70°C and -106ppm at 80°C.
Those numbers, are of corse, if the temperature coefficient is
nominal. If you take the maximum tempco from the specs, the
numbers become -55ppm (-10°C), -28ppm (0°C), -91ppm (70°C)
and -136ppm (80°C). And we are still talking about quality
crystals here, with tightly controlled specs. A run of the
mill el-cheapo crystall will be quite a bit worse. Crystals
with >200ppm deviation over temperature are not uncommon.

Yes, this is a reason why Microcrystal crystals costs several
times of what you'd pay in China. And people are happy to pay that
premium as it shaves off a few dozen ppm from the end product and
crystals exhibit less aging, which in turn makes calibration
techniques work better. (My Swiss watches, after 20 years, are still
within 2ppm of nominal frequency over complete temperature range).

And, please do not forget that modern mains frequency control
is something quite recent as well. Especially outside (west) Europe.
Having mains frequency powered clocks being off several minutes
per month was the norm 50-70 years ago. This is, what drove
people to buy quartz crystal clocks back in the days.
Also, events have shown us, that gaining/losing a minute or two
within a month is still something you have to worry about
even with modern mains frequency control. Now think about places
where people don't have the Swiss, with their pedantic time keeping,
taking care of mains frequency.

			Attila Kinali

-- 
The driving force behind research is the question: "Why?"
There are things we don't understand and things we always 
wonder about. And that's why we do research.
		-- Kobayashi Makoto




More information about the Time-nuts_lists.febo.com mailing list