0
\$\begingroup\$

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

Circled to the left is the circuit I am using on the breadboard. Ignore the IC to the right.

\$\endgroup\$
  • \$\begingroup\$ 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 ;) \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jan 3 at 4:57
  • \$\begingroup\$ How would you go about comparing it to an accurate frequency? \$\endgroup\$ – StrugglingStudent117 Jan 3 at 5:17
  • \$\begingroup\$ Timer, counter or tune cap and null beat frequency \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jan 3 at 5:18
  • 1
    \$\begingroup\$ 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). \$\endgroup\$ – Bruce Abbott Jan 3 at 5:24
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – KalleMP Jan 3 at 19:43
1
\$\begingroup\$

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).

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – StrugglingStudent117 Jan 3 at 5:44
  • \$\begingroup\$ 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. \$\endgroup\$ – joribama Jan 3 at 6:46
  • \$\begingroup\$ My multimeter suddenly woke up and started giving me actual numbers now! \$\endgroup\$ – StrugglingStudent117 Jan 3 at 6:49
  • \$\begingroup\$ 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. \$\endgroup\$ – joribama Jan 3 at 6:52
  • \$\begingroup\$ 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. \$\endgroup\$ – Jan Dorniak Jan 3 at 12:53
2
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ 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? \$\endgroup\$ – StrugglingStudent117 Jan 3 at 5:08
  • 1
    \$\begingroup\$ 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! \$\endgroup\$ – Bruce Abbott Jan 3 at 5:19
  • \$\begingroup\$ 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? \$\endgroup\$ – StrugglingStudent117 Jan 3 at 5:59
  • \$\begingroup\$ 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. \$\endgroup\$ – Neil_UK Jan 3 at 7:50
  • \$\begingroup\$ 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” \$\endgroup\$ – StrugglingStudent117 Jan 3 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.