EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

pic 16f877a with lcd flickering problem

Started by siva...@gmail.com January 1, 2009
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 ?
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
>

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
>

--- 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
> > >
> > >
>

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
>

The 2024 Embedded Online Conference