cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F051 DAC not working

TBibe.1
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

2 REPLIES 2
TDK
Guru

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".
TBibe.1
Associate

Thanks! this fixed my issue.