cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F373 ADC values are incorrect (between 1-20% from measured pin voltage)

CChow.1
Associate II

My MCU is the STM32F373VCT6. I am performing a single scan of several ADC channels (DMA). The values returned are generally in the ballpark of where they are supposed to be but some values are very off from the measured pin values. I believe my configuration is correct as the readings which are supposed to be returning 0 are returning values of 0, and when I swap channel ordering in the scan they change their values accordingly.

My reference voltage is a shunt reference with more than enough current, I measured it on my scope during the measurements and the voltage is stable. Similarly the voltages of the ADC supply and the ADC pins themselves are also stable during measurement. I checked by triggering on a digital IO toggling right before initializing the ADC conversions.

The readings do update whenever I re-run conversions, but they stay basically in the same ballpark (i.e. they may shift by a bit or two so I know the readings are actually updating). I have also tried changing my sampling time (from 13.5 cycles all the way up to 239.5 cycles per channel) and that does not seem to have any noticeable correction on the output.

My analog supply voltage does come up a little bit slower than my digital supply on power on, but I have a schottky in between them so the differential voltage is such that the digital is never more than 200 mV above the  analog supply.

6 REPLIES 6

How comes that reading of 1886 corresponds to 2.76V and 3328 to 2.43V?

Also the zeros are suspicious. I'd expect some noise. Don't you inject negative current?

JW

CChow.1
Associate II

Sorry, that last 1886 is the VBAT measurement which is supposed to have a 50% internal resistor divider on that pin, so for that formula I multiply by 2.

The zeros are suspicious I agree, although when I run real voltages on those signals I also get values approximately 1-2% off from their expected values. Those signals are buffered with pulldowns on the amp inputs so when no voltage is applied they drop to 0.

Sorry, that last 1886 is the VBAT measurement which is supposed to have a 50% internal resistor divider on that pin, so for that formula I multiply by 2.

The zeros are suspicious I agree, although when I run real voltages on those signals I also get values approximately 1-2% off from their expected values. Those signals are buffered with pulldowns on the amp inputs so when no voltage is applied they drop to 0.

Well, then I don't know... Negative injection from any other pin (including digital)? Bad solder joint on GND (especially the analog ones)? Too high or too low ADC clock?

JW

Ozone
Lead

A custom board, with separate VDDA ?

Some Discovery/Nucleo boards have VDD and VDDA directly connected, and a shottky diodes in the supply lines to decouple the different supply options.

Yes a custom board with separate VDDA and VDD. During steady state my VDDA is at 3.45V and my VDD is at 3.3V. I have a schottky between the two supplies so that VDD never goes too far above VDDA during turn on, as per the reference manual.

"It is forbidden to have VDDA < VDD - 0.4 V. A external Schottky diode must be placed between VDD and VDDA to guarantee this condition is met" << from the Power Control section of the reference manual