Use the AN number in ADCIN statements instead of the PORT.pin.
And you don't need the ADCON0, VRCON or CMCON0 statements.Code:adcin 3,reading
But you will need ADCON0.7 = 1 ; Right Justify A/D result
Since you are getting 1023 as the result, I assume you've set the ADC defines to 10-bit.
Also, make sure your primary oscillator is set to _INTRC_OSC_NOCLKOUT in the configs (it's the default).
Bookmarks