C_{0}: represents the shunt capacitance resulting from the capacitor formed by the electrodes
L_{m}: (motional inductance) represents the vibrating mass of the crystal
C_{m}: (motional capacitance) represents the elasticity of the crystal
R_{m}: (motional resistance) represents the circuit losses

The impedance of the crystal is given by the following equation (assuming that Rm is negligible):

F_{S} is the series resonant frequency when the impedance Z = 0:

This equation gives resonance frequency when L_{m} = 1/(ω C_{m})

Fa is the anti-resonant frequency when impedance Z tends to infinity. Using equation (1), it is expressed as follows:

Oscillation frequency of the crystal

To oscillate, the following Barkhausen conditions must be fulfilled. The closed-loop gain
should be greater than 1 and the total phase shift of 360^{o} is to be provided:

Pierce oscillator

Inv: the internal inverter that works as an amplifier
Q: crystal quartz or a ceramic resonator
R_{F}: internal feedback resistor
R_{Ext}: external resistor to limit the inverter output current
C_{L1} and C_{L2}: are the two external load capacitors
Cs: stray capacitance is the addition of the MCU pin capacitance (OSC_IN and OSC_OUT)
and the PCB capacitance: it is a parasitical capacitance.

Step1: Calculate the gain margin

Choose a crystal and go to the references
If C_{L1} and C_{L2} are known compute C_{L}:

Estimate PCB Trace Stray Capacitance

Input Values. Enter the Given:

Result:

Load Capacitors

The C_{L} value is specified by the crystal manufacturer:

Enter Oscillator Data:

Result:

Gain margin of the oscillator

g_{m} is the transconductance of the inverter (in mA/V for the high-frequency part or in
μA/V for the low-frequency part: 32 kHz). g_{mcrit} (g_{m} critical) depends
on the crystal parameters.
Assuming that C_{L1} = C_{L2}, and assuming that the crystal sees the same C_{L} on its pads
According to the Eric Vittoz theory: the impedance of the motional RLC equivalent circuit of
a crystal is compensated by the impedance of the amplifier and the two external capacitances.
To satisfy this theory, the inverter transconductance (gm) must have a value g_{m} > g_{mcrit}. In
this case, the oscillation condition is reached. A gain margin of 5 can be considered as a
minimum to ensure an efficient startup of oscillations.