I have recently started learning to use pic micro controller. I am using pic16f887 mc and for programing using mplabx with xc8 compiler. My micro controller is getting reading from switch and turning on led when I use any digital i/o pin except rb0-rb5. I don't know why those pins are not working. I made the circuit in proteus also.It is giving me the same result. Can anybody tell me why this is happening? Here are codes and schematic where I used rc7 for input and that works perfectly.
void main(void) {
OSCCON=0x76;
TRISC7 = 1; //RC7 as INPUT PIN
TRISD1 = 0; //RD0 as OUTPUT PIN
RD1 = 0; //LED Off
while(1)
{
if(RC7 == 0) //If Switch Pressed
{
__delay_ms(100);
if(RC7==0)
{
RD1 = 1; //LED ON
__delay_ms(3000); //3 Second Delay
RD1 = 0; //LED OFF
}
}
}
return;
}