This is "lifted" from one of my programs.
Note that I use a high-accuracy reference voltage on RA3 and I run at 40Mhz.
If you are running at 20Mhz, you can set the clock divisor to /32


ADCON0 = %00000001
ADCON1 = %00010011 ;Set Vref on RA3, 11 readable chan A/D (AN0-AN11)
ADCON2 = %10011110 ; Right justify clk/64

;-----------------------------------------------------------------------
Chan = 1 ; or whatever channel you want to read
AVGVAR = 12 ; The number of samples you want to take (for averaging and scaling)

Gosub DoADC

;Result in ADCStor

;----------------------------------------------------------------------


DOADC:
ADCSTOR = 0
For X = 1 to AVGVAR
ADCIN Chan,ADCVAR
ADCSTOR = ADCSTOR + ADCVAR
PAUSEUS 20
Next X
Return