Unfortunately, F411 do not have DACs. https://www.st.com/en/microcontrollers-microprocessors/stm32f411ce.html Hence, for this chip PWM is about the only way to do some DAC. stm32g431, stm32f407, stm32f405 etc has DAC, check the specs https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.h...