Oscillator not working on PIC16F877

Thread Starter

lehee2003

Joined Apr 7, 2011
6
Hello All,
Am in serious trouble and i need your assistance. My project is not working and after trouble shooting I found out that d problem is from the oscillator. The crystal (4MHz) was connected to pin 13 & 14 of the PIC16F877A with a capacitor of 30PF. Also on my pin 1 I have a 10K resistor to power. At pin 11,12, 31 & 32 were connected to Vdd & Vss with a 100nF connected across each pin (i.e 11&12, 31&32) respectively.

The output voltage from the oscillator is less 0.7V instead of 2.2 0r 2.5V respectively.
The project is Automatic Plant Irrigation. At the moment only the red LED that is up, and the other Leds are down even if my probe (copper wires) are dip into wet soil.

Please help as soon as possible as death line is jst a few days frm nw
Thanks
 

Markd77

Joined Sep 7, 2009
2,806
Sounds like the oscillator is fine if the red LED is connected to an IO pin. If it wasn't running the pins would be inputs and could not power a LED.
We would need a schematic and code if you need more help.
 

t06afre

Joined May 11, 2009
5,934
You do not set the configuration word(s) in your code. It may be because you do set them in MPLAB. But if the configuration word(s) are not properly set. Your MCU you will not work as wanted
 

MikeInRI

Joined Apr 6, 2011
3
"...I found out that d problem is from the oscillator..."

You can doublecheck this by configuring the internal RC for now.

Is this circuit on your own PCB or breadboard?
 

Thread Starter

lehee2003

Joined Apr 7, 2011
6
Hello MikeInRI

The circuit is still on my bread board.

How can i go about this (the truth is that am very new in the PIC world) and i guess that is why am experiencing new thing.
I wouldn't mind if i can be given some guide line .

@t06afre
Can you please throw more light on this?

Tanks, as u guys are doing a great job in the engineering profession

Regards,
 

MikeInRI

Joined Apr 6, 2011
3
....How can i go about this (the truth is that am very new in the PIC world) and i guess that is why am experiencing new thing.
I wouldn't mind if i can be given some guide line....
The oscillator and the two caps are meant to be as close as possible to the PIC to reduce extra capacitance from the leads.

You can try the internal RC by selecting it in the MPLAB IDE configuration settings or put it in code in the project. See post #5.
 

t06afre

Joined May 11, 2009
5,934
@t06afre
Can you please throw more light on this?
Go to help then search in MPASM Assembler for __config (yes it is two underscores). The data sheet contains all related information. Se the section "special futures of the CPU" At the end of your chip include file you will find the fuse names.
 

debjit625

Joined Apr 17, 2010
790
Are you sure its your mcu i.e.. the problem is in your mcu rather in software.First check it out,write a simple program which use about 1 second delay to turn on and off a LED at any port and test it if it works then you are having problem with your software or the hardware that interface the probe to mcu for proper conditions.

Good Luck
 

Thread Starter

lehee2003

Joined Apr 7, 2011
6
Hello All, thanks for the assistance so far. The sensors are nw responding but the prblem is that the LCD is not writing just half (i.e not full).
Plz assist
Tanks
 
Top