Author Options:

What are capacitors for in oscillator circuit for pic? Answered

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... 


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.

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.

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 !

thanks! Yes I meant two small caps that connect to oscilator.