Reply by Chris Krusch February 6, 20092009-02-06
Microchip has some Application Notes on crystal and capacitance selection/qualification...

Search the microchip website for "oscillator, design, selection":

AN826

Title:

Crystal Oscillator Basics and Crystal Selection for rfPIC and PICmicro Devices

Name:

AN826

Date:

1/17/02

Author:

Steven Bible

Description:

Oscillators
are an important component of radio frequency (RF) and digital devices.
Today, product design engineers often do not find themselves designing
oscillators because the oscillator circuitry is provided on the device.
However, the circuitry is not complete. Selection of the crystal and
external capacitors have been left to the product design engineer. If
the incorrect crystal and external capacitors are selected, it can lead
to a product that does not operate properly, fails prematurely, or will
not operate over the intended temperature range. For product success it
is important that the designer understand how an oscillator operates in
order to select the correct crystal.

AN849

Title:

Basic PICmicro Oscillator Design

Name:

AN849

Date:

9/12/02

Author:

Dan Matthews

Description:

The
oscillator circuit for almost any microcontroller is a fairly simple
design with very few components. Selecting the values for capacitors
and resistors from the manufacturer's data books will get you a circuit
that oscillates. However, many conditions can adversely affect the
performance of your oscillator design. Higher temperatures and lower
supply voltages can lower the amplifier gain (and thus the loop gain in
the oscillator circuit) causing poor, slow, or no start-up. Colder
temperatures and higher supply voltages can increase amplifier gain,
causing the circuit to be forced to a higher harmonic and throw off the
timing. The crystal can also be overdriven and become potentially
damaged and cease functioning altogether. It is also possible to waste
power through the improper selection of components or Clock modes.

----- Original Message -----
From: stewart_bakeruk
Date: Thursday, January 8, 2009 3:19 am
Subject: [piclist] Re: pic 16f877a with lcd flickering problem
To: p...

> Hi Dwayne,
> I must admit that in the past I have used 33pF capacitors with a
> 4 MHz
> crystal. It's just that in the datasheet it says 15pF (unless I have
> read it wrong !).
>
> Cheers
> Stewart
> --- In p..., Dwayne Reid wrote:
> >
> > Hi there, Stewart.
> >
> > At 03:31 AM 1/5/2009, stewart_bakeruk wrote:
> >
> > >According to the 16F877A datasheet, for a 4MHz crystal
> oscillator the
> > >values of the capacitors should be 15pF. The value would be
> higher if
> > >you were using a ceramic resonator as a clock.
> >
> > Can you explain your reasoning for choosing 15pF capacitors?
> >
> > We use 22pF capacitors with no problems and I have seen
> designs that
> > use 33pF caps for 4MHz crystals.
> >
> > dwayne
> >
> > --
> > Dwayne Reid
> > Trinity Electronics Systems Ltd Edmonton,
> AB, CANADA
> > (780) 489-3199
> voice (780) 487-6397 fax
> > www.trinity-electronics.com
> > Custom Electronics Design and Manufacturing
>
Reply by robertdesantos February 6, 20092009-02-06
--- In p..., "stewart_bakeruk"
wrote:
>
> Hi Siva
> --- In p..., siva.gram@ wrote:
> >
> > Thanks Stewart,
> > Ya, I got that problem sorted out. But one more doubt is that
> what should be the capacitor value? I use 4 mhz crystal with
> pic16f877a and 33pf ceramic capacitors....
>
> According to the 16F877A datasheet, for a 4MHz crystal oscillator
the
> values of the capacitors should be 15pF. The value would be higher
if
> you were using a ceramic resonator as a clock.
> >
> > Also Is there any difference between pic 16 F 877A and 16 LF
877A?
> >
Hi Sir,
I guess you have no bypass capacitor across Vcc and GND.If so please
try putting a 47uF capacitor across the +Vcc and GND pins of the
microcontroller.I hope it will work.
Best regards
> I suggest that you search for and download the .pdf datasheet for
the
> device. As far as I can see the main difference between the two is
the
> power consumption.
>
> > The problem I encounter is Iam unable to enter the debug mode in
> 16f877a but iam able to enter the debug mode in 16Lf877a. I use
MPLAB
> ICD2 LE from microchip........
> >
> Can't help you with this part.
>
> Stewart
> > Siva.
> >
> > hai to all,
> > > Iam using pic16f877a and 16 x 2 lcd to display my string as an
array.
> > >
> > >The problem is when i touch the crystal legs, I could find the
> characters display steadily or else the display is flickering. I
use
> a 4mhz crystal. I even grounded the body of the crystal. But
> eventhen the problem occurs. I use 33pf decoupling capacitors for
the
> crystals.
> > >
> > >Please help me out.
> > >thanks
> > >siva.
> > >
> > >
> > >
> > >to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> > >
> > >
>

Reply by Rob Campbell February 6, 20092009-02-06
Hi,

Second attempt at posting a reply ...

The exact value depends on the particular crystal's specification
(load capacitance) and any stray capacitance on your PCB (rule of
thumb is 5pF). A lot depends on just how accurate you want the PIC
clock frequency to be, if it doesn't matter too much then anywhere
between 15-33pF is probably OK.

There's a useful FAQ at http://www.foxonline.com/techfaqs_cry.htm#a4
an also the tutorial section at http://www.foxonline.com/tech3031.htm

Regards,
Robert
--- In p..., Dwayne Reid wrote:
>
> Hi there, Stewart.
>
> At 03:31 AM 1/5/2009, stewart_bakeruk wrote:
>
> >According to the 16F877A datasheet, for a 4MHz crystal oscillator
the
> >values of the capacitors should be 15pF. The value would be
higher if
> >you were using a ceramic resonator as a clock.
>
> Can you explain your reasoning for choosing 15pF capacitors?
>
> We use 22pF capacitors with no problems and I have seen designs
that
> use 33pF caps for 4MHz crystals.
>
> dwayne
>
> --
> Dwayne Reid
> Trinity Electronics Systems Ltd Edmonton, AB, CANADA
> (780) 489-3199 voice (780) 487-6397 fax
> www.trinity-electronics.com
> Custom Electronics Design and Manufacturing
>

Reply by Rob Campbell February 6, 20092009-02-06
Hi,

The values are dependent on the specifications for a particular
crystal and the stray capacitance in your circuit. There's a useful
FAQ at http://www.foxonline.com/techfaqs_cry.htm#a4

Regards,
Robert

--- In p..., Dwayne Reid wrote:
>
> Hi there, Stewart.
>
> At 03:31 AM 1/5/2009, stewart_bakeruk wrote:
>
> >According to the 16F877A datasheet, for a 4MHz crystal oscillator
the
> >values of the capacitors should be 15pF. The value would be
higher if
> >you were using a ceramic resonator as a clock.
>
> Can you explain your reasoning for choosing 15pF capacitors?
>
> We use 22pF capacitors with no problems and I have seen designs
that
> use 33pF caps for 4MHz crystals.
>
> dwayne
>
> --
> Dwayne Reid
> Trinity Electronics Systems Ltd Edmonton, AB, CANADA
> (780) 489-3199 voice (780) 487-6397 fax
> www.trinity-electronics.com
> Custom Electronics Design and Manufacturing
>

Reply by "Sandeepa.D.Khale" February 6, 20092009-02-06
Does the PIC and the LCD have good grounds ?Have you grounded both the GND
pins of the PIC and used the required decoupling capacitors there ?
Reply by monkeybiter1 February 6, 20092009-02-06
have you got a decoupling cap between ground and v+ ?
are you using breadboard?
--- In p..., siva.gram@... wrote:
>
> hai to all,
> Iam using pic16f877a and 16 x 2 lcd to display my string as an
array.
>
> The problem is when i touch the crystal legs, I could find the
characters display steadily or else the display is flickering. I use
a 4mhz crystal. I even grounded the body of the crystal. But
eventhen the problem occurs. I use 33pf decoupling capacitors for
the crystals.
>
> Please help me out.
> thanks
> siva.
>

Reply by Mike Harpe January 8, 20092009-01-08
It's my understanding that the crystal manufacturer can usually
provide guidance on the right values for the caps to get a reliable
start and operation in a given application.

I don't recall seeing your construction technique mentioned. Are you
using protoboard? Protoboards are notorious for stray capacitance
with quite high values. I've had trouble getting the 32.768 kHz
oscillator to start when using protoboards.

Mike Harpe

On Thu, Jan 8, 2009 at 11:45 AM, Dwayne Reid wrote:
> The reason I ask is that I think that 15pF caps is too low a value
> for 4 MHz operation.
>
> I'm not a crystal-oscillator expert but what I have been told is that
> as far as the crystal is concerned, the 2 caps appear to be in
> series. Add in the several pF of stray capacitance as well.
>
> So: 2- 15pF caps in series is about 7p5, add in a couple of pF for
> strays - and the crystal is seeing perhaps 10pF capacitance.
>
> I guess that what I am saying is that you may want to consider
> increasing the value of both capacitors to somewhere between 22pF to
> 33pF. Do let us know if that makes any difference.
>
> dwayne
> At 04:19 AM 1/8/2009, stewart_bakeruk wrote:
>
>>Hi Dwayne,
>>I must admit that in the past I have used 33pF capacitors with a 4 MHz
>>crystal. It's just that in the datasheet it says 15pF (unless I have
>>read it wrong !).
>>
>>Cheers
>>Stewart
>>--- In p..., Dwayne Reid wrote:
>> >
>> > Hi there, Stewart.
>> >
>> > At 03:31 AM 1/5/2009, stewart_bakeruk wrote:
>> >
>> > >According to the 16F877A datasheet, for a 4MHz crystal oscillator the
>> > >values of the capacitors should be 15pF. The value would be higher if
>> > >you were using a ceramic resonator as a clock.
>> >
>> > Can you explain your reasoning for choosing 15pF capacitors?
>> >
>> > We use 22pF capacitors with no problems and I have seen designs that
>> > use 33pF caps for 4MHz crystals.
> --
> Dwayne Reid
> Trinity Electronics Systems Ltd Edmonton, AB, CANADA
> (780) 489-3199 voice (780) 487-6397 fax
> www.trinity-electronics.com
> Custom Electronics Design and Manufacturing
>
>
>
Reply by Dwayne Reid January 8, 20092009-01-08
The reason I ask is that I think that 15pF caps is too low a value
for 4 MHz operation.

I'm not a crystal-oscillator expert but what I have been told is that
as far as the crystal is concerned, the 2 caps appear to be in
series. Add in the several pF of stray capacitance as well.

So: 2- 15pF caps in series is about 7p5, add in a couple of pF for
strays - and the crystal is seeing perhaps 10pF capacitance.

I guess that what I am saying is that you may want to consider
increasing the value of both capacitors to somewhere between 22pF to
33pF. Do let us know if that makes any difference.

dwayne
At 04:19 AM 1/8/2009, stewart_bakeruk wrote:

>Hi Dwayne,
>I must admit that in the past I have used 33pF capacitors with a 4 MHz
>crystal. It's just that in the datasheet it says 15pF (unless I have
>read it wrong !).
>
>Cheers
>Stewart
>--- In p..., Dwayne Reid wrote:
> >
> > Hi there, Stewart.
> >
> > At 03:31 AM 1/5/2009, stewart_bakeruk wrote:
> >
> > >According to the 16F877A datasheet, for a 4MHz crystal oscillator the
> > >values of the capacitors should be 15pF. The value would be higher if
> > >you were using a ceramic resonator as a clock.
> >
> > Can you explain your reasoning for choosing 15pF capacitors?
> >
> > We use 22pF capacitors with no problems and I have seen designs that
> > use 33pF caps for 4MHz crystals.
--
Dwayne Reid
Trinity Electronics Systems Ltd Edmonton, AB, CANADA
(780) 489-3199 voice (780) 487-6397 fax
www.trinity-electronics.com
Custom Electronics Design and Manufacturing
Reply by stewart_bakeruk January 8, 20092009-01-08
Hi Dwayne,
I must admit that in the past I have used 33pF capacitors with a 4 MHz
crystal. It's just that in the datasheet it says 15pF (unless I have
read it wrong !).

Cheers
Stewart
--- In p..., Dwayne Reid wrote:
>
> Hi there, Stewart.
>
> At 03:31 AM 1/5/2009, stewart_bakeruk wrote:
>
> >According to the 16F877A datasheet, for a 4MHz crystal oscillator the
> >values of the capacitors should be 15pF. The value would be higher if
> >you were using a ceramic resonator as a clock.
>
> Can you explain your reasoning for choosing 15pF capacitors?
>
> We use 22pF capacitors with no problems and I have seen designs that
> use 33pF caps for 4MHz crystals.
>
> dwayne
>
> --
> Dwayne Reid
> Trinity Electronics Systems Ltd Edmonton, AB, CANADA
> (780) 489-3199 voice (780) 487-6397 fax
> www.trinity-electronics.com
> Custom Electronics Design and Manufacturing
>

Reply by JCullins January 5, 20092009-01-05
I am in between; I use 27pf and have had no problems.
Jim

www.soundlogicus.com
Plasma THC-300
Serial Spindle Speed control
-----Original Message-----
From: p... [mailto:p...] On Behalf Of
Dwayne Reid
Sent: Monday, January 05, 2009 11:22 AM
To: p...
Subject: Re: [piclist] Re: pic 16f877a with lcd flickering problem

Hi there, Stewart.

At 03:31 AM 1/5/2009, stewart_bakeruk wrote:

>According to the 16F877A datasheet, for a 4MHz crystal oscillator the
>values of the capacitors should be 15pF. The value would be higher if
>you were using a ceramic resonator as a clock.

Can you explain your reasoning for choosing 15pF capacitors?

We use 22pF capacitors with no problems and I have seen designs that
use 33pF caps for 4MHz crystals.

dwayne

--
Dwayne Reid
Trinity Electronics Systems Ltd Edmonton, AB, CANADA
(780) 489-3199 voice (780) 487-6397 fax
www.trinity-electronics.com
Custom Electronics Design and Manufacturing


to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions