Thanks for the reply.
Below are my declaration
OSCCON = %01101110 ' 4 MHz, primary clock, internal RC
PIR1 = %00000000 ' clear all flags particularly A/D IF bit 6
SSPCON = %00000000
SSPBUF = %00000000
TXSTA = %00000000
RCSTA = %00000000
OPTION_REG = %00000000 'weak pullups enable
'pin IO 76543210
TrisB = %10000100
TrisA = %01010101
cmcon =7 'disable the comparator register
ADCON1 = %10000000 ' right justified, AD Clock divided by 2,Vdd = Vref+, Vss = Vref-
ANSEL=%1010100'only the RA4/AN4, RA2/AN2, RB7/AN6 as analog input
CCP1CON = %00001100
The adc are working on RA2 and RB7, but not on RA4.
Please help.




Bookmarks