sukhavsa
Newbie level 6
I am using the ADC on PIC18f8722 to measure the voltage output of a sensor. I have noticed a considerable error in the ADC readings.
To make sure the ADC was working fine i connected a regulated power suppy to the ADC and the error was still there.
The difference in the voltage measured and the actual voltage was ranging from 0.01V to 0.1V(which is considerable and not what the datasheet says)
the difference was low for lower voltages i.e 0.01 for an input of 0.5V and increased as the input voltage increased in an almost linear fashion.
I have tried oversampling but still the issue remained.
Any one has an idea the reason behind this behaviour!!!
here are my ADC config settings
ADCON1 = 0x00;
ADCON0 = 0b00010101; // AN5(RF0) as ADC input channel
ADCON2 = 0b10111110; //right justified, 20TAD, FOSC/64
To make sure the ADC was working fine i connected a regulated power suppy to the ADC and the error was still there.
The difference in the voltage measured and the actual voltage was ranging from 0.01V to 0.1V(which is considerable and not what the datasheet says)
the difference was low for lower voltages i.e 0.01 for an input of 0.5V and increased as the input voltage increased in an almost linear fashion.
I have tried oversampling but still the issue remained.
Any one has an idea the reason behind this behaviour!!!
here are my ADC config settings
ADCON1 = 0x00;
ADCON0 = 0b00010101; // AN5(RF0) as ADC input channel
ADCON2 = 0b10111110; //right justified, 20TAD, FOSC/64