Loading...
 
Skip to main content

System Workbench for STM32


How To Use DAC on STM32F4 Discovery?

pininit() is my own function to initialize a GPIO pin.

I was already using the clock config and DAC init functions generated by the CubeMX.

The problem was in the HAL driver for DAC. It doesn't initialize the DAC clock. When I call the macro "_HAL_RCC_DAC_CLK_ENABLE()" in the DAC initialization function, the DAC starts working just fine.