On Thu, Mar 8, 2018 at 9:16 PM, Barry Roberts <b...@robertsr.us> wrote:
> It's not Linux-related, but I'm curious what other nerds think.  I was
> listening to KUER on the way home from work tonight, and they were
> talking about this:
> https://www.theverge.com/2018/3/8/17095440/europe-clocks-running-slow-electricity-frequency-kosovo-serbia
>
> I don't know if I've ever owned a clock that would act like that.
> Maybe some really old clock with an AC motor.  But they talk about the
> clock on a microwave, and show a digital clock on a stove.  Those all
> have crystal oscillators that run on DC and I'm pretty sure would not
> be affected at all by a .1% change in the AC frequency (that number
> was from the radio  --.1% or 344 seconds in about 6 months, I think).
>
> Am I crazy?  Are there really a bunch of clocks in Europe that
> actually depend on the 50hz alternating current frequency for
> timekeeping?  The whole thing sounds like some non-technical reporter
> grossly misunderstanding electronics to me.
>
> Barry

All microcontrollers have some kind of oscillator for their
high-frequency clock, but they don't all have a crystal oscillator.
Low-cost ones might have an internal RC oscillator (i.e. one that
oscillates based on a resistor/capacitor time constant) that typically
isn't nearly as accurate as a crystal oscillator and is sensitive to
voltage level changes, but gets the job done for simple control tasks
like monitoring a keypad and turning on relays. It *is* very common to
put a quartz watch crystal (32768Hz resonant frequency) in
microcontroller devices, but those are typically only accurate to 20
or 50 parts-per-million. That sounds good, but small errors accumulate
pretty quickly when you're oscillating at tens of thousands of cycles
per second. With a cheap one, it's easy to accumulate minutes of error
per month. Wristwatches typically use some sort of
calibration/compensation mechanism to get things to around 5ppm, plus
they stay pretty temperature-stable thanks to being worn next to a
human body, which has a pretty nice internal temperature stabilization
mechanism. That kind of compensation isn't typically built into
microcontrollers, though, which very often don't really care about
long-term timing accuracy.

On the other hand, if your device is plugged into the wall, you have a
nice 60Hz (or 50Hz in Europe) signal with which to count the passing
of time. This varies a bit during the day, but it's used for
timekeeping enough that they typically try to re-synchronize it during
the evening. Thus, you can get more accurate long-term timekeeping by
synchronizing to the mains frequency rather than relying on a
high-frequency crystal oscillator, and it's cheaper too! This is an
interesting page that attempts to measure the stability of the mains
60Hz signal: http://www.leapsecond.com/pages/mains/

I haven't examined the control circuitry of any digital microwaves or
ovens lately, but I did look at some microcontroller datasheets; many
explicitly had RTC modules that described setup procedures for using
either a 32768Hz crystal or a 50/60Hz mains zero-crossing timebase. So
it must be a reasonably common thing to do, especially in
cost-optimized devices that are always plugged in. In countries that
have had their mains frequency regulated like this for timekeeping
purposes, there are likely to be a lot of devices that do in fact rely
on it for timekeeping, even if they're digital devices that largely
run on DC. Getting a pulse at the zero crossing point of the mains
power is not a difficult bit of circuitry, and is most likely cheaper
and has better long-term timekeeping potential than a crystal if you
don't already need a crystal for some other reason.

    --Levi

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to