pic 16f877a with lcd flickering problem

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

I guess that the simple answer is - don't touch the crystal legs ...

What you are doing by touching those connections is either stopping
the uP clock, or causing it to change frequency or level.
The result that you are seeing is quite normal for your actions.

The 33pF capacitors are not decoupling capacitors, but are the
external parts of the circuit that make the crystal oscillator -
oscillate.

Hope this helps
Stewart
--- 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.
>

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

Also Is there any difference between pic 16 F 877A and 16 LF 877A?

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

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

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