xtal & Frequency generator problem

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Alright, I finally built something that works for this nixie clock (I WILL finish this before school gets out if it kills me.)

I got the frequency generator working, unfortunately, my scope says the frequencies are all wrong :(

Schematic-


But when I scope pin 9, where I should get 32.678 Hz, I get this-


When I scope pin 1, where I should get 8 Hz, I get this-


And when I scope pin 3, where I should get 2 Hz, I get this-


Would using a fixed 39pF cap cause any issues instead of using the variable cap in the schematic? I know it will be less accurate since it can't be fine tuned, but would it make it THAT inaccurate?

Bad 4060?

Thoughts?
 

Attachments

CDRIVE

Joined Jul 1, 2008
2,219
Possibly, the reason you haven't received many replies to this problem is because everyone is scratching their heads! :confused:

I checked National's 4060 data sheet and didn't see anything drastically different from their Xtl osc. example and yours. :confused::confused:
 

CDRIVE

Joined Jul 1, 2008
2,219
I'm getting more confused by the second. Pin 9 should be reading the oscillator frequency 32.768KHz not 32.768Hz. Further confusing the issue is this...

If we start with an oscillator frequency of 32.768KHz to produce an output frequency of 2Hz then that dictates that the 4060 divides by 16,384. Using this logic, it stands to reason that if you're reading an oscillator frequency of only 11.11Hz then the output of the 4060 should be .0006781005859375Hz. :confused:
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Hmm... possibly my scope?
It might be mad at me from when I was probing in the field of my plasma speaker... I'll divide further with the 4013 and use a stopwatch, see what the frequency is.
 

Adjuster

Joined Dec 26, 2010
2,148
Part of your problem is likely to be due to aliasing in your scope. Sampling should be at least twice the highest frequency to be measured, or expect frequency shifts- and your scope seems to be running at 100 samples/sec?
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
It could be that, I'll try it at a higher sampling rate, but that doesn't really explain the 3hz signal...
 

SgtWookie

Joined Jul 17, 2007
22,230
If your xtal doesn't have the proper capacitors around it, it could be operating in the 3rd overtone mode.
http://en.wikipedia.org/wiki/Crystal_oscillator
Overtone modes are briefly explained under "Resonance modes" in the above Wiki article.

Here's an interesting (and related) quote from further down in the article:
A badly designed oscillator circuit may suddenly become oscillating on an overtone; in 1972, a train in Fremont, CA crashed. An inappropriate value of the tank capacitor caused the crystal in a control board to be overdriven, jumping to an overtone, and causing the train to speed up instead of slowing down.
I'm not sure what exact type of crystal you are using. It might be an XY type, which is a "tuning fork" type - the 2nd overtone is about 6x the fundamental frequency.

If you have the circuit on a breadboard and/or with long looping wires, you'll have a good bit of parasitic capacitance/inductance that will be hard to compensate for. When tuning the caps for an xtal oscillator, we would temporarily solder in a couple of adjustable caps, tune it for best output waveform, and then remove, measure, and solder in fixed caps of the values measured. That was for high precision stuff; you probably don't have to be quite that accurate.

You can't measure the xtal output directly, as your probe will add a LOT of capacitance to the circuit (possibly 30pF to 100pF), so will load the circuit too much, throwing the frequency way off. Your input won't match your output. What you might be able to do is just hold the probe very close to one of the leads, and the signal will be capacitively coupled to the probe. The signal measured will be a lot lower than if you were actually on one of the leads, but if you are not too close, you won't affect the frequency of the oscillator.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
If your xtal doesn't have the proper capacitors around it, it could be operating in the 3rd overtone mode.
http://en.wikipedia.org/wiki/Crystal_oscillator
Overtone modes are briefly explained under "Resonance modes" in the above Wiki article.

Here's an interesting (and related) quote from further down in the article:


I'm not sure what exact type of crystal you are using. It might be an XY type, which is a "tuning fork" type - the 2nd overtone is about 6x the fundamental frequency.

If you have the circuit on a breadboard and/or with long looping wires, you'll have a good bit of parasitic capacitance/inductance that will be hard to compensate for. When tuning the caps for an xtal oscillator, we would temporarily solder in a couple of adjustable caps, tune it for best output waveform, and then remove, measure, and solder in fixed caps of the values measured. That was for high precision stuff; you probably don't have to be quite that accurate.

You can't measure the xtal output directly, as your probe will add a LOT of capacitance to the circuit (possibly 30pF to 100pF), so will load the circuit too much, throwing the frequency way off. Your input won't match your output. What you might be able to do is just hold the probe very close to one of the leads, and the signal will be capacitively coupled to the probe. The signal measured will be a lot lower than if you were actually on one of the leads, but if you are not too close, you won't affect the frequency of the oscillator.
You enjoying watching my brain melt, don't you? ;)

Thanks! I'll give it a shot tonight :D
 

CDRIVE

Joined Jul 1, 2008
2,219
There's no reason for you to measure directly across the osc. Pin 9 is nothing more than an inverter used as a buffer.

This is a shot in the dark but try removing the crystal from the circuit and running it again. There is no way on God's green Earth that the crystal could be oscillating at 11.11 Hz.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Ok, I measured pin 9 again on a much higher setting, this time I got 31-35 khz, depending on how far my head was tilted and how many romulans were orbiting jupiter.

Right now my scopes frozen because I was spamming the "run" button :p


Interestingly, the signal at pin 9 was only 5 volts this time (plugged into the 12 volt port), and even when the power supply was turned off, it still oscillated at 5 volts...
(It stopped when I unplugged the circuit, thank goodness)
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Right, it seems to oscillate at 31.2 khz at pin 9 (even with the smps off), but I'm having trouble getting a good reading on pin 1 or 3
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
OK, so I attached the 4013, and when I scoped pin's 3 & 1 on the 4013 I get this

So either my scope is jank, or theres a problem in the crystal setup, or theres a problem with my understanding of a 4060.
I'd say those all have the same probability.

[EDIT]
I think I'm going to invest in a capacitance meter...
 

Attachments

CDRIVE

Joined Jul 1, 2008
2,219
You're almost there. The osc. freq needs to be lowered a tad. Just increase the value of C2 a bit. Did you replace it with a trim cap yet?
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
BEAUTIFUL!!
I installed the variable cap, and after playing with it I wasn't getting it anywhere so I just turned it around randomly out of frustration and ran the scope, got THIS-

So yea, I'm happy now :D

I see a bit of ringing, but it doesn't bother me (or the circuit)
 

Attachments

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Sorry, ringing was the wrong word, I was just referring to the lil bit of noise on the first full low portion of the 2hz signal.
Also, I just added the first decade counter, also works great :D


Why was this so hard the first time?
 

Attachments

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Well, at least the world didn't end :rolleyes:
And it's friday, who needs sleep?
As long as I get my 8 hours in before I go shovel bird crap, I should be good :D
 
Top