Measuring the frequency of crystal oscillator with high accuracy

Thread Starter

One Does Not Simply

Joined Oct 20, 2024
15
Hi. I am looking into a project that would involve measuring the frequency of crystal osc. Aim is to measure accurately without using lab bench equipment. Accuracy: enough to track its deviation from nominal frequency. Nominal freq. of crystal: not decided yet but preferably 10/20 MHz.

I'm considering using binary counters like the SN74HC4020 (14-bit async. binary counter) and SN74LV8154 (dual 16-bit binary counter) for this purpose. A 12 to 14 bit binary counter would be enough measure the deviation without overflowing. Smaller counters would also work with cascading and overflowing

Is this a good approach? I'd appreciate any insights on potential challenges or better alternatives.
 

boostbuck

Joined Oct 5, 2017
1,039
If you think it through, you'll realise that you need to measure it against a more accurate standard of some kind.

A GPS 1PPS receiver might be a good place to start.
 

Thread Starter

One Does Not Simply

Joined Oct 20, 2024
15
Hi One,
How are you planning to measure the precise period over which you are counting the crystal frequency??

E
PPS from a ublox GPS Module. I haven't looked too much into it, but I think these modules can be configured to output a say 10 khz signal. That would form a accurate-ish time reference. Polling a stratum 1 NTP server would also probably work

I am aware that any such count of OSC cycles is only as accurate as of the time used for the period of measurement. It is not quite straightforward without an on-site atomic clock. However, at the moment I am concerned about the counting itself and overall feasibility of project.
 

Thread Starter

One Does Not Simply

Joined Oct 20, 2024
15
If you think it through, you'll realise that you need to measure it against a more accurate standard of some kind.

A GPS 1PPS receiver might be a good place to start.
Yes, I have thought about that. I have looked into PPS signals from GPS modules and they seem accurate-ish. However, at the moment I am concerned about the counting itself and overall feasibility of project.
 

MisterBill2

Joined Jan 23, 2018
27,315
For starters, the accuracy of any frequency counter is limited by the accuracy of it's time base. The repeatability is limited by the stability of the time base rather than the accuracy.
In addition, the stability of the input section of the counter can contribute to phase issues. And one thing that I ran into early in my career with long counters is the propagation time of the counter chain. So I suggest avoiding counters working in the ripple-carry mode. The parallel clock mode does not suffer that issue.
AND, whatever scheme you use, understand that the power supply voltage must also be stable, since power noise can also affect digital thresholds enough to cause a problem sometimes.
 

ronsimpson

Joined Oct 7, 2019
4,661
measuring the frequency of crystal osc .................... preferably 10/20 MHz.
WWV and WWVH transmit a radio signal at 2.5 MHz, 5 MHz, 10 MHz, 15 MHz; 20 MHz. This is the standard.

I have a frequency counter that is very good. It has a standard that I can adjust a very small amount. To calibrate my counter, I turn on my short-wave radio and listen at 10 Mhz. Then I turn on the counter and let it warm up for an hour. If my counter was off my 100hz I would hear a 100hz tone in the radio. (beat frequency) Normally It is much much closer. If the two standards are 1hz apart the signal strength meter will move up/down at 1hz. I usually try for 0.1hz. (every 10 seconds)

The point is, get a short-wave radio and see if you can hear WWV at 10mhz and use it to measure your crystal.
I have no problem hearing the signal, one of the transmitters is close to me. I can also hear other standards from far away.
 

AnalogKid

Joined Aug 1, 2013
12,087
There is nothing wrong with your approach, which raises a question.

There are binary and decimal counters in many logic families that will count / divide accurately at 20 MHz. But if you build an 8-digit decimal counter, or a 24-bit binary counter with decoding, and create a more accurate 1 Hz gate signal using a GPS receiver, how is this different from buying a commercial frequency counter?

How much is your time worth?

ak
 

MisterBill2

Joined Jan 23, 2018
27,315
I am guessing that this question may be related to a frequency measuring contest. Or maybe not. "Stability" and "accuracy" are quite different for a frequency source. And "precision" is just a word used to describe hardware quality.
 

ronsimpson

Joined Oct 7, 2019
4,661
I have one of these. (a very old version) It is as good as any crystal. I think your version will not be as good. There is a 50Mhz version for the same money.
1730904802275.png
I spent $4000 on a commercial version of this, many years ago.
1730905010978.png
There are many $50.00 counters on the market. Watch out some only count RF. Some do not go below 50Mhz.
 

MrChips

Joined Oct 2, 2009
34,698
Yes, you can build your own frequency counter with off-the-shelf digital ICs.

Points to note are that in order to measure frequency deviation from a standard, you have to measure frequency to better than 1 ppm. Hence you need to display 7-8 digits and count for at least 10 seconds. In other words, you want 0.1 Hz resolution.

As others have said, your measurement is only as good as your time-base. Hence at the very least, you want to use a TCXO oscillator (temperature controlled crystal oscillator). The absolute accuracy of the frequency is not as important as its temperature stability. However, you can always calibrate the TCXO against a known frequency standard.
 

MisterBill2

Joined Jan 23, 2018
27,315
I have one of these. (a very old version) It is as good as any crystal. I think your version will not be as good. There is a 50Mhz version for the same money.
View attachment 335202
I spent $4000 on a commercial version of this, many years ago.
View attachment 335205
There are many $50.00 counters on the market. Watch out some only count RF. Some do not go below 50Mhz.
OK, Ron, and I will wager that the one you bought is still more accurate and more stable than this one shown here. In addition, if your counter ever has a component failure it can be repaired. And probably yours is accurate at more than one temperature.
 

ronsimpson

Joined Oct 7, 2019
4,661
Years ago, frequency standards came in an oven to hold the temperature stable. I have not seen one in a new design for many decades. Most crystals oscillators are pretty good over temp.
 

MisterBill2

Joined Jan 23, 2018
27,315
Years ago, frequency standards came in an oven to hold the temperature stable. I have not seen one in a new design for many decades. Most crystals oscillators are pretty good over temp.
I remind all that the TS asked to do it "without lab bench equipment. I would use my HP counter. Did not cost $4000, it was marked as scrap, not working.
The failed part was a resistor in the input attenuator. I used a 10% resistor because accuracy there does not matter to me. It has functioned perfectly ever since. Is a SW receiver a lab bench item??
And we never did learn what the actual frequency would be. Two or five MHZ could put a harmomic on top of WWV and allow a good comparison as to stability.
 

ronsimpson

Joined Oct 7, 2019
4,661
Accuracy: enough to track its deviation from nominal frequency.
We need to know what stability you want. 1 part in a million or 1 part in a billion or 0.1PPB. It all depends on the price. If you can stand 1,000,001 stable, we are talking $3:00 but 1,000,000,001 we are talking $1000. and I can find $3000 oscillators.

I just pulled a part out of the cabinet at radon. $2.00
From -30C to +85C the temp moves +/- 2 ppm max.
Over supply voltage range +/- 0.2ppm
In a year 1ppm
This is a low-cost part. I can fined 1000x better numbers, but it will break the bank.
1730935430476.png
 

MisterBill2

Joined Jan 23, 2018
27,315
So far what we are given is this: Quoted from post #1:" involve measuring the frequency of crystal oscillator. Aim is to measure accurately without using lab bench equipment. Accuracy: enough to track its deviation from nominal frequency." So evidently the goal IS NOT to accurately control a frequency, but to develop a non-instrumented way to do it. So a lot of folks have wasted bandwidth offering advice for the wrong goal.

Consider that the ARRL group runs a yearly frequency measuring contest for precisely measuring and reporting the exact frequency of a transmitted signal, could this be the TS seeking help for that contest???
ARRL= American Radio Relay League, for those who did not know.
 

Thread Starter

One Does Not Simply

Joined Oct 20, 2024
15
We need to know what stability you want. 1 part in a million or 1 part in a billion or 0.1PPB. It all depends on the price. If you can stand 1,000,001 stable, we are talking $3:00 but 1,000,000,001 we are talking $1000. and I can find $3000 oscillators.
Stability of? The OSC to be measured? The OSC to be measured is a standard XO. Typically they have a few 10s ppm stability. https://portal.iqdfrequencyproducts.com/products/datasheets/LFSPXO018032.pdf (a random XO i picked, nothing particular).
 

Thread Starter

One Does Not Simply

Joined Oct 20, 2024
15
Long post ahead
______________________________________________

I am currently pursuing my undergrad engineering degree in India. Over the next 1 or so year, we will need to build a major project for graduation. I am exploring some ideas for that. This is one of them.
______________________________________________

Original idea was: a clock that is as accurate, as stable as possible, without being atomic or relying on any other exotic technology. The time reference would come from GPS or a Stratum 1 NTP server.

I spent some time thinking and researching about it. It would primarily involve two stages: measuring the exact (or as close to it as possible) frequency of the OSC and then based on that generating a control signal to correct it. It could be implemented in analog as a PLL or in digital. I initially picked a digital (more on that later) solution. The OSC to be measured would be a basic standard XO of some frequency [more on that later], their stability usually in a few 10s of ppm.

So there are two challenges: one is measuring and other is controling/correcting.
______________________________________________

I am not yet aware exactly how big/complex the project needs to be or how much off-the-shelf components can be used. So the actual implementation may or may not involve the second stage, hence for the moment I am focussed only on the first stage.
______________________________________________

Implementation itself would have many challenges of its own.
  • First, total project cost should be upto USD 100. This would be a team project. I could spend upto USD 50-70 personally, but I am not so sure about others.
  • I am not sure about whether or not I can get hands on lab equipment in my college for testing. Hence, I will try to keep it straightforward and try to preemptively watch out for issues before begining implementation.
  • My choice of components is restricted for financial reasons or general availability. Also SMD is probably not an option.
    • Based on this, I can only expect a basic standard XO of probably unknown stability to be available. I would try for 10/20 Mhz XOs, but I may have to settle for lower frequencies.
    • Most XOs, especially the TCXOs, are usually small SMDs, so they are mostly ruled out.
  • My team. I can reasonably expect to be doing a large majority of the technical work, or at least it seems so at the moment. I also cannot work full-time on the project. That would further limit what can be done
______________________________________________


A PLL based off of a say 20 MHz radio would be relatively elegant and straightforward. However, I decided against a PLL initially. Also no lab-bench equipment.

PLLs now seem as a better option than I initially thought. They have their challenges but still open them.
______________________________________________

I am not sure about the exact resolution and accuracy required and I am not sure of the calculations to be done.
______________________________________________

Power supply and time base are the major challenges as mentioned.

Heres what I think I can use for time-base:
  • 10 KHz PPS from GPS Module. Cheapest and probably least stable
  • Off-the-shelf TCXO. Expensive and limited options but straightforward and about as stable as I can get
  • A manual implementation of TCXO. Challenging (enough to be a stage or project on its own), but maybe less expensive and available

Heres what I can use for counting:
  • Built-in counters in microcontrollers. Very straightforward but I don't know if they are as good as the dedicated ICs
  • Dedicated digital ICs. SN74LV8154 looks a good option as it is SMD, cheap and available from what I can see, and can count 10M/20M cycles natively with minimal overflows.
  • FPGAs. Completely uncharted territory but immensely powerful

My main concern at the moment is how are the first two above counting solutions? What challenges/pitfalls do they have on their own besides the previously mentioned ones?
______________________________________________


I want to make sure that I understand the mentioned challenges correctly.

The time-base challenge is that period over which the count of OSC cycles is measured may
i) not exactly be 1 second (or some other time decided),
ii) itself may change over time

i) limits absolute accuracy of measurement (eg., measured 9.98MHz actual as 9.96MHz). ii) limits the relative accuracy between measurements (eg., comparing a count over 1.01 second period with a count over 1.02 second period). Both are influenced by the stability and calibration of time-base

The power supply challenge is that the exact counting can be trigerred at different times depending upon changes in power supply voltage. However, its not clear how it would affect my situation. It seems a propagation delay problem
 

MrChips

Joined Oct 2, 2009
34,698
I believe that you are over-thinking this problem.

I took a quantity of off-the-shelf 8MHz quartz crystal oscillator modules and measured the accuracy and stability on a frequency counter at 1-second and 10-second sampling periods.

Overall, the modules were accurate to ±0.0025% or 25 ppm
and stable to ±0.00001% or 0.1 ppm.
 
Top