// CONFIG
#pragma config FOSC = INTOSCCLK // Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF // MCLR Pin Function Select bit (MCLR pin function is digital input, MCLR internally tied to VDD)
#pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled)
#pragma config IOSCFS = 8MHZ // Internal Oscillator Frequency Select bit (8 MHz)
#pragma config BOREN = ON // Brown-out Reset Selection bits (BOR enabled)
TRISAbits.TRISA4=1;
PORTAbits.RA4=1;
ANSELbits.ANS3=1;
ADCON0=0x8D;
ADCON1 = 0X50;
|