Electrical – Does anyone have an STM32F example for opamp PGA mode (ideally STM32F3 Discovery)

operational-amplifierstm32

Ive used STM32cubemx to set input pin and output pin of OPAMP1.

Then open project in Keil and I can see the OPAMP functions are loaded and compile OK.

But when I load code into MCU (STM32F303 on Discovery Board) and feed small signal into the input pin (30mVAC sine on top of 100mVDC) the "output pin" on the MCU is floating, ie not operating like an opamp.

Do I have to enable something else? Thanks!

Best Answer

Got it. Needed to turn on op amp in HAL with HAL_OPAMP_Start(&hopamp4);