Oscillator oscillates at wrong frequency - Page 1
Forum section: electronics / beginners

author: 6502
author_rank: Newbie
timestamp: May 16, 2015, 02:33:17 am
content: I have a 16 MHz quartz crystal that I’ve hooked up with a Pierce oscillator circuit (diagram attached) and which oscillates at the wrong frequency, around 40 kHz.I’m certain the crystal is not the source of the problem. I’ve tried multiple crystals, from two different batches, and they all exhibit the same behavior albeit with a slight variation in frequency, anywhere from 38 kHz to 50 kHz. I have also successfully used these crystals to clock an ATMega. I verified that no internal clocking was used when testing the ATMega, removing the crystal rendered the micro controller inoperable. The capacitors used were also tested with the ATMega setup.I’ve built the circuit 4 times over 2 months, so I’m reasonably certain it’s not just a misplaced wire. I keep coming back to the problem in the hope that it was something like that, but I get the same low frequency oscillation every time.One odd thing I’ve noticed is that the duty cycle at OUT is 60%, but I imagine this is just due to the threshold voltage levels at which the 74HC14 transitions from low to high and vice versa.Any ideas on what I should check to debug this further, or is there a fundamental problem with the circuit as shown?Thanks.

author: AG6QR
author_rank: Frequent Contributor
timestamp: May 16, 2015, 03:13:31 am
content: I could be on the wrong track here, but...At those frequencies, parasitic capacitance/inductance can be a problem. How is your layout? Are you using a breadboard? "Manhattan style" prototype? "Dead bug"? Whatever you do, keep leads short.If you can show a photo of the circuit as you built it, that might be helpful.

author: edavid
author_rank: Super Contributor
timestamp: May 16, 2015, 03:14:55 am
content: A Schmitt trigger won't work in this kind of circuit. Use a 74HC04 instead.

author: 6502
author_rank: Newbie
timestamp: May 16, 2015, 03:28:26 am
content: Quote from: edavid on May 16, 2015, 03:14:55 amThank you, that was the problem.

author: 6502
author_rank: Newbie
timestamp: May 16, 2015, 03:33:17 am
content: Quote from: AG6QR on May 16, 2015, 03:13:31 amI was breadboarding it. Thank you for the reminder about stray capacitances. Now that it's working thanks to edavid's suggestion I will work on getting a little cleaner signal.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 16, 2015, 03:36:09 am
content: HCU, preferably. You can get them in single gate sized pieces too, if you don't need the rest.Tim

author: dom0
author_rank: Super Contributor
timestamp: May 16, 2015, 06:54:07 pm
content: 22 pF of 'explicit' capacitance will likely be too much, since you have some parasitic pFs already around and most crystals are for 16-25 pFtotalload capacitance. It won't stop oscillation, though.

author: Zero999
author_rank: Super Contributor
timestamp: May 16, 2015, 07:56:47 pm
content: Quote from: T3sl4co1l on May 16, 2015, 03:36:09 amYes. The 74LVC1GX04 is specifically designed for this and has a built-in buffer. It's probably used in some of those metal can oscillator modules.http://www.nxp.com/documents/data_sheet/74LVC1GX04.pdf

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 17, 2015, 07:14:21 am
content: Quote from: dom0 on May 16, 2015, 06:54:07 pmThe total is as seen by the crystal; 22pF "explicit" acts in series as 11pF, as the crystal sees it.Whatever it needs to be, do take note of it though.At resonance, the crystal is simply another impedance, so you can calculate the values of capacitors and resistors needed to get a desired signal level. You'll probably assume the output is saturating (i.e., +3.3 and 0V, or whatever), and implement a voltage divider between the series resistor, the crystal impedance, and whatever load impedance is present, to reach a nominal voltage at the inverter input (maybe 1V).If the crystal is over 20-50MHz or somewhere around that, it's likely an overtone crystal, in which case you need to add LC tuning circuits as well: usually a parallel resonant network which shorts out the crystal for frequencies far from the intended operating frequency, or a series resonant network that grounds the crystal's loading capacitance, or delivers output to it, only at the intended frequency. Nothing at all mysterious about RF, just a matter of taking into account *all* the impedances in the circuit and their interactions, and making some assumptions about poorly documented parts (like the RLC equivalent of the crystal, most of which isn't usually provided unfortunately).Tim