Associate
May 14, 2019
Question
How to generate a white noise with the DAC on STM32L1
- May 14, 2019
- 1 reply
- 2661 views
Hi everyone,
I am currently trying to generate a white noise using my Nucleo STM32L152RE but I do not reach to achieve it.
I used CubeMX to create the init functions.
You can see attached the settings for the DAC ( using the OUT1 configuration) in cubeMX.
I initialized the TIM6 as a timebase, enabled the interrupt, started it with HAL_TIM_Base_Start_IT(&htim6) and in the callback ( it goes in) I call HAL_DAC_Start(&hdac,DAC_CHANNEL_1) to start the DAC, but it does not ouput any noise on A2 it only outputs a DC value such as if I used it to generate a constant voltage.
May be I am totally wrong with the use of the DAC but it seemed correct to me.
If someone could help me, I would be very thankful.
Mathias
