I need to digitize analog signals from sensors with maximum rating. But the output data i get is incorrect: meanings are decreasing while input signal is constant. I use the following configuration of ADC and core frequency:
1) POWCON = 0x00
2) ADCCON = 0x3A4 (16 clocks, max f, continuous software conversation)
3) internal Vref=2,5 (REFCON = 0x01)
As input chanels ADC 0,1,2,3,4,12,13 are used. The code is:
ADCCP = chanel;
ADCCON = 0x3A4;
ADCdata[i] = (ADCDAT>>16)&0xfff;
ADCCON = 0x324;
The result is: ADCdata = 2055 ... ADCdata = 2042. Real input signal corresponds to ADCdata.
How can I get the correct digital signal?