cancel
Showing results for 
Search instead for 
Did you mean: 

ADC DAC problems

Woelki
Visitor

Hi, i encountered the problem on my stm32 G474RE board, that when i use the adc in dma mode i can not use a dac. The dac simply does not work. As long as i dont start the adc in dma mode, my dac is generating the right waveform, but when i start the adc the dac_setValue function is stuck and wont update? Has anybody encountered that problem? Am i doing something wrong?

2 REPLIES 2
TDK
Super User

Your ADC interrupts are triggering so fast it prevents the code from doing anything else. Decrease ADC sample rate, increase DMA buffer size. Increasing the sample rate to max is generally beneficial.

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

But how can i then use the maximum sampling frequency of the adc? The MCU clock is set to 120MHz so it should be way faster than the ADC sampling frequency. Is there just too much overhead, with the HAL libraries? I basically want to compare consecutive adc values in real time to react on them. Measuring a ton of values and buffering them is not suitable for my application.