I have added the code adcon1=0x07 to it, but even then it doesn't work
Matrix Multimedia board PIC 16f876
Code: Select all
#include <system.h>
main()
{
set_bit(STATUS, RP0); //SELECTS BANK 1
TRISB=0x00; //MAKES PORTB OUTPUT
TRISA=0xff; //MAKES PORTA INPUT
clear_bit(STATUS, RP0); //SELECTS BANK 0
adcon1=0x07;
if(input_pin_port_a(0))
{
PORTB=0xff;
}
else
PORTB=0x00;
}
And also i have know what the oscillator setting should be for this. XT or RC or HS.