Showing results for 
Search instead for 
Did you mean: 

config OPAMP in non-inverting configuration with the output of opamp connected to ADC: is it possible?

Associate II

Good morning,

i' m working with stm32g4 and for

my application i need use internal opamp in non- inverting configuration with

external resistor how show the figure below (figure form AN5306).


I don’t understand if is possible connect the output of opamp to ADC when i use external resistors to set the gain. Reading AN5306 seems that i can choose only one option:

 OPAINTOEN = 0 connect the output of opamp to Vout.

Or OPAINTOEN = 1 connect the output of opamp to ADC.

How  can i connect the output of opamp to ADC and use it in non-inverting configuration with external resistor?

Thanks in advance

Andrea Canepa

You can use the nice functionality of STM32G4: you can use the same pin for analog signals.

So I would do it this way:

  • I set the OPAMP to STANDALONE mode: so externally you can make the circuit you want.
  • Then I set the OPAMP output pin to share the signal with an ADC input: so you can send the OPAMP signal to the ADC input saving an additional pin.

For example: with STM32G431RBT6 I see that pin PA2 is shared by OPAMP1_VOUT and ADC1_IN3, therefore I will go to use OPAMP1 for my purpose and the ADC1_IN3 input will be the one used to convert the analog signal.

To share the pin between OPAMP and ADC you can use CUBE_MX or CubeIDE: look at the following image ....


Best regards


Associate II

Hello Andrea,

thank you for the answer.

I'll try to apply this solution.

Best regards