Skip to main content
Associate
May 21, 2025
Question

STM32-G071 ADC measurements

  • May 21, 2025
  • 1 reply
  • 522 views

Hello

I am currently working with the STM32G071 microcontroller and encountering an issue with the ADC when using a specific configuration.

Here is a summary of my setup:

  • ADC configured in "Sequencer fully configurable" mode

  • Scan conversion mode: Disabled

  • Discontinuous conversion mode: Enabled

  • Oversampling: Enabled (Ratio = 8x, Right bit shift = 3)

When I measure two or more channels in this setup, the last channel in the sequence shows an incorrect result, with an error of about 30%. The earlier channels in the sequence seem to be accurate.

I would like to understand if this behavior is expected due to the chosen configuration, or if there is a workaround or recommendation to avoid this issue. Any guidance or clarification would be greatly appreciated.

Thank you in advance for your support.

Best regards,

1 reply

TDK
Super User
May 21, 2025

Increase sample time to max for most accurate results. High impedance signals will need more time.

How to optimize the ADC accuracy in the STM32 MCUs - Application note

 

Hard to say more without seeing the setup. No reason that you should expect the last channel to be incorrect.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JBHAuthor
Associate
May 22, 2025

Hello,
First of all, my measurements work perfectly without oversampling or in "not fully configurable" mode.
I'm having an issue with the last measurement when I choose the "fully configurable" mode with oversampling.

I’m attaching the .ioc file and my main.c 

Thank you for your help.

JBH_2-1747914813040.png

JBH_1-1747914757777.png