Optimizing microcontroller crystal load capacitors... - Page 1
Forum section: electronics / general

author: westfw
author_rank: Super Contributor
timestamp: June 25, 2017, 09:01:40 am
content: Most microcontroller designs that use a crystal have a couple random-value load capacitors, copied from some other design, or perhaps from a datasheet.More careful designers actually read their crystal's datasheet (and use a crystal that HAS a datasheet), and the app note on the oscillator, made some guesses about the trace/pin capacitance of their PCBBut is there a way to optimize a design for a particular PCB/Crystal/chip? Other than just using a very accurate frequency counter and several different crystal values in a set of test PCBs? Is there some sort of resonance peak when you manage to get the loads "just right", or is the whole "pulling" that you can do just sort of linear?

author: alm
author_rank: Super Contributor
timestamp: June 25, 2017, 09:10:22 am
content: I've always done the second, but I'm pretty sure that having the load capacitors far off (like just copying the datasheet values) may affect stability. So if I were doing high reliability or extreme temperature design, I might do some actual tests.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 25, 2017, 11:26:26 am
content: Yup.http://www.st.com/content/ccc/resource/technical/document/application_note/c6/eb/5e/11/e3/69/43/eb/CD00221665.pdf/files/CD00221665.pdf/jcr:content/translations/en.CD00221665.pdfIn short, by putting a crystal between caps, you're using a transformation, which effectively turns it from a series resonant crystal to a parallel resonant filter. The impedance of that filter, and therefore the voltage needed to deliver some current, or the current required to develop some voltage, is approximately the reactance of those capacitors.The crystal resonance is "pulled" or loaded by external capacitance, so it's only correct when the total capacitance, as seen by the crystal, equals the datasheet value. This includes pin capacitance (which isn't always well documented) and stray capacitance.The oscillator is only as powerful as it is designed to be. The ST oscillators appear to be fixed gain, so you need a crystal that's high enough impedance (low enough CL) to work reliably. Others are designed with a full logic pin output, and you add an external resistor to set the drive current (it's usually on par with the resonator impedance: in the ballpark of ~1k for 10MHz crystals, ~50k for 32kHz, etc.). Some (I think most AVR and MSP430 do this) have software controlled options for drive strength / power / current consumption.This should also give you some idea what kind of options there are, if you should wish to do something oddball, like use an LC resonator instead.Tim

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 27, 2017, 01:34:55 pm
content: Remember the 2 caps are effectively in series, so should be half the recommended load capacitance, less capaictance from tracks etc.I was told that MCU stryle Xtal osc is happiest when teh amplitudes on each side of the crystal are similar ( measure with a low capacitance x100 probe, or hang a 10M Resistor off the end of a x10 probe - you only care about relative amplitudes)Minimise capcaitance between the xtal pins ( vs. capacitance to ground)