# Xtal load capacitors

Discussion in 'Embedded Systems and Microcontrollers' started by spinnaker, Nov 8, 2011.

1. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
5,083
1,181
I have a few of these Xtals

http://www.digikey.com/scripts/DkSearch/dksus.dll?vendor=0&keywords=300-8303-nd

So to calculate the load capacitor

C=(25)-(5) or 20pF

5 being the parasitic capacitance and 25 = 2x12.5 the load capacitance.

I found this calculation here:

http://www.piclist.com/techref/clocks.htm

Does this seem correct?

Some other clarifications on the article:

If I read it correctly, it suggests taking one capacitor lead to ground and the other to VCC. But every circuit I have ever seen takes both caps to ground, including the PICS datasheet. Which is it?

And do I read it correctly that both caps to go straight to the ground and VCC pin of the PIC.

The datasheet shows an "RS" resistor and says "RS may be required to avoid overdriving crystals with low drive level specifications."

How do I know if the XTAL has a low drive spec? and how do I calculate the value of RS?

I am going to take the advice of Wookie in this thread and add an adjustable cap.

But what is a good way of timing the accuracy of my adjustment? Other than the obvious, eye balling it off of a known good timing source.

2. ### MrChips Moderator

Oct 2, 2009
12,636
3,455
What kind of PIC are you connecting to this XTAL?
Don't get too fancy. Just use a couple of 22pF and you should be OK.

3. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
5,083
1,181
It is a PIC18F47J53.

So a couple of 22pf will be accurate enough for a clock to be used for logging of temperature?

Would I be just as good to use the onboard RC OSC?

4. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
5,083
1,181
Oh and I have 22pfs in stock!

5. ### MrChips Moderator

Oct 2, 2009
12,636
3,455
Probably, depending on the details of your application.

Are you doing timing, PWM, USART, USB? Then use a crystal.

6. ### ErnieM AAC Fanatic!

Apr 24, 2011
7,439
1,627
Don't over think this. Just put a couple of small caps there, something in the 22pF range, but there is a lot of wiggle room there.

If all you need is for the PIC to execute code then any time source is OK. Crystals are only required when the PIC is acting as a precision timing source.

As far as any AC analysis goes, all supply rails are the same and look like ground. If that seems strange, just ask yourself what the AC impedance is between power and ground once you get done adding all your bypass caps.

One cap to VDD and the other to VSS is a new one on me. I've connected both together to either terminal, so I assume one up and one down would work too. But I'd stick with whatever potential is closest.

7. ### t06afre AAC Fanatic!

May 11, 2009
5,939
1,222
If you want a precise 4MHz clock. You should use a crystal. However it will not matter much if you use the internal clock in the development phase.

8. ### Markd77 Senior Member

Sep 7, 2009
2,803
594
I've seen both ways of connecting them and they are equivalent in a steady state. I did wonder if having them connected to different rails would help the startup of the oscillation, but didn't give it too much thought.
I've always used ground and not had any problems apart from on breadboards which are sometimes unreliable with crystals.

9. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
5,083
1,181
Thanks everyone

Timing accuracy does not be super precise. As long as it is within a second or two. I just don't want to have to reset the clock every few days, that's all.