[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Using 60Hz mains frequency for timing?



> Just a quick non-gEDA design question -- I have the choice between
> using the zero crossings of the 60Hz mains voltage or my MCU clock
> (generated from an 18.432MHz quartz crystal producing a 48MHz CPU
> clock via PLL built into the MCU) for low-resolution timing.

"It depends." :-)

> Either one is easy to use -- I just want to be as accurate as
> possible.

I was going to say, it depends on whether you care about accuracy, or
short-term repreatability, or long-term repeatability, and on what
kinds of durations you'll be timing (seconds, minutes, hours, days).
But you specifically call out accuracy as your goal....

If the durations you're measuring are several hours or more, you're
probably more accurate with the mains (provided, of course, that you're
actually getting power-grid mains power; as someone else pointed out,
running off a generator or inverter will break the assumption of
accuracy of mains power frequency).  As others have remarked, mains
frequency is very accurate over the long term but wobbles a little in
the short term.

For short durations (less than several hours), the most accurate thing
I can think of offhand is to use both.  Use the mains frequency over
long periods (days) to measure what the crystal is generating, then use
that to measure the short duration in question.

Depending on your intended use, you may also want to consider the
possibility that you'll end up being fed 50Hz power (say, if someone
takes it to Europe - and runs it off a stepdown transformer, if you
don't use a universal-voltage power supply).

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@xxxxxxxxxxxxxxxxxxxxxx
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user