Searching \ for '[PIC]: Crystals and Cap's' in subject line. ()
Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Crystals and Cap's'.

Exact match. Not showing close matches.
'[PIC]: Crystals and Cap's'
2000\11\12@104152 by

Hi,

I've been running a 16F876 with a 10MHz XTAL with 22pF load capacitors.

I then wanted to move up to 16MHz (The PIC is a 20MHz part)

I have used the formula...

Where C1 and C2 are the external parallel load capacitors. Now I've also assumed that the parasistic capacitance of the PIC pins to be around 5->8pF . So C1 = C1a + C1p   (C_actual + C_parasitic) Of course the same goes for C2.

Normally C1 and C2 are made the same so the formula becomes...

Load Required = (C1*C1)(2*C1) = C1 / 2

So my crystal (16MHz) states in the data book that it needs 16pF load.

Therefore

16pF = C1/2 = (C1a + C1p)/2 = (C1a + 5pF)/2
2*16 - 5 = C1a = 27pF

So I put two 22pF capacitors as the load and nothing!

I just cannot get the oscillators/crystals to start up. Any ideas what I should check next? I'm going to buy some 32pF caps and try them soon.

Is the calculation correct? I don't understand as my 10MHz crystal works fine with 22pF caps and that's spec'ed  at 30pF load which would mean the 22pF caps are wrong, but yet it works fine? (I don't know the exact frequency though)

Thanks

Peter

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu

> The data book dosen't tell you what value caps to use. The crystal spec
does.

Yes sorry. I meant the spec on the crystal. It says Load Capacitance = 16pF

I swapped it for two 16MHz crystals and still nothing and changed the Caps
to 2*16pF rather than 2*22pF and still nothing. Yet when I put on a 10MHz
XTAL it all sprang into life. Weird.

The Microchip site lists something about putting a parallel resistor across
OSC1 and OSC2. I tried 2Mohm and still nothing.

I'll just keep trying.

I have set the XTAL mode of the PIC to be HS (although XT or HS didn't make
any difference to the non-working setup)

Oh and I've also tried a 20MHz crystal as well and still nothing. I must be
doing something really silly. Why will the 10MHz one work and not the 16MHz.
Surely it can ony be the capacitance? Do I just try loads of different
capacitances?

Thanks for the replies.

Peter

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu

>Oh and I've also tried a 20MHz crystal as well and still nothing. I must be
>doing something really silly. Why will the 10MHz one work and not the 16MHz.
>Surely it can ony be the capacitance? Do I just try loads of different
>capacitances?

Something else must be wrong.
I'm no expert on the pic driver ckt, I know it has several modes, as you
mentioned, and I've seen mention of series resistances, and paralell...
Never seen so many variables on a micro's osc before.

I'd stick with the right caps though.

One thing to check. Do the caps connect DIRECTLY to the pic's ground pin?
They definitely should. I've not seen it stop the osc before, but
connecting them anywhere else opens the door for EMI, in both directions.

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu

The Only thing not tested is the crystal as you have got it working at
10Mhz.
I have no problems with 20Mhz crystals and 10p caps on 16F84 and 16F877's
I would build a osc cct with say 74hc04 or ant thing to hand.
and then feed it in to osc in and see what's on osc out.
doing this is you know the crystal is working and the you could see if the
pic is working as well.

Regards Art

{Original Message removed}
There are also crystals designed for different resonance cirquit, if i remember correct, parallel and series.

It might be you have the wrong type.

Does the datasheet of the Xtal give any example cirquit?

Does it correspond to the descritpion of th eoscillator in th ePIC datasheet?

/Morgan

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu

David VanHorn wrote:
> >Oh and I've also tried a 20MHz crystal as well and still nothing. I must be
> >doing something really silly. Why will the 10MHz one work and not the 16MHz.
> >Surely it can ony be the capacitance? Do I just try loads of different
> >capacitances?
>
> Something else must be wrong.
> I'm no expert on the pic driver ckt, I know it has several modes, as you
> mentioned, and I've seen mention of series resistances, and paralell...
> Never seen so many variables on a micro's osc before.
>
> I'd stick with the right caps though.
>
> One thing to check. Do the caps connect DIRECTLY to the pic's ground pin?
> They definitely should. I've not seen it stop the osc before, but
> connecting them anywhere else opens the door for EMI, in both directions.

Also:  What oscillator setting are you on?  (Fuses.)  You want HS not
XT, mention that as it's remotely possible (if unlikely) that this is
it.  (Methodical is good, trying not to be too silly about it.)  Peter
Peres had a post about oscillator problem solving some time back, I can
find it or check the archives (I have to run for a while, need to go do
things.)  Might need a carbon resistor to help startup in there...

Ah.  Have you tried a different PIC chip?  Maybe the one chip's flawed
in the HS oscillator?

Mark

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu

Digital Signal Processing <dsptemporal-reality.co.uk> wrote:
{Quote hidden}

This formula, using the specified load capacitance of the crystal is nothing
to do with getting the oscillator to oscillate strongly and reliably.

The specified load capacitance of the crystal is the load required for it to
resonate at exactly the specified frequency, rather than at a slightly higher
or lower frequency.

If you do not need frequency accuracy down to a few tens of ppm (and one often
doesn't) you'll do better to forget the specified load capacitance and refer
to the suggested capacitors in the PIC data sheet.

Having said that I would expect something to happen with a 16MHz crystal and
two 22pF capacitors.

Is it possible that these crystals are not of very good quality?

Brian Gregory.
briangcix.co.uk

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu

Morgan Olsson <morgans.rtTELIA.COM> wrote:
> There are also crystals designed for different resonance cirquit,
> if i remember correct, parallel and series.
>
> It might be you have the wrong type.

Again, this does not stop the crystal oscillating.
It just means it won't be exactly on frequency.

Brian Gregory.
briangcix.co.uk

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu

>Oh and I've also tried a 20MHz crystal as well and still nothing. I must be
>doing something really silly. Why will the 10MHz one work and not the 16MHz.
>Surely it can ony be the capacitance? Do I just try loads of different
>capacitances?

The crystal does have an effective series resistance, which is a function of the
crystal cut, and a whole heap of processing operations which occur as the piece
of quartz is ground to frequency. It may be that the crystals you have are
ground to be parallel resonant ones, and you are trying to use them in a series
resonant circuit. If they were ground as parallel resonant, then the
manufacturer probably did not control the series R component is series mode, as
this is not part of the specification. If the series R is too high, then the
amplifier that forms the oscillator in the PIC will not have enough gain to
overcome the losses introduced by the series R component.

As with a lot of things, manufacturing a crystal is a compromise of a whole heap
of parameters, and the order in which parameters are optimized is determined by
the customers end-use specification. Even if you have bought them as
"microprocessor crystals" the vendor may not have specified the parameters the
necessary way when purchasing from the manufacturer.

--

> The crystal does have an effective series resistance, which is a function
of the
> crystal cut,
..............
> If the series R is too high, then the amplifier that forms the oscillator
in the PIC will not have enough gain to
> overcome the losses introduced by the series R component.

If I have purchased a parallel cut Xtal (which I believed I had) they don't
work too well if the series resistance is too high? This is worsened by the
PCB track resistance is it?

I only ask this as my Xtal is about 40mm from the PIC would this be too much
series resistance?

I did try soldering an Xtal straight onto the PIC pins and put the load
capacitors to Gnd about 5mm away but still nothing. It's just annoying as I
can put my 10MHz Xtal anywhere I like and really botch up the wiring and
capacitors and still it runs.

I'm going to check the specifications on the Xtal closely and maybe buy
another manufacturers type.

Could something like the MCLR or LVP (RB3) pin not being driven correctly on
the 16F876 be manifesting as an Xtal start up problem?
I'm trying to use RB3 as an output.

Thanks

Peter Betts

--

It is a fair while since I had to deal with crystal specs, but the tracks on
your PCB will not have much effect at these frequencies unless they are laid out
in a manner that adds a lot of reactance to the circuit. My memories of the
series resistance is that we tended to spec it to be less than 200-400 ohms at
series resonance. I do not think changing any of the other pins from what works
with your 10Mhz crystal will change anything.

--

> I do not think changing any of the other pins from what works
> with your 10Mhz crystal will change anything

So really I may be looking at a set of duff crystals then? You can't see any
reason why my 10MHz one works but none of my16MHz ones do?

I'll try to get some ranging from 10MHz, 12, 14, 16 ,18 20 etc etc just too
see if it's the frequency, or the batch of crystals I'm using.

What can kill crystals? Infra-red soldering?

Pete

--

At 12:49 PM 11/13/00 +0000, Digital Signal Processing wrote:
>> I do not think changing any of the other pins from what works
>> with your 10Mhz crystal will change anything
>
>So really I may be looking at a set of duff crystals then? You can't see any
>reason why my 10MHz one works but none of my16MHz ones do?
>
>I'll try to get some ranging from 10MHz, 12, 14, 16 ,18 20 etc etc just too
>see if it's the frequency, or the batch of crystals I'm using.
>
>What can kill crystals? Infra-red soldering?

Par/Ser is important, if you want them dead on freq.
Microprocessors use paralell resonant crystals.
A series xtal isn't guaranteed to operate in paralell, but I've never seen
one fail to.

Shock or too much drive level will crack the crystals.
IR (within reason) won't kill them.

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--