Skip to main content
TBibe.1
Associate
Jan 8, 2022 8:48 PM UTC
Solved

STM32F051 DAC not working

I'm working with a STM32F051 Discovery board. I've created a project that should allow me to adjust the output voltage to the DAC pin PA4, but the expected step voltage output to that pin remains at ground voltage level.

I'm sure that I'm missing something simple but not sure. All configuration was created using the most recent STM32CubeMX 6.4.0 and I'm running my code with the STM32IDE 1.8.

Attached is the main.c method as well as the .ioc project created by CubeMX,

Can someone explain why my DAC output does not provide any signal?

Thanks.

This topic has been closed for replies.
TDK
TDKBest answer
Jan 8, 2022 9:27 PM UTC

You need to enable the DAC. Use HAL_DAC_Start, or duplicate what the code in there does.

Example:

https://github.com/STMicroelectronics/STM32CubeF0/blob/4390ff6bfb693104cf97192f98c3dc9e3a7c296a/Projects/STM32F072RB-Nucleo/Examples/DAC/DAC_SimpleConversion/Src/main.c#L94

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer
Jan 8, 2022 9:27 PM UTC
"If you feel a post has answered your question, please click ""Accept as Solution""."
TBibe.1
TBibe.1Author
Associate
Jan 13, 2022 4:38 PM UTC

Thanks! this fixed my issue.