cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong bits, stm32F303re code generation.

MasterT
Lead

CubeMX 5.1.0, stm32F303re, OPAMP4 dropdown box Follower-DAC_OUT1_INP. Code section:

  hopamp4.Init.NonInvertingInput = OPAMP_NONINVERTINGINPUT_IO3;

 is not correct, should be:

  hopamp4.Init.NonInvertingInput = OPAMP_NONINVERTINGINPUT_IO2;

reference to stm32f3xx_hal_opamp.h

#define OPAMP_NONINVERTINGINPUT_IO0         OPAMP_CSR_VPSEL         /*!< VP0 (PA1 for OPAMP1, VP0 PA7  for OPAMP2, VP0 PB0  for OPAMP3, VP0 PB13 for OPAMP4)
                                                                                  connected to OPAMPx non inverting input */
#define OPAMP_NONINVERTINGINPUT_IO1         (0x00000000U)  /*!< VP1 (PA7 for OPAMP1, VP3 PD14 for OPAMP2, VP1 PB13 for OPAMP3, VP1 PD11 for OPAMP4)
                                                                                  connected to OPAMPx non inverting input */
#define OPAMP_NONINVERTINGINPUT_IO2         OPAMP_CSR_VPSEL_1       /*!< VP2 (PA3 for OPAMP1, VP2 PB0  for OPAMP2, VP2 PA1  for OPAMP3, VP3 PA4  for OPAMP4)
                                                                                  connected to OPAMPx non inverting input */
#define OPAMP_NONINVERTINGINPUT_IO3         OPAMP_CSR_VPSEL_0       /*!< VP3 (PA5 for OPAMP1, VP1 PB14 for OPAMP2, VP3 PA5  for OPAMP3, VP2 PB11 for OPAMP4)
                                      

where DAC_CH1 is PA4

0 REPLIES 0