PIC clock oscillator tips and tricks

It is sometimes desirable to have an oscillator with better frequency stability than an RC oscillator, but with lower cost than a crystal. There are two obvious solutions: an LC oscillator, or a ceramic resonator.

An LC oscillator can be constructed by replacing the crystal directly with a coil, but retaining the two capacitors. The resulting frequency can be calculated as 1/2*Pi*sqrt(L*C), where C is the equivalent series capacitance of the two capacitors.

Ceramic resonator are commonly available for frequencies up to 8 MHz. For instance, Panasonic offers 400 KHz to 800 KHz resonators in a 2 pin device, and 2 MHz to 8 MHz resonators in a 3 pin device which includes the necessary capacitors. Panasonic resonators are available from Digikey.

Other sources of ceramic resonators (which I haven't tried):

Common fundamental mode crystals may be forced to oscillate at their 3rd harmonic through the use of a parallel inductor. Rich has found that a 1.8 uH coil works well. This is handy if you don't have the right frequency crystal in your parts box, but there's really little point otherwise.
The crystal oscillator circuit in the PIC requires capacitors between both sides of the crystal and ground. Or does it? On 18-pin PIC devices the oscillator pins are nearer to the Vdd pin than the Vss. Board layout is easier if you wire the capacitors to Vdd, and it works fine (as long as you have proper supply bypass caps).
It is normally claimed that you should not tie either leg of the crystal to any chips other than the PIC. This is generally good advice, but it is certainly possible to get away with using OSC2 to drive another CMOS input if you are careful. Driving another PIC's OSC1 input is an obvious application. If you need to drive more than a few inputs, or the trace would be long, you should use a CMOS buffer.
Back to my PIC Projects page
Back to my home page

Last updated September 14, 1995

Copyright 1995 Eric Smith