Author Topic: A drifting clock suddenly doesn't drift?  (Read 3415 times)

0 Members and 1 Guest are viewing this topic.

Offline ToBeFrankTopic starter

  • Regular Contributor
  • *
  • Posts: 234
  • Country: us
A drifting clock suddenly doesn't drift?
« on: July 29, 2013, 03:15:50 pm »
I bought a new microwave about a year ago. It has a clock display, which is nice, but it was fast by about 15 minutes a week. It was annoying, but I wasn't too worried about it since the oven below also has a clock. I just assumed the oscillator they were using for their time was off.

However, about 3 weeks ago during a storm, the power went out. When the power came back on, we reprogrammed the clocks. Lo and behold, the clock on the microwave is now spot on and doesn't drift at all. How can that be? Could they be doing a calibration step that got messed up the first time I powered up the microwave?
 

Offline KJDS

  • Super Contributor
  • ***
  • Posts: 2442
  • Country: gb
    • my website holding page
Re: A drifting clock suddenly doesn't drift?
« Reply #1 on: July 29, 2013, 03:32:26 pm »
It is very unlikely to be a calibration issue. It's possibly a dry joint around the crystal, or else the crystal has started again at a slightly different frequency when powered back up. That normally happens, though it's not normally as substantial as 15 seconds a week.

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: au
Re: A drifting clock suddenly doesn't drift?
« Reply #2 on: July 29, 2013, 10:17:14 pm »
Some clocks use the crystal for the timing, while others use the mains frequency.  If the latter type, I wonder if the drift could have been caused by interference on the mains (extra counts)?  Then if so, is whatever was causing that interference now absent?

Of course the real cause could be something quite different, but it never hurts to think beyond the usual ones.
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: A drifting clock suddenly doesn't drift?
« Reply #3 on: July 30, 2013, 01:58:53 am »
I'll bet it's line frequency derived, after all why wouldn't it be?

If so, imagine this:  you need to read the 50 or 60Hz line frequency, so you look at the AC wave coming off the electronics power transformer using say a diode.  Since the voltage is a bit high and unregulated, to get that into your micro you go through a resistor divider into the base of a transistor.  Say the gain on the transistor is poor and/or the resistor divider isn't quite driving the transistor adequately, so that it gets a half decent signal out the collector but every time there's a bit of noise from the fridge coming on during a high cycle it drops out and gets an extra count.  (BTW - last week I was messing around with a line derived clock signal in this fashion, and that's exactly what happened when my biasing was off.)

A nasty spike comes out down the power lines and gives the lower resistor (lower value) on the divider a zap, increasing it's value a bit.  Now the transistor is getting a stronger signal and it doesn't count the dropouts anymore.

One can easily see how something like that can slip past QC at the plant.  Maybe a combination of marginal components, marginal design and a little extra noise on your personal power lines caused the initial issue.  Anyway I've learned not to complain when problems fix themselves.  :)



 

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1217
  • Country: us
Re: A drifting clock suddenly doesn't drift?
« Reply #4 on: July 30, 2013, 11:17:17 am »
There's almost certainly an oscillator in there to drive the clock for whatever logic is running the microwave, and that logic is almost certainly running the clock as well.  If I had to guess, I would guess that you have some configuration pin in there somewhere that's floating and causing the wrong timebase to be used.
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: au
Re: A drifting clock suddenly doesn't drift?
« Reply #5 on: July 30, 2013, 11:28:10 am »
The 15 mins gain over a week is only 0.15 of one percent error.  The long term accuracy of the mains frequency is better than a typical crystal oscillator.
 

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1217
  • Country: us
Re: A drifting clock suddenly doesn't drift?
« Reply #6 on: July 30, 2013, 11:42:00 am »
Even the crappiest quartz watches aren't off by 15 minutes per week....or even 15 seconds per week.  It would seem crazy to me to go through the trouble of using mains frequency when there's a perfectly good clk already in the logic.

Anyhow, it can be anything, I suppose.  That's just a guess.

« Last Edit: July 30, 2013, 11:49:05 am by John Coloccia »
 

Offline ToBeFrankTopic starter

  • Regular Contributor
  • *
  • Posts: 234
  • Country: us
Re: A drifting clock suddenly doesn't drift?
« Reply #7 on: July 30, 2013, 03:36:52 pm »
There's almost certainly an oscillator in there to drive the clock for whatever logic is running the microwave, and that logic is almost certainly running the clock as well.

This was my thought as well, which is why I was so confused how it could be so far off and then suddenly be spot on.
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: A drifting clock suddenly doesn't drift?
« Reply #8 on: July 30, 2013, 06:47:16 pm »
  It would seem crazy to me to go through the trouble of using mains frequency when there's a perfectly good clk already in the logic.

But it is substantially cheaper than a ~0.17 crystal, and the uC clock can therefore be a simple RC oscillator.  It's also deadly accurate (over time).  And the microwave has to be plugged in for it to work anyway.

For nice accurate quartz operation you'll likely have to do a bit of trimming anyway.  Before NTP set clocks in everything, I'm sure you remember computer motherboard clocks drifting quite bad since they never bothered trimming them too well.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16342
  • Country: za
Re: A drifting clock suddenly doesn't drift?
« Reply #9 on: July 30, 2013, 08:24:26 pm »
PC clocks still drift, as they always pick up stray pulses from the rest of the logic, which is worse as the current method is to have the RTC as a part of a chipset with high speed clock pulses running on the traces next to the clock crystal, and the crystal being quite far away from the BGA package electrically speaking. They all gain time unless you use NTP to do correction.
 

alm

  • Guest
Re: A drifting clock suddenly doesn't drift?
« Reply #10 on: July 30, 2013, 11:20:44 pm »
A good NTP implementation will correct for this however: it will change the effective clock rate (time increment per tick) to minimize drift. So as long as the number of stray pulses is fairly constant, it should reduce in a fairly low drift rate as long as the computer is on. Of course the hardware RTC is too stupid to correct for this, so the clock will still drift when the power is off.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf