Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

100pF caps for MCU timer

Status
Not open for further replies.

Taymo

New Member
In a PIC16F84A datasheet is tells me to use a 47-100pF cap for a 447kHz clock speed. What I have is two 100pF caps because RadioShack didn't have 33pF. Would it be a bad idea to use a 100pF cap with a 20MHz crystal? What about a 4-5 MHz crystal?
 
The choice of a capacitor depends on the crystal. You should consult the crystal manufacturers specifications. If this is just a one off project, then just try something and observe the results. What is likely to happen if the capacitance is too far off is the oscillator will have trouble starting up. I would expect this to be more of a problem at 20MHz than at 4 MHz.

The PIC has internal power on circuitry that keeps the chip in RESET while the oscillator starts up and settles into stable operation. The oscillator output should swing from ground to Vdd. If it does these things then don't worry about the capacitors.
 
Ok thanks. Here's another question:

How does one go about calculating the output range in Hz for a RC timer setup?
 
One would read the data sheet and discover the following on page 65. :lol:

Mike.
 
Last edited:
You appear to be somewhat confused? - you're mixing up capacitor values for an RC oscillator, and the capacitors used with a crystal oscillator.

Presumably you're wanting to use a 20MHz crystal?, so the RC chart is completely irrelevent - you just need a couple of small capacitors, I've found them VERY non-critical, I've used from 10pF to 22pF, depending what I had to hand. The actual values are dependent on the crystal, not the PIC.

I would also suggest you use a 16F628, rather than the long obselete 16F84, the 628 is cheaper, higher spec, and replaced the 84 last century.
 
Nigel Goodwin said:
You appear to be somewhat confused? - you're mixing up capacitor values for an RC oscillator, and the capacitors used with a crystal oscillator.

I would respectfully suggest that you are the one that is confused.

Taymo said:
Ok thanks. Here's another question:
How does one go about calculating the output range in Hz for a RC timer setup?

I was answering this question. Did you not read the whole thread.

Mike.
 
Pommie said:
Nigel Goodwin said:
You appear to be somewhat confused? - you're mixing up capacitor values for an RC oscillator, and the capacitors used with a crystal oscillator.

I would respectfully suggest that you are the one that is confused.

Taymo said:
Ok thanks. Here's another question:
How does one go about calculating the output range in Hz for a RC timer setup?

I was answering this question. Did you not read the whole thread.

Sorry, I missed that one 8)
 
Another question: the frequency of the oscillator is supposed to decrease with respect to the nominal value of the crystal with larger capaitors ... how much??
 
eng1 said:
Another question: the frequency of the oscillator is supposed to decrease with respect to the nominal value of the crystal with larger capaitors ... how much??

It's not much, you can only 'pull' crystals a little way.

Do you have a specific reason to want to do this?.
 
DanD said:
cant you just get a 3pin oscillator w/ built in caps and be done w/ it?

It's a lot more expensive though, both in money and board space - but if you use the more modern 16F628 it also has an internal 4MHz oscillator, although NOT a crystal one - it is suitable for most purposes though.
 
To Nigel: I was just wondering how much the real frequency can be different from the nominal frequency of the crystal. I don't want to use larger capacitor, but tolerances and stray capacitance can affect nominal capacitances... :roll: Thanks
 
eng1 said:
To Nigel: I was just wondering how much the real frequency can be different from the nominal frequency of the crystal. I don't want to use larger capacitor, but tolerances and stray capacitance can affect nominal capacitances... :roll: Thanks

It's only a very small percentage that you can shift it, if you try and do it too far then stability suffers - it's fairly common to make one of the capacitors a trimmer, then you can trim it to be exact (assuming you have an accurate reference to set it to). You often see that on clock or frequency counter designs - other wise there's no need.
 
Nigel Goodwin said:
DanD said:
cant you just get a 3pin oscillator w/ built in caps and be done w/ it?

It's a lot more expensive though, both in money and board space - but if you use the more modern 16F628 it also has an internal 4MHz oscillator, although NOT a crystal one - it is suitable for most purposes though.

A resonator (3 pin with built in caps) costs less than a crystal (ECS ZTT series is 0.40 $USD quantity one from mouser) and works fine. Takes up less space than a xtal+caps. doesn't work well in a solderless breadboard, though. It doesn't have the super tight tolerances that crystals do but it's good enough for most applications including async I/O and I2C.

I've pretty much switched to them. The surface mount ones quite conservative of board space.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top