Compute the Capacitor Values for a Crystal Oscillator
The capacitors C1 and C2 make up the rest of the basic oscillator circuit when combined with the inverting amplifier and the crystal or resonator. The optimum load capacitance (CL) for a given crystal is specified by the crystal manufacturer. CL can be calculated using the Equation 1 from Application note AN849 - Basic PICmicro Oscillator Design.
Equation 1:
CL = (C1 * C2) / (C1 + C2) + Cstray
Example: If CL = 12.5 pF (optimum load capacitance provided by the crystal manufacturer) and assuming that Cstray = 2 pF and C1 = C2;
using Equation 1:
C1 = 2(12.5 pF-2 pF) C1 = 2(10.5 pF) = 21 pF
In this example, do not use a loading capacitor below 21 pF. We recommend using the next standard 22 pF ceramic capacitor.