Author Topic: Optimizing microcontroller crystal load capacitors...  (Read 2460 times)

0 Members and 1 Guest are viewing this topic.

Offline westfwTopic starter

  • Super Contributor
  • ***
  • Posts: 4668
  • Country: us
Optimizing microcontroller crystal load capacitors...
« on: June 25, 2017, 09:01:40 am »
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 PCB

But 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?
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: Optimizing microcontroller crystal load capacitors...
« Reply #1 on: June 25, 2017, 09:10:22 am »
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.

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Optimizing microcontroller crystal load capacitors...
« Reply #2 on: June 25, 2017, 11:26:26 am »
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.pdf

In 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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14842
  • Country: gb
    • Mike's Electric Stuff
Re: Optimizing microcontroller crystal load capacitors...
« Reply #3 on: June 27, 2017, 01:34:55 pm »
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)
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->