cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G431 OPAMP not work?

Jhon
Associate II

Hi all,

I'm using STM32G431KBU6, I've enabled the 2 opamps in cubemx, the settings for the opamps are:

mode -- standalone

power mode -- high speed

user trimming -- disable

0693W000000VgyAQAS.png 

I have 2 resistors and 2 caps to set the gain, low-pass cutoff freq and high-pass cutoff freq:

The non-inverting input is VREF=3.3/2=1.65V, the inverting input is OP1N, and the output is OP1O.

0693W000000VgyKQAS.pngIn the main.c, MX_OPAMP1_Init and MX_OPAMP2_Init are called in function main(), and I wrote these two lines to start the opamps:

HAL_OPAMP_Start(&hopamp1);

HAL_OPAMP_Start(&hopamp2);

But when the program is started, I find the opamps are not working, the input signal is not amplified. The signals in OP1P and OP1N are the same, and are shifted lower than the input signal ADI, the DC of ADI is about 1.65V, and the DC of OP1P and OP1N is about 0.8V.

What did I miss? Please help, thanks in advance.

1 REPLY 1

Read out and check/post the relevant OPAMP and GPIO registers.

JW