Maker Pro
Maker Pro

if there possible for pic to faulty?

If it works with the XT option, then you have not showed us the correct schematic. There is no crystal in your schematic. If you have no crystal, the oscillator should be set to the internal oscillator.

Bob
 
Wait a second, so XT option is for external osscillator right? Actually I doesn't use any external osscillator.
 
Last edited:
So, I doubt that your PIC is running. What makes you think it is?

Change the oscillator setting to INTOSC.

Edited:

Uh Oh, that is an ancient chip and has no internal oscillator. You must use either a crystal with the osc set to XT or HT, or use an external resistor and capacitor with the osc set to RC. See section 14.2 of the datasheet.

Where did you get that chip? There are much more capable chips at a fraction of the price of that chip available today.

Bob
 
Last edited:
I think this is reason why my led is not blinking.
#define __XTAL_FREQ 20000000
Above is instruction to declare speed of external oscillator.
So without put external oscillator the __delay_ms(); instruction not execute.
That I'm right guys? :confused:
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Without the external oscillator the PIC will just sit there dead and lifeless.

The clock is what breathes life into the chip. When the clock stops, the PIC stops.
 
Great explaination steve. That is my mistake not read a datasheet completely.
Now i realize PIC16F877A doesn't have internal oscillator.:eek:
 
Hi guys this problem is overcome.
I've make simple circuit to test my PIC.in this circuit switch as counter.
When counter=1 led1=on led2=off
When counter=2 led1=off led2=on
When counter=3 led1=on led2=on
When counter=4 led is off and counter back to 0.
When I try in simulation its working .
But, sadly when try in hardware its not working and nothing happen.I check the voltage its oky.power source that I used is battery 9V and lowered the voltage using by 78L05 voltage regulator. I allready pullup mclr pin and check the configuration bits.
FOSC=HS oscillator
WDT=disable
PWRTE=Enable
BOREN=disable
LVP=disable
CPD=off
WRT=off
CP=off

I attach this post with schematic circuit.
Hope u guys can help me solve my problem
 

Attachments

  • schematic2.jpg
    schematic2.jpg
    80.4 KB · Views: 134
  • LED2.txt
    1.2 KB · Views: 174
.1uF is way to big for the capacitors in the crystal oscillator. Try 27pF. Or better yet, look up the capacitance required for the crystal, then multiply by 2 since the two are in series, and subtract maybe 5pF for stray capacitance.

Bob
 
If you are using an oscillator module and NOT a crystal, you don't need capacitors at all. The output of the oscillator is conected to the input of the PIC oscillator pins, or OSC1/CLKIN on Your drawing.

For us to say the capacitor value for a Crystal, we need to have the exact type description and brand name, but 22pF should be around the value.
 
If you are using an oscillator module and NOT a crystal, you don't need capacitors at all. The output of the oscillator is conected to the input of the PIC oscillator pins, or OSC1/CLKIN on Your drawing.

For us to say the capacitor value for a Crystal, we need to have the exact type description and brand name, but 22pF should be around the value.

Uh,thx gorgon.
 
We'll stop laughing when you get it running! Did you try 22 or 27 pF capacitors yet?
15pF might also work for a crystal of that high frequency.

Bob
 
Top