Maker Pro
Maker Pro

HOWTO Determine Unknown XTAL Freq

L

Lostgallifreyan

Some micros have two oscillators built in, so a reference xtal and a
DUT could be connected directly. But I can buy a lot of new
guaranteed-accurate crystals for the cost of the engineering to make
such an instrument.

I thought some microprocessors like that were meant to be very cheap,
designed to allow a realtime clock as well as the stuff for processing
timebased information. One of those might be ideal. Just tap the realtime
clock circuit for the reference.
 
L

Lostgallifreyan

0.5% typical of many multimeters

Typo, meant 0.3%, even 0.1%, certainly better than 0.58% should be had
from a freq/volt converter and multimeter...
 
S

Spehro Pefhany

---
The insurmountable problem I see with your approach is that no
matter what you do you can't use the µC's time base to determine its
own frequency since you'll either have to have a reference time base
running independently from your µC time base or, knowing the
frequency and accuracy of your µC time base, use it as the
referenced against which to measure the period/frequency of the
crystal being tested in a _separate_ oscillator.

Some micros have two oscillators built in, so a reference xtal and a
DUT could be connected directly. But I can buy a lot of new
guaranteed-accurate crystals for the cost of the engineering to make
such an instrument.
In either case what
you'll have built is a conventional frequency or period counter.

Yup. It might make more sense to just use the micro as an oscillator
and measure the frequency with a frequency counter! But even that
requires some programming (or configuration, at least) on many modern
micros.


Best regards,
Spehro Pefhany
 
S

Spehro Pefhany

I thought some microprocessors like that were meant to be very cheap,
designed to allow a realtime clock as well as the stuff for processing
timebased information. One of those might be ideal. Just tap the realtime
clock circuit for the reference.

Typically that's the intended purpose of the alternate oscillator. You
have to provide the external crystal and perhaps some additional
parts.

You don't necessarily have access to the internal nodes to make it do
what you want, it might take some external gates or it might not even
be possible to make it work well, depending on the particular
processor and peripheral implementation. For example, you might have
to live with jitter in the interrupt latency affecting the gate time
if the right hardware isn't in place internally.


Best regards,
Spehro Pefhany
 
J

jasen

In sci.electronics.basics said:
Yes, that's a problem for sure. I wonder how accurate is the 60 Hz
from the power company? A quick websearch didn't come up with
anything.

the yearly (or weekly) average is extremely good, but minute to minute
it's not all that hot - a cheap crystal keeps better time.
If it were reliable to a few PPM that might work as a
timebase. And IIRC the PIC devices have protective circuitry on the I/
O pins so all you need is a current-limiting resistor, say ten
megohms.

most people would run it through a step-down transformer first :)
Right. One that anyone with a PIC device could make in a few minutes
when needed, and repurpose for other uses afterwards.

pics are so cheap: why bother?

maybe you could make it so it gets its comparison time from a serial port

send it a pulse on the serial port (0 byte - 9 bit times worth of "+12V" on
an rs232) and it responds with the duration of the pulse in crystal cycles.

this way you compare the unknown crystal against the crystal in the serial
port.

Bye.
Jasen
 
Top