xtal & Frequency generator problem

Discussion in 'The Projects Forum' started by magnet18, May 18, 2011.

  1. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    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-
    [​IMG]

    But when I scope pin 9, where I should get 32.678 Hz, I get this-
    [​IMG]

    When I scope pin 1, where I should get 8 Hz, I get this-
    [​IMG]

    And when I scope pin 3, where I should get 2 Hz, I get this-
    [​IMG]

    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?
     
  2. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Is that really a quartz crystal or is it a ceramic resonator?
     
    magnet18 likes this.
  3. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    It says "crystal, 32.678 khz, 12.5pF"
     
  4. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    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:
     
    magnet18 likes this.
  5. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    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:
     
    magnet18 likes this.
  6. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    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.
     
  7. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    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?
     
    magnet18 likes this.
  8. magnet18

    Thread Starter Senior Member

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

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
    magnet18 likes this.
  10. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    You enjoying watching my brain melt, don't you? ;)

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

    Senior Member

    Jul 1, 2008
    2,223
    99
    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.
     
  12. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    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)
     
  13. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    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
     
  14. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    OK, so I attached the 4013, and when I scoped pin's 3 & 1 on the 4013 I get this
    [​IMG]
    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...
     
  15. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    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?
     
  16. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    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-
    [​IMG]
    So yea, I'm happy now :D

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

    Senior Member

    Jul 1, 2008
    2,223
    99
    Where do you see ringing? I don't see any in your screen shot.
     
  18. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    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
    [​IMG]

    Why was this so hard the first time?
     
  19. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Dunno, I wasn't there with you. :D

    Hey, it's past 1:00AM here. This old guy needs to get to bed.... You too! ;)
     
  20. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    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
     
Loading...