2021-08-16 12:37 PM
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.
2021-08-19 08:23 AM
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
2021-08-30 07:23 AM
Hi Igor Cesko,
Thanks for your reply. I'm gonna try it manually for now and looking forward to the CubeMX integration.
Regards
Matthias
2021-09-02 06:50 AM
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