2
\$\begingroup\$

I have an STM32 chip with a 12MHz crystal connected to it (as seen in the figure below.) I've been advised to place a 220 ohms resistor 'in the OSC_OUT connection'.

I know it has to do with the termination resistance but I'd then expect it to be placed between the crystal output and the capacitor to the ground rather than in the connection between the crystal and the STM.

Could you explain to my why 220 ohms is a good value? I've found suggestions of for instance 33 ohms elsewhere (also by the book of Ott. ) Where should it be located exactly and why?

And maybe a very dumb question, but what's the difference between the left and right output of the crystal?

enter image description here

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

I'm assuming you mean placing the series resistor as shown below: -

enter image description here

Could you explain to my why 220 ohms is a good value? I've found suggestions of for instance 33 ohms elsewhere (also by the book of Ott. ) Where should it be located exactly and why?

There will be resistance in the internal output from OSC_OUT and that may be enough to initiate oscillations. But, if you don't have a series resistor, there is no guarantee that there will be enough phase shift around the loop to cause the circuit to oscillate at all let alone oscillate at the right frequency.

This type of pierce oscillator needs a 3rd order filtering effect to take place and the resistor (the added one) and C26 in your original diagram add an extra phase shift of 10 to 20 degrees; enough to start oscillation.

Using a bigger resistor is usually not a problem and is often done to reduce the power dissipated inside the crystal so, you choose the series resistor based on the crystal you are using and the supply voltage of the inverting gate inside the oscillator part of your chip.

If you want a full tear-down on the components of a crystal oscillator, this web-page may be of interest to you. It takes you through the reasons why the crystal oscillates and explains why it may not oscillate at exactly the right frequency you expected it to such as in this diagram: -

enter image description here

Varying the loading capacitors shows how the crystal oscillation frequency may be retuned: -

enter image description here

And, if you change the drive resistance (the added series resistance) you also get slightly different oscillation frequencies: -

enter image description here

The web page also shows the effect of the gate and it's propagation delays.

what's the difference between the left and right output of the crystal?

A crystal is symmetrical and either terminal (left and right) can be swapped. Regards the chip itself OSC_IN is an input and OSC_OUT is an output.

You also need to check whether you need a 1 MΩ resistor between OSC_IN and OSC_OUT - some chips have it built internally but many don't. It is used to bias the chip's inverting gate into the linear portion of its signal range. It's basically like applying a feedback resistor across an op-amp i.e. it's negative feedback that sets the DC conditions correctly.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for this very clear response. Just one additional question. My crystal can drive a typical 10uW ( farnell.com/datasheets/2581428.pdf ). There is a sheet for the STM32 oscillator design guide which I just found: google.com/… - for 12MHz this gives me about 740 ohms with 18pF caps? \$\endgroup\$
    – Mart
    Commented Jan 4, 2021 at 11:26
  • 1
    \$\begingroup\$ The maximum power is 100 uW so aim a bit higher than 10 uW, maybe 30 uW. When I do it, I simulate the circuit with the known parameters of the crystal @Mart \$\endgroup\$
    – Andy aka
    Commented Jan 4, 2021 at 11:31
1
\$\begingroup\$

The purpose of the resistor is to reduce the drive power the crystal experiences. Too little drive power and the oscillator may not start reliably. Too much drive power and the crystal may age excessively or even fail. The optimum resistor (if any) is dependent on the maximum drive power specification of the particular crystal model and the ESR maximum of the crystal.

Crystal manufacturers generally recommend that you actually measure the drive current using a special (and expensive) high frequency current probe on an oscilloscope in order to confirm that the drive power is well within specifications typically.

If a resistor is recommended, the recommendation would only apply for a particular chip, supply voltage, and crystal make and model. Generally speaking, the smaller the crystal is (physically) the lower the allowable drive power. It may be several mW for a huge HC-49 crystal, but only 100uW or so for a tiny SMT crystal.

The difference between OSC_IN and OSC_OUT is that the first is an input to the on-chip oscillator amplifier and the second is the output.

From here is a schematic showing the on chip parts (the inverter/amplifier and.. usually.. the bias resistor) and the external crystal, load capacitors and resistor.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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