2.7 External Oscillator Pins

Many MCUs have options for at least two oscillators: a high-frequency primary oscillator and a low-frequency secondary oscillator.

The oscillator circuit should be placed on the same side of the board as the device. Also, place the oscillator cir­cuit close to the respective oscillator pins, not exceed­ing one-half inch (12 mm) distance between them. The load capacitors should be placed next to the oscillator itself, on the same side of the board. Use a grounded copper pour around the oscillator circuit to isolate them from surrounding circuits. The grounded copper pour should be routed directly to the MCU ground. Do not run any signal traces or power traces inside the ground pour. Also, if using a two-sided board, avoid any traces on the other side of the board where the crystal is placed. A suggested layout is illustrated in the following figure.

Figure 2-1. Suggested Oscillator Circuit Placement

Crystal Oscillator Design Consideration

The following hypothetical example assumptions are used to calculate the Primary Oscillator loading capacitor values:

  • CIN = XIN Pin Capacitance = 4 pF
  • COUT = XOUT Pin Capacitance = 4 pF
  • PCB stray capacitance (i.e., 12 mm length) = 2.5 pF
  • C1 and C2 = the loading capacitors to use on your crystal circuit design to guarantee that the effective capacitance as seen by the crystal in circuit meets the crystal manufacturer specification MFG Crystal Data Sheet CLOAD spec:

CLOAD = {( [CIN + C1] * [COUT + C2] ) / [CIN + C1 + C2 + COUT] } + oscillator PCB stray capacitance

Hypothetical Example Crystal Load Capacitor Calculation

Crystal manufacturer data sheet spec example: CLOAD = 15 pF

Therefore:

MFG CLOAD = {( [CIN + C1] * [COUT + C2] ) / [CIN + C1 + C2 + COUT] } + estimated oscillator PCB stray capacitance.

Assuming C1 = C2 and PIC32C Cin = Cout, the formula can be further simplified and restated to solve for C1 and C2 by: C1 = C2 = ((2 * MFG CLoad spec) - Cin - (2 * PCB capacitance)) = ((2 * 15) - 4 - (2 * 2.5 pF)) = (30 - 4 - 5) = 21 pF

Therefore: C1 = C2 = 21 pF is the correct loading capacitors to use on your crystal circuit design to guarantee that the effective capacitance as seen by the crystal in circuit in this example is 15 pF to meet the crystal manufacturer specification.

Note: Do not add excessive gain such that the oscillator signal is clipped, flat on top of the sine wave. If so, you need to reduce the gain accordingly using the . Failure to do so can stress and age the crystal, which can result in an early failure. When measuring the oscillator signal you must use an FET active-powered scope probe with 1 pF or the scope probe itself will unduly change the gain and peak-to-peak levels.