cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-G071 ADC measurements

JBH
Associate

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,

2 REPLIES 2
TDK
Super User

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".

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