cancel
Showing results for 
Search instead for 
Did you mean: 

ADC offset error

markmark9122
Associate
Posted on September 06, 2013 at 13:49

I am using 2 ADC inputs on an STM32F103.  Vref is 2.500V, from a voltage reference. One input is multiplexed via relays from a variety of external analogue signals and works well.  The other is used to monitor the supply voltage via a 68K/10K resistor divider, with a 100nF capacitor across the 10K.  The ADC should therefore give a reading of 0...4095 from a battery voltage in the range 0...19.5V.

I have measured the voltage on the ADC input pin and it is Vbatt/7.80 as expected.  The ADC reading varies linearly with the battery voltage, but has a fixed offset, regardless of battery voltage.  The offset varies between supposedly identical targets.  Three samples give offsets of  -43, +83 and -55, giving voltage reading errors of up to 0.4V.

I have checked to make sure that no I/O pins exceed the supply rails.  The strange thing is that the channel used to monitor the external analogue signals doesn't exhibit any significant offset.  That input goes to Vdd when no external signal is being sampled,but I have tried forcing it to Vss and that makes no difference.

After each power-up the firmware does an ADC calibration (although I can't believe that any initial calibration errors would be of the magnitude I am seeing).

Any ideas?

#adc-offset-accuracy-calibration
1 REPLY 1
raptorhal2
Lead
Posted on September 07, 2013 at 22:38

Try using the maximum sampling time. The sample and hold capacitor may not be getting to full charge.

Cheers, Hal