cancel
Showing results for 
Search instead for 
Did you mean: 

Can OP-AMPS in STM32 G4 be used as DIFFERENTIAL AMPLIFIERS?

Sud_09
Associate II

I was going through the reference manual of STM32G4 series MCU. I saw information on using Op-Amps inside the STM32G4 as Inverting and Non-inverting amplifiers. There was no mention of them used as differential amplifiers, can they be used as differential amplifiers?

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @Sud_09 and welcome to the Community,

Using OPAMPs of the STM32G4 series can indeed be used as differential amplifiers and supporting both inverting and non-inverting inputs. When using the OPAMPs as differential amplifiers, consider the following: gain settings, performance parameters, and environmental factors to ensure reliable operation.

I recommend you the Application note AN5306, which provides practical examples, including examples of OPAMP configuration (inverting and Non-inverting amplifier configurations).

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

6 REPLIES 6
Imen.D
ST Employee

Hello @Sud_09 and welcome to the Community,

Using OPAMPs of the STM32G4 series can indeed be used as differential amplifiers and supporting both inverting and non-inverting inputs. When using the OPAMPs as differential amplifiers, consider the following: gain settings, performance parameters, and environmental factors to ensure reliable operation.

I recommend you the Application note AN5306, which provides practical examples, including examples of OPAMP configuration (inverting and Non-inverting amplifier configurations).

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Ozone
Principal II

Operational amplifiers can always be used as differential amplifiers - this is what they are.
But I'm not sure you understand what this entails.
Such a device amplifies the difference between its (+) and (-) input, but the output will always remain within the bounds of the negative and positive supply voltages of the amplifier. Which are, in case of the STM32, +3.3V and GND.

The internal opamps are single-rail or single supply opamps, which implies the use of a virtual GND potential the output relates to. In most cases, this virtual GND potential is Vcc / 2.

I had one more question. The reference manual (RM0440) says 'The devices embed six operational amplifiers'. Can TWO of them be used as differential amplifiers simultaneously?
Thanks.

Hello @Sud_09 ,

If your original question has been answered by one of the contributors, please accept it as solution and open a new thread for the new one.

Thank you for your understanding.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thank you for the information. I understand that they are not rail-to-rail. I am not looking to measure negative voltages. I just want to measure varying DC voltages (Line voltage after the rectifier). So I can use the full 0-3.3V range by connecting the Op-Amp ground to the system ground and feeding the output of the Op-Amp to the ADC, right? (Check attached picture)

Yes, STM32G4 OP-AMPs can be used as differential amplifiers to measure varying DC voltages, such as rectified line voltage. By connecting the OPAMP ground to the system ground and feeding the output to the ADC, you can utilize the full 0-3.3V range. For that, ensure proper configuration, calibration, and noise minimization for accurate measurements.

You can get inspired from available OPAMP examples, that will help your on how to configure the OPAMP and use the self-calibration right after Op-Amp init:

STM32CubeG4/Projects/STM32G474E-EVAL/Examples/OPAMP at master · STMicroelectronics/STM32CubeG4 · GitHub

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen