What are capacitors for in oscillator circuit for pic?

I've been learning to program pic18f1320 with led blinker program and using 10Mhz oscillator. I don't have right capacitors but circuit works without them just fine... 

sort by: active | newest | oldest
verence5 years ago
Difficult to answer without knowing what capacitors you are talking about. You know, there's more than one possible LED blinker with the PIC18F1320 and some of them have more then one capacitor.

So, just by using my magical powers, I assume that you mean the 2 small caps that connect each leg of the quartz with ground. If not, ignore this answer and maybe give us dumbs who can't read your mind some more information.

So, if you mean the small caps at the quartz, well they are not absolutely necessary. Your circuit might work without them, they are tiny (just some pico-Farad anyway).

The capacitors work as load capacitors (see http://en.wikipedia.org/wiki/Pierce_oscillator) and form together with the quartz a PI filter and assure a 180° phase shift.

Well, it might work without them. That depends on the kind of quartz, the way you wired your circuit (which may or may not add some pFs), the way your circuit is powered and even the way how the power is switched on (no kidding).

So, it may work without them. But good engineering does not want to make it work maybe, but every time. So add them if you can get them. Or, if you can't get them, be happy that your circuit works anyway, but don't rely on it.

verence verence5 years ago
I just forgot: The value is not that critical. So, if the design asks for a 27 pF cap, a 22 or 30 pF or maybe 47 pF will most probably work as well.
bratan (author)  verence5 years ago
Without the right cap, sometimes, the crystal won't start, or it's oscillating frequency will be off, or wander around. As Verence says, single tone crystals are pretty tolerant of the exact value of load cap, but it must be very small !
bratan (author)  steveastrouk5 years ago
thanks! Yes I meant two small caps that connect to oscilator.