Hi Ronjodu,
You didn't post all your code but as the 16F876 is analog input on PORT A and all MCU with analog input comes up in analog mode you have to set it to digital before using it.
Try to add in the begin of your code:
ADCON1=7
I hope this solve your problem.
Hans
Bookmarks