PICs and Crystals

Hello,

I've got a PIC16F627 and two crystals. One is 12MHz, the other is

20MHz. The 12MHz one says it needs a load cap of 32pF, the 20MHz one says it needs 30pF. What does this mean!??

The circuit in the PIC datasheet has two caps going from either side of the crystal to ground. Does that mean that these need to be 32pf each for the 12MHz and 30pf for the 20MHz?

Also, it says a series resistor might be required - how do I know if it is??

Thanks

Gareth

Reply to
garethrichardadams
Loading thread data ...

schreef in bericht news: snipped-for-privacy@16g2000cwy.googlegroups.com...

Knowing the accuracy of the capacitors to be at least 10%, you can use standard 33pF ones in both cases. If you think for whatrever reason that they don't have the right value, you can experiment with values fron 22pF to

47pF, but both capacitors must have the same value. I never had a problem using either 22pF or 33pF but things may differ for different crystals. Manufacturers advice or datasheet is usually right.

Very small crystals, like the ones found in clocks or watches, cannot handle the full 5V swing off the micros internal amplifier. I saw values from 1k to

2k2 over time.

petrus bitbyter

Reply to
petrus bitbyter

This is the amount of external capacitance across the crystal that will cause it to act as a parallel resonant circuit at the specified frequency. If you use it with a PIC, it will have a capacitor from each side of the crystal to ground, with the crystal connected between those two caps. So those two caps are effectively in series across the crystal. If each capacitor were 68 pf, the series combination would equal a single 34 pf capacitor across the crystal. If you are a little off spec on this capacitance, the parallel resonance frequency will shift, slightly.

I think those caps should each be twice that capacitance, so that in series they produce that capacitance.

There is a power limit for the crystal, and connecting it directly to the oscillator output may over drive it. Adding the resistor between oscillator output and crystal lowers the drive level, but also makes it more likely that the oscillator won't start. At these frequencies, I suspect that the oscillator inverter in the PIC is losing enough gain that it will work fine without the resistor. The worst it will do is damage the crystal. Can you afford a second one if this happens?

See:

formatting link
formatting link

Reply to
John Popelish

petrus bitbyter wrote: (snip)

At 1.5 volts, the cmos inverter would have that kind of output impedance. At 3 volts, I have seen 32.768 tuning fork crystals with a 330k series resistor, and higher values for higher supply voltages.

Reply to
John Popelish

to

handle

to

A couple of good bits of information about crystal oscillators are available at:

formatting link
formatting link

Enjoy.

Richard

Reply to
Richard Seriani, Sr.

Assuming you're using a parallel-mode crystal (most are like this), if you know the crystal's load capacitance (check its data sheet), you can use the formula below:

Let: CL = Crystal's load capacitance CP = Circuit's parasitic capacitance CI = IC's input capacitance C1 = Crystal oscillator capacitor 1 C2 = Crystal oscillator capacitor 2

Then: C1 = C2 = 2 * CL - (CP + CI)

Example: For a crystal with 12pF load capacitance (CL) and assuming CP + CI = 5pF (typical), we have C1 = C2 = 2 * 12pF - 5pF = 19pF.

Just round to the nearest available value. The two capacitors, C1 and C2, are connected from the two crystal's pins to ground (as shown in the PIC data sheet).

--
Regards,
Costas
_________________________________________________
Costas Vlachos  Email: c-X-vlachos@hot-X-mail.com
SPAM-TRAPPED: Please remove "-X-" before replying
Reply to
Costas Vlachos

It sounds like the datasheet is crap to me !

If the oscillator is anything like the one on an 80C51 ( and it probably is ) make both caps 33pF. Almost any 12MHz crystal will happily oscillate with that. Should be fine with the 20MHz too.

The crystal data is slightly confusing since the pcb layout and PIC will add some stray capacitance anyway. All crystals for this kind of application will oscillate with much the same capacitance and the value isn't ultra-critical anyway - you'd probably get way with +-30%.

Graham

Reply to
Eeyore

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.