ADCON0:
bit7 - ADCS1
bit6 - ADCS0
bit5 - CHS2
bit4 - CHS1
bit3 - CHS0
bit2 - GO/DONE
bit1 - unimplemented bit
bit0 - ADON
----------------------------------------------------------
ADCON1:
bit7 - ADFM
bit6 - unimplemented bit
bit5 - unimplemented bit
bit4 - unimplemented bit
bit3 - PCFG3
bit2 - PCFG2
bit1 - PCFG1
bit0 - PCFG0
---------------------------------------------------------
According to the registers above, I set RA3 as Vref+ and RA2 as analog input:
I can't get any power supply from RA3, why? If there is no power supply from RA3, then why LCD didn't show 0 value? Any problem with my register setting?
bit7 - ADCS1
bit6 - ADCS0
bit5 - CHS2
bit4 - CHS1
bit3 - CHS0
bit2 - GO/DONE
bit1 - unimplemented bit
bit0 - ADON
----------------------------------------------------------
ADCON1:
bit7 - ADFM
bit6 - unimplemented bit
bit5 - unimplemented bit
bit4 - unimplemented bit
bit3 - PCFG3
bit2 - PCFG2
bit1 - PCFG1
bit0 - PCFG0
---------------------------------------------------------
According to the registers above, I set RA3 as Vref+ and RA2 as analog input:
Rich (BB code):
TRISA = 0b11111;
TRISE = 0b111;
ADCON0 = 0b10010001;
ADCON1 = 0b10000001;
__delay_ms(2);
ADGO=1;
while(ADGO==1)
continue;
return(256*ADRESH+ADRESL);