I wrote a program to upload to my PIC16F877A. Initially it uploaded correctly using the PICkit2 programmer and the microcontroller worked fine, but when I tried to change a piece of code and reprogram the same PIC the program was successfully uploaded but when I tried to test the chip it didn't work.
I tried several times without success. What is the possible solution? The code was written on MPLAB XC8 IDE v3.5. Configuration is
#pragma config FOSC = HS ,WDTE = OFF ,PWRTE = OFF,BOREN = OFF,LVP = OFF ,CPD = OFF,WRT = OFF,CP = OFF. I'm using an external 8 MHz crystal.
After failure in MPLAB I tried to write a simple "Blinking LED" in MikroC but no success, it still didn't work.