Quote Originally Posted by Gusse View Post
What kind of voltage divider you are using?
If you try to get full 0-5V scale with 0-15V input, then you should use 1:3 ratio (e.g. 22kOhm and 11kOhm resistors) to get best measurement accuracy.

With this divider 15V -> 5V (and 0V -> 0V) at ADC input pin, ADC should show 255 (8bit) or 4095 (12bit).
I'm using a 10K and a 3.3K and my ADCbits is set to 10. Here's the ADC setup (maybe I'm doing something wrong there)

Code:
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS
ADCON0 = %11000000 ' Set ADC_CLOCK to Frc, 
ADCON1 = %10000000 ' Right-Justify result in ADRESH:ADRESL registers, use Vss and Vdd as voltage refernces