Crystals and capacitors - how do you determine what values to use? - Page 1
Forum section: electronics / beginners

author: mattybigback
author_rank: Contributor
timestamp: January 16, 2014, 12:54:06 am
content: Hi there, another noob questionI'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.pdfThanks in advance

author: mattybigback
author_rank: Contributor
timestamp: January 16, 2014, 12:56:15 am
content: Sorry, I should point out that the crystals I have are 12.5pf 32.768 kHz watch crystals. Doh!

author: mattybigback
author_rank: Contributor
timestamp: January 18, 2014, 06:35:18 pm
content: Anyone?I've done a bit of research on the topic but I still don't understand it

author: fcb
author_rank: Super Contributor
timestamp: January 18, 2014, 07:07:06 pm
content: 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.

author: Torrentula
author_rank: Regular Contributor
timestamp: January 18, 2014, 07:15:35 pm
content: 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_parasiticwhere 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.

author: Rory
author_rank: Frequent Contributor
timestamp: January 18, 2014, 07:35:17 pm
content: 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.