# Tool for measuring the frequency of a crystal oscillator

I am building a digital clock from sequential logic. I’m using a 32.768kHz crystal with a CD4060 IC.

I’m looking for a tool to measure the output frequency. I currently have it hooked up to an LED and it’s blinking somewhat irregularly.

Could a rough estimate also be read using a basic multimeter with a Hz function? I have a klein MM400. Would an oscilloscope be a good choice?

Edit: If anyone else is confused about how to select resistors and caps for these circuits I found this guide on CMOS oscillators http://www.ti.com/lit/ds/symlink/cd4060b.pdf

• You need an accurate frequency to compare f or T and null the difference frequency or match the time interval. In the 70's our grid was more stable than a GPS so I could compare my Doppler VLF Rx both scaled down to 1Hz. but these days frequency is used to control power flow between grids or reduce loads. GPS 1Hz or OCXO in a lab counter is best. or use your watch ;) – Tony Stewart EE75 Jan 3 '20 at 4:57
• How would you go about comparing it to an accurate frequency? – BobaJFET Jan 3 '20 at 5:17
• Timer, counter or tune cap and null beat frequency – Tony Stewart EE75 Jan 3 '20 at 5:18
• Compare the 1Hz LED blink to a ticking clock by eye. The phase should not change within a reasonable time period (a minute, an hour). – Bruce Abbott Jan 3 '20 at 5:24
• Q4 should have 2048 Hz signal, monitoring that pin will not load the oscillator in any way. You need to measure it to the number of digits that you want to test the accuracy against. If you read 2048 Hz you might be just above 2047.5 or just below 2048.5 this is 8Hz error on the 32k signal. – KalleMP Jan 3 '20 at 19:43

I would start with your Klein MM400's built-in counter. Based on its specs it seems to be able to measure frequencies from 1Hz to 50kHz. The problem is that it will only give you 3 or 4 digits of resolution, not enough to judge whether or not it's accurate enough for your clock. Don't try to measure the frequency right at the crystal terminal to avoid killing the oscillator completely, or loading it in such a way that causes frequency shift. Measure it at some buffered clock net instead.

Scopes are typically not a good choice for accuracy better than 1%, unless it has a built-in frequency counter, like some not-too-expensive Rigol models.

Technically speaking, your best option is to use a dedicated frequency counter, which can measure even more than 10 digits (depending on the accuracy of their internal frequency references)!

Since you're actually building a digital clock, your best option is to simply measure the time drift after a certain period of time (one day, for instance). You will need a reference clock, which can be as simple as cell phone clock, which should be accurate at least down to a second, or a time stamp from a computer running ntp (network timing protocol).

• I’d like to use a trimmer capacitor to make adjustments but I don’t currently have one. The bigger issue at the moment seems to be actually getting a reading from my multimeter. Where should I be placing the probes? Across the LED? The meter seems to always read 60Hz. – BobaJFET Jan 3 '20 at 5:44
• If the meter is measuring 60Hz, you probably have at least one of the probes opens, which is working as an antenna capturing the AC power signal. I would start probing the 2 Hz net shown in your schematic. – joribama Jan 3 '20 at 6:46
• My multimeter suddenly woke up and started giving me actual numbers now! – BobaJFET Jan 3 '20 at 6:49
• Also keep in mind that the crystal nets are extremely critical. The wiring should be as short as possible and the ground connections from C1 and C2 should go directly to the CD4060 pin. – joribama Jan 3 '20 at 6:52
• I actually tuned an RTC to within a minute a year using 4 digits. The RTC had a useful 512 Hz output for tuning purposes. – Jan Dorniak Jan 3 '20 at 12:53

If the flashing looks irregular to you, then it's waaaay too unstable for a clock, and something is wrong. A divided crystal will look stable to the naked eye.

Use your meter's Hz function by all means, but on the buffered crystal output or high up on the divider to get reasonable resolution, not the 1Hz output.

Once it looks stable, then you can compare it to various time signals that are available depending on where you live. In Europe, there are 16kHz and 60kHz broadcast as time signals, and in the UK broadcast 198kHz is stable enough for clocks. Or if you have a 1s GPS output, compare the phase of the two with a two channel scope over a long enough period, minutes, hours or days.

• I think the issue might be that my IC is not supplying enough current to my LED which recommends 10mA. When I push down on the jumper wire it will sometimes stabilize. Even when it is stable, my multimeter ALWAYS reads 60Hz. How should I go about probing the circuit? – BobaJFET Jan 3 '20 at 5:08
• An LED that 'recommends' 10mA.should work fine on less, just not as bright. "When I push down on the jumper wire it will sometimes stabilize." - bad breadboard? Sort your connection problems before looking for other things to blame! – Bruce Abbott Jan 3 '20 at 5:19
• I edited in a schematic of my circuit. See where those 6.8 M Ohm resistors are? I didn’t have anything above 1M so I had to chain together about 15 resistors in series... Could this be what’s causing the instability? – BobaJFET Jan 3 '20 at 5:59
• Yes. Solder the crystal part of the circuit onto perf board or similar. You should be able to use much smaller resistors, like 1M, and still have it work, those high values are for low power consumption, experiment. Breadboard is for proof or principal, not for stability. – Neil_UK Jan 3 '20 at 7:50
• Almost every schematic i’ve seen uses large resistors like that. Some as much as 15M. How can I calculate how small the resistors should be? The data sheet says the resistors are = “broader frequency response” – BobaJFET Jan 3 '20 at 17:13