cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use the internal OPAMP from the STM32G4 series with only the VINPx pin assigned to a physical pin? Configured as non-inverting, negative feedback with a gain.

MWält.2
Associate II

I would like to implement a current sensing using a grounded shunt resistor. Therefore I would like to use the build-in OPAMP from the STM32G491 Series. But I'm not satisfied with the CubeMX configuration.

In AN5306 I found a configuration under 4.4.1. But within CubeMX I'm not able to configure the OPAMP using only one pin.

I would like to use the VINPx pin, connect the output intern to the ADC and use the feedback loop internally with a gain of 64.

Further, is it possible to use VINPx as input with the output connected internally and externally with a "static" configuration?

Again, not using the VINMx pin.

3 REPLIES 3
Igor Cesko
ST Employee

Hi MWält.2 ,

You are right - this combination is missing in CubeMX (I will report it to include this useful configuration). This OPAMP config is possible to set.

For your today setting: In CubeMX select OPAMP mode "Follower Internally connected" and then in code change the mode from follower to PGA. So - thios must be done manually now. We will try to improve this.

Your second configuration: The OPAMP uses as output external pin and on the same pin is also ADC input. This feature is possible to perform also in CubeMX - select more functions on the same pin - manually (like on PA2: OPAMP1_VOUT and ADC1_IN3).

Regards

Igor

MWält.2
Associate II

Hi Igor Cesko,

Thanks for your reply. I'm gonna try it manually for now and looking forward to the CubeMX integration.

Regards

Matthias

Igor Cesko
ST Employee

Hi MWält.2 ,

There was put request to change / improve this OPAMP modes selection in CubeMX. So - in next CubeMX versions this should be corrected.

Regards

Igor