ADCON1 = %01100011
For your ADC Clock to = 3, ADCON1 must be %0011....
You have the ADC Module looking at the FVR for a VREF+ (bits <2-0> of ADCON1). Nowhere in your listing do you mention setting up the FVRCON register so your ADC has its positive reference turned on. You might want to change ADCON1 to %00110000 and use Vdd for your VREF+.
You can use the ADCIN command, ADCIN 0, VAR and PBP will automatically adjust ADCON0 to AN0 for you, or you can work it manually:
ADCON0 = %00000011
DO
LOOP WHILE ADCON0.1 = 1. ;The GO bit
VAR = ADRESH
This gives you an 8-bit ADC value. For AN1, ADCON0 = %00000111, for AN2, ADCON0 = %00001011, and so forth.
Bookmarks