Hello together,
i want to use the AD-Converter on the 18F8722 for the first time.
I want to use the AN0 and the AN1 channel.
So I looked in the Data-Sheet and wrote this out:

DEFINE ADC_BITS 10 'trying with 10 bits resolution
DEFINE ADC_CLOCK 3 'Is this clock the same as my system clock (external
'8MHz crystal)?
DEFINE ADC_SAMPLEUS 50 'Took it from the manual, is it correct?

TRISA=%00001111 'Setting RA0 to RA3 to inputs
ADCON0=%00000111 'using AN0 and AN1
ADCON1=%00001101 'using supply voltage as vref, setting AN0 and AN1 to
'analog inputs
ADCON2.7=1 'result is right justified

...and then the ADCIN 0, variable....?

Do I have to do other settings for ADCON2, when i'm using ADCIN?
Are these settings above correct, or is something missing?

Thanks in advance!!