Crystal Oscilator

Discussion in 'General Electronics Chat' started by Rocky_circuits, Nov 8, 2011.

  1. Rocky_circuits

    Thread Starter Member

    Nov 1, 2011
    47
    0
    I just made a crystal oscilator from the following circuit:
    [​IMG]



    But I seem to have a problem. I have found that I can get these frequencies:
    Pin 1- Unkown
    Pin 2- Alternation between 64.1KHz and 67.6 KHZ, sometimes 33.3KHz. The duty cycle ranges from 10%-20%
    Pin 3- Same as above (as far as I can tell maybe the oscilator can't detect this low maybe?)
    Pin 4- 515Hz
    Pin 5- 1.02KHz
    Pin 6- 258Hz
    Pin 7- 2.05KHz
    Pin 8- Same as pins 2 and 3
    Pin 9- 32.9KHz @ 48.7% duty cycle
    Pin 10- 32.9KHz @ 51.3% duty cycle
    Pin 11- Clock>
    Pin 12- GND
    Pin 13- 64.1Hz @ 50% duty cycle
    Pin 14- 128Hz @ 51.3% duty cycle
    Pin 15- 31.9 @ 50.3% duty cycle
    Pin 16- VDD

    So here is what I think the problem is.. the circuit says to have a 15MΩ resistor. I used a 10MΩ+5.1MΩ because that is the closest my university electronic store could get me. Everything else is exact I think. My 10p capacitor has a label saying 10k on it but I'm not really sure how to read those ceramic capacitors that are used there.
    What could be the problem?

    In the end I want 1Hz.
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I don't see an 0.1uF cap from pin 16 to ground.
    It's not optional.

    You may need to increase C2 a bit.
     
  3. Rocky_circuits

    Thread Starter Member

    Nov 1, 2011
    47
    0
    Alright, I can fix that. Would not having that capacitor have permanently harmed any parts of the circuit?
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,355
    Try removing C2 and C3 and see what happens.
    Try 10M instead of 15M.
    What kind of power supply are you using?
    What kind of breadboard are you using?
    Can you post a photo?
     
  5. crutschow

    Expert

    Mar 14, 2008
    12,988
    3,226
    How physically big is the cap? I believe it is 10,000 pF.
     
  6. Rocky_circuits

    Thread Starter Member

    Nov 1, 2011
    47
    0
    A capacitor between Pin 16 and ground? Pin 16 goes to Vdd though.

    Here's a picture of it:
    [​IMG]


    Uses I think a "Datak" board. Has copper eyes. I'm using a power supply in the lab that I set to 5 volts. Says it pulls 0.002A or 2mA
     
  7. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,355
    Nice photo. Thanks for posting.

    Mistake #1
    Where is your connection to pin 8? This is your GND pin, not pin 12 (but still connect 12 to GND too).

    Mistake #2 - do not run wires to the xtal circuit like you did with the orange and green wires. Sorry, you will have to do over your circuit. Get all your components as close as possible to pins 10 and 11.
    Sometimes the circuit that the manufacturer suggests does not always work. You can try using just the 10M and Xtal connected to pins 10 and 11 (omitting the 5M and 330K) if things do not work. Also the ground end of the small caps have to be close to pin 8.

    And as Wookie says, 100nF between pins 8 and 16 (not any further away from these pins).
    Also add 10uF electrolytic between pins 8 and 16.
     
    Last edited: Nov 8, 2011
  8. Rocky_circuits

    Thread Starter Member

    Nov 1, 2011
    47
    0
    Ah shoot, I'll go ahead and make the adjustments like you guys said. I also need another chip as just this one will only allow a 2Hz pulse if it actually worked. I'll post back when I make the modifications. Thank you!
     
  9. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,535
    Did you try using the schematic I gave? You changed the values a lot on one of the caps.

    [​IMG]

    For some reason the network of R1/R2/C1/C2/x1 can be hard to translate over. I had problems with it, and so did several other people on other threads. It is easy to get lost in for some reason.

    Not necessarily. I and other people have done this on a protoboard, and it worked well. This suggests it is a pretty forgiving circuit, and 32Khz is not high frequency. The cap values around the crystal are critical though.

    One of the other protoboard designs had very long wires. I try for as short as I can, but it was still longer than I liked.
     
    Last edited: Nov 8, 2011
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yes. ALL IC's require at least one 0.1uF capacitor between their supply and ground pins. If they are a dual supply IC, they need at least two 0.1uF caps.

    I would not operate the oscillator without caps on either side of the crystal, as you will probably destroy it. The caps slow the rise/fall times and keep the crystal from being overdriven.
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,355
    OK, I over reacted as Rocky could not get the circuit working. His signals were a bit... shall we say, rocky.
    Seems that all he needed to do was to connect pin 8 to his black wire (GND).
     
  12. Rocky_circuits

    Thread Starter Member

    Nov 1, 2011
    47
    0
    That's odd. ALL of the IC's? I've never done this to any circuit I've made and they haven't have had a problem. Especially According to Bill's circuit.

    I did alter the schematic a bit, Bill. That could more than likely be giving me an issue but I think the 33p should work. If not I'll replace it with a 10p. I didn't have a chance to remake the circuit since the EE store closed and I need more parts. But you're right, I didn't ground the 8th pin did I... I wonder what glorious bounties await me once I put that into the ground? :)
     
  13. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,355
    Nothing odd about it. It is the difference between an amateur and a professional.
     
  14. Rocky_circuits

    Thread Starter Member

    Nov 1, 2011
    47
    0
    Wellll I am amateur I suppose. Considering this is my first electrical engineering class :)
    So to be perfectly clear, I want a 0.1μF cap on Pin 16 to ground? I thought that would cause a short but I'll give it a shot.
    Can't test it till tomorrow though, hopefully all works :D I just need to buy the other IC to get it down to 1Hz if this current setup will produce 2Hz once I fix it.
     
  15. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,535
    You'll note C6-C8 on my schematic, one for each chip. With protoboards it isn't quite so easy or straightforward, but they are there.

    Like I said, C1 and C2 are critical. You can use a variable for C2 to tweak it to an exact value.
     
  16. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Have a read through this "sticky" thread in the General Electronics Chat forum:
    http://forum.allaboutcircuits.com/showthread.php?t=45583

    You might "get away" without using bypass caps, but the odds are definitely not in your favor - particularly with digital ICs. You'll wind up having strange errors that just don't seem to make sense.

    If you use bypass caps as you should to begin with, you will avoid many large pitfalls of that kind.

    It is quite common to not show bypass caps on schematics, as those who've been doing this kind of thing for awhile know that they are required, so we omit them as it makes the schematic easier to understand quickly.
     
  17. Rocky_circuits

    Thread Starter Member

    Nov 1, 2011
    47
    0
    Aaaah you are right. I did not notice that, I was focusing to much on the flip flops and how much they frighten me.
    I was going to use a 4027 J-K flip flop. but you do show a way to set the clock which I haven't been able to figure out yet so I may have to follow what you there.

    Edit: I do find it strange still that my professor or lab TA have never mentioned using a bypass cap before. For curiosity's sake, what would happen if I put a 1μF cap instead of a 0.1μF cap?
    I'm reading through the decoupling or bypass capacitor thread, juicy info!
     
    Last edited: Nov 8, 2011
  18. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,355
    Let's put into perspective what Wookie is saying. Lots of people build circuits without proper bypass caps and they "get away" with it. Those circuits may work perfectly and never fail.
    But you wouldn't like to hear that the reason your car brakes failed or your airplane crashed was because some rookie forgot to design in bypass caps.
    If you want reliability, you do what Wookie says - put the bypass caps in your circuit.
     
  19. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,535
    The reason small caps are mentioned and used is frequency response. When you get into larger caps, especially electrolytics, the high frequency response suffers dramatically. And these caps are there to short out very fast transients, which is a form of high frequency.
     
  20. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    For bypass caps, you want to use something like poly metal film or ceramic caps.

    Aluminum electrolytic and tantalum capacitors are good in the larger values; >1uF, as they are relatively small for their value of capacitance. But, you really need the smaller 0.1uF caps to take care of the high frequency transients, as Bill mentioned.

    It's not obvious at first, but an ideal square wave consists of the fundamental frequency, plus ALL of the odd harmonics of that frequency - which implies unlimited bandwidth. In the real world, you can't get unlimited bandwidth due to parasitic inductance, capacitance and resistance. Adding (a) bypass cap(s) right at the power pins helps enormously to keep the bandwidth high, and to help eliminate transients (spikes, sags, noise, etc.) on the power rails.
     
Loading...