13
\$\begingroup\$

I'm trying to pick a crystal and capacitors for the clocking of a MCU, and, from what I've understood, my crystal needs a load capacitance of 30pF (it's specified in the datasheet) in order to properly work. The way I'd have done this would be:

schematic

simulate this circuit – Schematic created using CircuitLab

However, everyone is telling me I should do this:

schematic

simulate this circuit

Because the capacitors are, somehow, in series. This makes zero sense to me: I'm using one more capacitor, and the capacitor in the right side is next to the low-impedance output of the inverter, so I just don't see it in series. Also, my design uses one less capacitor. What am I missing?

\$\endgroup\$
10
\$\begingroup\$

There are two aspects of load capacitance. What the crystal sees is the capacitance between the two ends of the crystal. Typically the oscillator circuit will need some capacitance between one end of the crystal and ground, but that's of less importance to the crystal.

If the two ends of the crystal were moving up and down in perfect anti-phase fashion, and two load capacitors were sized according to the inverse ratio of the amplitudes, then current flowing from one capacitor into ground would precisely match current flowing from ground into the other capacitor, such that if one disconnected ground but left the capacitors connected to each other, circuit operation would be unaffected. In that situation it would be obvious why the series value of the capacitance would matter, because the only capacitance involved would be two capacitors, in series.

In practice the two ends of the crystal don't oscillate quite 180 degrees apart, and the capacitors aren't sized to match the amplitude ratio, so there's a little ground current flowing in the caps, but it's generally only a small portion of the total cap current, so the dominant behavior is still that of the two caps in series.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Why does the current that goes through C2 matter at all? Shouldn't the inverter be able to source this current? \$\endgroup\$ – FrancoVS Nov 6 '15 at 21:59
  • 3
    \$\begingroup\$ @FrancoVS: In an oscillator circuit, the inverter will be designed to have a very limited output current; if the inverter were not thus limited, it would be necessary to add a resistor in series. Use an inverter with high-current outputs and no resistor would likely cause premature crystal failure. \$\endgroup\$ – supercat Nov 6 '15 at 22:03
  • \$\begingroup\$ ah, that explains the series thing. But why not just use one 30pF cap across the crystal then? \$\endgroup\$ – FrancoVS Nov 6 '15 at 22:15
  • 2
    \$\begingroup\$ @FrancoVS: If there weren't any capacitance to ground and the inverter had a range of input voltages which caused the output to neither source nor sink current, then whenever the input was at such a voltage both ends of the crystal would be floating. One could probably place one cap in parallel with the crystal and put a second cap to ground at one end of it, but using a properly-sized pair of capacitors in the usual fashion will be more efficient. \$\endgroup\$ – supercat Nov 7 '15 at 0:20
5
\$\begingroup\$

Rotating this schematic shows why you can consider the capacitance across the crystal to be interpreted as in series. The load is measured across the XTAL and not relative to ground

schematic

simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
\$\endgroup\$
  • 2
    \$\begingroup\$ Indeed, but it depends also where the amp is connected. But what the OP has posted is a Pierce oscillator; more detailed calculations are found on p. 3 here, but it can be approximated like you said. \$\endgroup\$ – Fizz Nov 7 '15 at 1:34
4
\$\begingroup\$

It is true that the bog standard Pierce oscillator design you can find in ancient appnotes/datasheets uses equal capacitors:

enter image description here

But that's indeed not the only thing that could possibly work, although I see that the left rather than right cap is the one left out:

enter image description here

You're not saying what frequency you're targeting... or what amp/chip your're using. All of which matter if you want to design your own rather than follow some cookbook recommendations.

enter image description here

Even much simpler design approaches need to consider at the very least the input and output capacitances of the amp used:

enter image description here

If you put a large cap only on one side of xtal, but on the other side you have only a much smaller cap of the input (or output) capacitance of your amp, what will be the total (series) capacitance? It will probably be rather unpredictable and dominated by the small capacitance.

Isolating the xtal from seeing small capacitances is one way to improve its stability (although this latter scheme is seldom used, as far as I know).

enter image description here

And coming back to the 1st appnote:

Oscillator design is an imperfect art at best. Combinations of theoretical and experimental design techniques should be used.

So try yours [first in a sim preferably] and then on the real board and see if it's worth trying to save that cap.

And since the amp/driver characteristics matter, also note this bit of advice from a ST appnote:

Many crystal manufacturers can check microcontroller/crystal pairing compatibility upon request. If the pairing is judged valid, they can provide a report including the recommended CL1 and CL2 values as well as the oscillator negative resistance measurement.

Finally, an imbalance between these caps is sometimes introduced on purpose in order to increase the output voltage of oscillator (for this you need to make left one smaller), but this also increases power dissipation on the xtal:

enter image description here

| improve this answer | |
\$\endgroup\$
4
\$\begingroup\$

I don't find it helpful to regard the crystal capacitors as being connected in series. They both do similar jobs but act at different parts of the circuit. The first capacitor (and most important one) is on the return feed back to the input of the inverter: -

enter image description here

The left part of the picture above shows an equivalent circuit of a 10 MHz crystal along with a 20pF capacitor (C3) to ground. V1 is the driving source and on the right I've plotted the frequency and phase response. Note also the presense of R2 (which I shall explain further down).

At just over 10MHz the phase angle of the circuit is very nearly 180 degrees and this is important because the crystal is being driven by an inverter. The inverter produces 180 degrees phase shift (aka inversion) and the crystal and its external capacitors produce another 180 degrees hence 360 degrees and positive feedback.

Also to maintain oscillation the gain has to be greater than 1. Regards the picture above, at very slightly over 10 MHz the circuit produces gain i.e. H(s) is greater than 1 and oscillation will occur if the network had produced 180 degrees phase shift.

Why add the extra capacitor on the driving side of the crystal?

This not only prevents the crystal being driven too hard but produces a few extra degrees of phase shift and allows the circuit to oscillate. Notice the 100 ohm resistor labelled R2 - it limits the current into the crystal but, the extra capacitor to ground at this point will add the needed phase shift.

A lot of crystal oscillator circuits don't show this series resistor because it makes use of the non-zero output impedance of the inverter. If you had a relatively powerful inverter (capable of driving many tens of mA) then a resistor is needed and think about it - who is going to stick 20pF on the raw output of an inverter without contemplating a series resistor?

Related question: Designing an Oscillator

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ why do crystal datasheets specify a "load capacitance" that, according to you, is only half of the actual load capacitance? Also, wouldn't C2 (in my drawing) be dependent on the series resistance of the inverter? \$\endgroup\$ – FrancoVS Nov 7 '15 at 12:10
  • \$\begingroup\$ @FrancoVS I'm not saying that - my assertion is that the load capacitance is what appears in your first diagram (C1). C2 is somewhat dependant on the internals of the inverter but I don't see how this is related to how the xtal is loaded. \$\endgroup\$ – Andy aka Nov 7 '15 at 12:17
  • \$\begingroup\$ my point is that most tutorials I read are telling me that a good way to specify C1 and C2 is by assuming they are equal, and that I should specify them such that their series capacitance is equal to the "load capacitance" value on the crystal's datasheet (ignoring the board's capacitance). If I understand correctly what you are saying, this is wrong: C1 is the load capacitor (therefore, I am presenting 60pF to a crystal that expects 30pF), and C2 doesn't depend on the crystal at all: it should be specified according to the inverter. \$\endgroup\$ – FrancoVS Nov 7 '15 at 13:12
  • \$\begingroup\$ @FrancoVS I hear exactly what you say and it seems that all the commonplace tutorials on xtals split the capacitance either side and usually equally. Well, as far as my analysis goes, the driven end of the xtal is, a few handful of ohms or tens of ohms. Let's say 50 ohms max. Now look at the impedance of a 22pF just on the input side of the buffer. At (say) 10MHz the impedance is 723 ohms. What this tells me is that the load on the xtal is the 22pF in series with 50 ohms. Putting another 22pF on the output is just shunting the 50 ohms a bit. \$\endgroup\$ – Andy aka Nov 7 '15 at 13:24
  • \$\begingroup\$ Of course all of this assumes that the equivalent circuit of the xtal supplied by manufacturer's data sheets is precise around the operating frequency. Nothing in my experience leads me to believe that the cap on the inverter output is there for anything else other than shaping the output waveform to make it "easier" on the delicate little xtal. \$\endgroup\$ – Andy aka Nov 7 '15 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.