Author Topic: Crystals and capacitors - how do you determine what values to use?  (Read 3789 times)

0 Members and 1 Guest are viewing this topic.

Offline mattybigbackTopic starter

  • Contributor
  • Posts: 19
  • Country: gb
    • Totally Keyboard
Hi there, another noob question

I'm looking into building a few digital clocks of different designs, but I'm a little confused about the components needed to build the oscillator. I'm looking to use a CD4060 and a 4013 flipflop to generate a 1Hz clock, as detailed in the link below, but I'm confused about how the resistor and capacitor values are determined. Different designs call for different values, and I don't know which ones to use.

http://www.electroschematics.com/225/1hz-generator-and-2hertz-oscillator/

Could someone please help me understand what each component is doing, and how to determine the values to use? I found another example in a Microchip datasheet that has a much simpler circuit - is there a reason for that, or is it doing the same thing.

http://ww1.microchip.com/downloads/en/AppNotes/91097A.pdf

Thanks in advance
 

Offline mattybigbackTopic starter

  • Contributor
  • Posts: 19
  • Country: gb
    • Totally Keyboard
Re: Crystals and capacitors - how do you determine what values to use?
« Reply #1 on: January 16, 2014, 12:56:15 am »
Sorry, I should point out that the crystals I have are 12.5pf 32.768 kHz watch crystals. Doh!
 

Offline mattybigbackTopic starter

  • Contributor
  • Posts: 19
  • Country: gb
    • Totally Keyboard
Re: Crystals and capacitors - how do you determine what values to use?
« Reply #2 on: January 18, 2014, 06:35:18 pm »
Anyone?

I've done a bit of research on the topic but I still don't understand it
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Crystals and capacitors - how do you determine what values to use?
« Reply #3 on: January 18, 2014, 07:07:06 pm »
Get the datasheets for the 4060 and the 4013.

The 32.768KHz xtal is built up into an oscillator (based on an inverter).

This 32.768KHz signal feeds a series of dividers (the 4060, 14 stages to be precise), which divide the frequency down to 2Hz (2^14).

This then feeds a flip/flip, which divides down the 2Hz to 1Hz.

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline Torrentula

  • Regular Contributor
  • *
  • Posts: 91
  • Country: de
    • My blog
Re: Crystals and capacitors - how do you determine what values to use?
« Reply #4 on: January 18, 2014, 07:15:35 pm »
Usually the capacitors you want to use will be double the value of your crystal's load capacitance, in this case 25pF. Of course, in practice, PCBs will have parasitic capacitance and if you worry a lot about the accuracy of your crystal oscillator's frequency you would take that into account.

Usually you will calculate the load capacitors as follows:

C = (2*C_load) - C_parasitic

where C_load is given in the data sheet (in your case 12.5pF) and C_parasitic consists of the input capacitance of the IC and the capacitance of the traces (traces on one side with a ground plane on the other effectively form a capacitor like the huge-arse two plate thing we all know from physics class).

The circuit you're trying to build is a Pierce Oscillator (https://en.wikipedia.org/wiki/Pierce_oscillator). I've always used something in the 1 megaohm range for the resistor between the two crystal leads and have omitted the series resistor.

The app note is the same thing and explains it quite well, the series resistor is used to limit the drive power to the crystal and prevents it from oscillating at a much higher frequency than the 32.768kHz.
 

Offline Rory

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: us
Re: Crystals and capacitors - how do you determine what values to use?
« Reply #5 on: January 18, 2014, 07:35:17 pm »
OK I'll bite. My advice is to search the forums for "Pierce Oscillator" and "quartz watch crystals". What you are asking has already been covered extensively.

If you still have blankness clouding your mind, experiment. Or model it with Spice. Or both, first model then test it in the real world.

Build a test circuit dead-bug style on a piece of blank copperclad circuit board and try out different values of load capacitors and series resistors, and watch the output to see what it does. Look at the frequency, see what happens when you increase and decrease the capacitance, try capacitors with different temperature coefficients then apply controlled heat and cold, and observe the frequency change with temperature.  Try to select a capacitor value that sets the output frequency to the crystal's design frequency, then see if you can hold the output frequency over a wide temperature range. 

You don't need a 4066 or a PIC to do this, at 32kHz just about any inverter will suffice.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf