Uregnt help needed(Problems with my oscillator for PIC 16f877a)

Started by Aravind November 27, 2003
I have a PIC 16F877A I/P(a sample I got from microchip). I am not
able to make it run properly using a 4Mhz resonator. I used 15pF
capacitors as mentioned in the datasheet and also tried it out with
33pF and 47pF. It blinks properly for some time and then it either
stops blinking or it keeps glowing.

I also tried it using a 1MHz oscillator. I provided the clock in at
OSC1 and left the OSC2 open. Even then I have the same problem.

I also tried the same with PIC16F876A E/SP(sample from microchip). I
encounter the same problem.

I am using a JDM based programmer(Olimex PIC-PG2C) to download the
program using IC-Prog 1.05A. Here is my program for 16F876A. (CCS
compiler IDE 3.36 PCM 3.170)

#include <16F876A.h>
#use delay(clock00000)
#fuses XT, NOWDT
void main()
{
while(1){
output_bit(pin_b7,1);
delay_ms(1000);
output_bit(pin_b7,0);
delay_ms(1000);
}
} I hope someone can tell me whats going on, its really urgent.

Bye
aravind





What are you doing with the MCLR' pin? It must be pulled high.

--- In , "Aravind" <aravind_s_in@y...> wrote:
> I have a PIC 16F877A I/P(a sample I got from microchip). I am not
> able to make it run properly using a 4Mhz resonator. I used 15pF
> capacitors as mentioned in the datasheet and also tried it out
with
> 33pF and 47pF. It blinks properly for some time and then it either
> stops blinking or it keeps glowing.
>
> I also tried it using a 1MHz oscillator. I provided the clock in
at
> OSC1 and left the OSC2 open. Even then I have the same problem.
>
> I also tried the same with PIC16F876A E/SP(sample from microchip).
I
> encounter the same problem.
>
> I am using a JDM based programmer(Olimex PIC-PG2C) to download the
> program using IC-Prog 1.05A. Here is my program for 16F876A. (CCS
> compiler IDE 3.36 PCM 3.170)
>
> #include <16F876A.h>
> #use delay(clock00000)
> #fuses XT, NOWDT
> void main()
> {
> while(1){
> output_bit(pin_b7,1);
> delay_ms(1000);
> output_bit(pin_b7,0);
> delay_ms(1000);
> }
> } > I hope someone can tell me whats going on, its really urgent.
>
> Bye
> aravind





Thanks a lot. Its working. But whats MCLR. The datasheet says "
Master Clear (input) or programming voltage (output).
Master Clear (Reset) input. This pin is an active low Reset
to the device"

What does that mean. I am a newbie to pics and for that matter to
any microcontrollers. It might be a dumb question. But I would like
to know what that is.

Once again thanks for your help.

Bye
aravind
--- In , "rtstofer" <rstofer@p...> wrote:
>
> What are you doing with the MCLR' pin? It must be pulled high.
>
> --- In , "Aravind" <aravind_s_in@y...>
wrote:
> > I have a PIC 16F877A I/P(a sample I got from microchip). I am
not
> > able to make it run properly using a 4Mhz resonator. I used 15pF
> > capacitors as mentioned in the datasheet and also tried it out
> with
> > 33pF and 47pF. It blinks properly for some time and then it
either
> > stops blinking or it keeps glowing.
> >
> > I also tried it using a 1MHz oscillator. I provided the clock in
> at
> > OSC1 and left the OSC2 open. Even then I have the same problem.
> >
> > I also tried the same with PIC16F876A E/SP(sample from
microchip).
> I
> > encounter the same problem.
> >
> > I am using a JDM based programmer(Olimex PIC-PG2C) to download
the
> > program using IC-Prog 1.05A. Here is my program for 16F876A.
(CCS
> > compiler IDE 3.36 PCM 3.170)
> >
> > #include <16F876A.h>
> > #use delay(clock00000)
> > #fuses XT, NOWDT
> > void main()
> > {
> > while(1){
> > output_bit(pin_b7,1);
> > delay_ms(1000);
> > output_bit(pin_b7,0);
> > delay_ms(1000);
> > }
> > }
> >
> >
> > I hope someone can tell me whats going on, its really urgent.
> >
> > Bye
> > aravind






For the most general use it is the reset signal. Pull it low to
reset the PIC and start execution from 0x000. The problem is that
it needs to be pulled up externally or it floats in a voltage range
that will randomly reset the processor.

A high voltage is also applied to this pin during programming but
that is not the kind of thing you need to worry about unless you are
designing programmers. Well, if you get around to In Circuit Serial
Programming (ICSP) you will also need to deal with the pull-up
resistor value so that the high voltage doesn't damage the rest of
the system.

Just think of it as a reset signal for now and pull it up with a 10k
resistor. Do not connect it solidly to +5V.

--- In , "Aravind" <aravind_s_in@y...> wrote:
> Thanks a lot. Its working. But whats MCLR. The datasheet says "
> Master Clear (input) or programming voltage (output).
> Master Clear (Reset) input. This pin is an active low Reset
> to the device"
>
> What does that mean. I am a newbie to pics and for that matter to
> any microcontrollers. It might be a dumb question. But I would
like
> to know what that is.
>
> Once again thanks for your help.
>
> Bye
> aravind