Skip to main content
Associate II
Question

ΑDC2 reads ~0.2 V lower than the voltage measured at the pin. (stm32h7)

Hello, 

I am trying to measure a DC voltage via a channel on ADC2 on STM32H723, but the voltage measured on the pin with a multimeter differs a lot, about approx 0.2-0.3V. I have tried increasing the sampling time by increasing the cycles of this rank but did not seem to help.

What I have already tried is:

  • Sampling time from 32.5 up to 387.5 cycles
  • ADC clock from 16 MHz down to 3 MHz
  • 12-bit and 16-bit, with and without hardware oversampling x8
  • VREFBUF mode and the VREF+ voltage checked

Any ideas on what else should i check?

Thanks 

11 replies

TDK

How is VREF+ connected and how is VREFBUF configured?

What voltage are you measuring? What voltage is the STM32 measuring?

How is the pin being driven? High impedance pins will need an appropriate sampling time.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II

Vref+ is an external 3.3V.Vrefbuf : external voltage reference. 3V from a generator , then a filter then divided by 2 so i should be seeing approx 1.5V. Measuring with a multimeter the pin , i got around 1.49 but still on debug mode i get around 1.27. the charge bucket is 30Ω/ 2nF so no high impedance. Thanks for the reply

TDK

A schematic would help answer a lot of these questions.

Is VREF+ <= VDDA at all times, including startup?

Is there a 1 uF + 100 nF on VREF+ near the pin?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II

yes in my case vref+=vdda=3.3V. and yes there are both of the caps near the st.

TDK

Is the ADC calibrated on startup?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II

yes i added the function HAL_ADCEx_Calibration_Start()    before starting the adcs with DMA

MasterT
Lead II

Something wrong with calibration, function needs parameters :

    if (HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET_LINEARITY, conf_in) != HAL_OK) {

 

waclawek.jan
Super User

What is “VREFBUF mode”, in terms of VREFBUF register content, read out using debugger? 

What is “charge bucket”? Can you try other input voltages? What about measuring the internal reference, what’s ther result there?

JW

 

Associate II

VREFBUF mode is a configuration in CubeMX that "tells” the st where to get the vref+ from, i have an external component for that and thus i have set it to external. (3.3V), with Charge Bucket I mean the R-C after the analog filter and right before the st pin. I have tried multiple input voltages, i got the same problem. 

waclawek.jan
Super User

i got the same problem. 

 

A voltage offset, constant i.e. independent from the input voltage? Or proportional to the input voltage, i.e. constant in percentage? Or anything else?
JW

TDK

If you want to show your schematic and relevant code, I’ll take a look. 20 questions only goes so far.

"If you feel a post has answered your question, please click ""Accept as Solution""."