Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] LED blinking on PIC16F877A is not working

Status
Not open for further replies.

engr_24

Newbie level 3
Joined
Feb 4, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
34
Hello electronics enthusiasts ! I'm new here and I want some help from you guys.
My PIC16F877A doesn't work! I'm trying to blink an led but unfortunately no output.
I'm using mikroC compiler and my program is working on Proteus simulator.
My Configuration Settings is CONFIG :$2007 : 0x2F49
Recently, I replced chip itself , the crystal(8Mhz) and the two capacitors(22pf) , but the problem is not solved.
My programmer is PICkit 2 and writing '' programming successfully everytime I load the hex file.
One more thing I noticed the 3FFF thing always appear at addresses 0001 and 0002 everytime I load any hex program.
Please help me fix my problem guys, I will be greatly appreciate it Smile!!
 

If the program is working on the Proteus than it means tha there is a hardware problem.......You should check the MCLR pin properly connected through the capacitor and resistor for proper device reset...
 

Change config to 3F3A
Can we see your codes?
 

I actually disable(unchecked) the MCLR on the PICkit2 programmer during ICSP. I actually programmed this microcontroller many times like lighting leds but after I had interfaced servo motor it works fine, maybe 10 or more times of reprogramming using delay functions the PIC stops to work, then when I try even LED blinking test also shows no blinking.

- - - Updated - - -

code :
void main() {
TRISB=0;
PORTB =0;
while(1){
PORTB.B0 =1;
delay_ms(1000);
PORTB.B0 =0;
delay_ms(1000);
}

}

I think this works fine, hardware problem be the cause but what is it? I have tried to programmed it many times recently then suddenly it stops. :(
 

Program is correct
problem may exist with configuration bits

Set

PICkit2 >> Tools>>Display unimplemented config Bits>>as read or implemented
 

Do you have a CONFIG statement in your code to set the configuration bits? I don't use mikroC so maybe the configuration is set a different way. I'm betting that the clock configuration is incorrect. Proteus tends to let a program run no matter what the clock config bits are set to.
 

Are you using a current limiting resistor with the LED?
 

Try ANSELB = 0;

If not try connecting the MCLR pin to 5V via a 10k resistor. Also check whether you have set your program to correct oscillator frequency.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top