internal DAC (DAC3) connection to OPAMP1 - no output from OPAMP
Hey,
I'm using: STM32G431, NUCLEO-G431RB
I would like to connect DAC3 - internally to the OPAMP and take the OPAMP1 output. I have an array I want to transfer to the dac3 via DMA, the timing is controlled by tim2.
Then having DAC3 to be the non-inverting input for the OpAmp.
When trying to take the output externally from the Opamp output - no signal.
By the way, the code works fine for DAC1 and DMA, but I want to use DAC3 for the fast sampling rate.
Can you help?
Thanks!
int main(void)
{
...
HAL_DAC_Start_DMA(&hdac3, DAC_CHANNEL_1, (uint32_t*)arr_to_play, NS, DAC_ALIGN_12B_R);
HAL_OPAMP_Start(&hopamp1);
HAL_TIM_Base_Start(&htim2);
....
}
static void MX_OPAMP1_Init(void)
{
hopamp1.Instance = OPAMP1;
hopamp1.Init.PowerMode = OPAMP_POWERMODE_HIGHSPEED;
hopamp1.Init.Mode = OPAMP_FOLLOWER_MODE;
hopamp1.Init.NonInvertingInput = OPAMP_NONINVERTINGINPUT_DAC;
hopamp1.Init.InternalOutput = DISABLE;
hopamp1.Init.TimerControlledMuxmode = OPAMP_TIMERCONTROLLEDMUXMODE_DISABLE;
hopamp1.Init.UserTrimming = OPAMP_TRIMMING_FACTORY;
if (HAL_OPAMP_Init(&hopamp1) != HAL_OK)
{
Error_Handler();
}