2020-05-18 07:04 AM
Hi all,
I'm using STM32G431, the opamp1 and opamp2 are set as follows:
the generated codes:
hopamp1.Instance = OPAMP1;
hopamp1.Init.PowerMode = OPAMP_POWERMODE_NORMAL;
hopamp1.Init.Mode = OPAMP_PGA_MODE;
hopamp1.Init.NonInvertingInput = OPAMP_NONINVERTINGINPUT_IO0;
hopamp1.Init.InternalOutput = DISABLE;
hopamp1.Init.TimerControlledMuxmode = OPAMP_TIMERCONTROLLEDMUXMODE_DISABLE;
hopamp1.Init.PgaConnect = OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0_BIAS;
hopamp1.Init.PgaGain = OPAMP_PGA_GAIN_64_OR_MINUS_63;
hopamp1.Init.UserTrimming = OPAMP_TRIMMING_FACTORY;
if (HAL_OPAMP_Init(&hopamp1) != HAL_OK)
{
Error_Handler();
}
the inverting input pin is used as input, a 200pF cap is connected between the input and OPAMP1_VINM pin, PGA is set to 64/63. the OPAMP1_VINP is connected to a reference voltage 1.65V. When I short the input to GND, I see a 200mVpp signal on the OPAMP1_VOUT pin:
The MCU sysclk is 100MHz, and there is nothing running in the main loop. The VDD and VDDa pins are decoupled with 10uF+0.1uF caps.
The input is very clean, where does the noise signal come from?
Please help, thanks!
Jhon
2020-05-18 08:49 PM
After making some tests, I think this is because the PGA resister switch is not stable.
I changed the system clock from 100M to 50M and to 25MHz, the output noise did not change, the frequency is 147KHz, and amplitude is about 200mVpp.
Is it possible to suppress this noise signal?