cancel
Showing results for 
Search instead for 
Did you mean: 

Using STM32F4's DAC with DMA

diverger
Associate III
Posted on September 03, 2016 at 09:02

I use DAC with DMA to ouput a sine wave. The DAC is triggered from exti9. It can output a perfect sine wave now. But I want to sync the wave's zero-crossing with a pin's rising edge. So, I put the start signal in the rising edge interrupt handler. And make  my sine table starting from 0. But when I probing the DAC output and the rising edge signal, I found sometimes the DAC output is apparently delayed to the rising edge, sometime the delay is about 10ms!!!! So, is it normal to use DMA with DAC?

#dma-dac
1 REPLY 1
mark239955_stm1
Associate II
Posted on September 03, 2016 at 09:09

I've used the F4's DAC as a DMA-driven digital synthesizer before (for sine waves, amongst other things).  I certainly didn't see any mysterious 10ms delays.

EXTI9 shares an interrupt vector with EXTI8..EXTI5, and is by no means the highest priority interrupt.  Is it possible that other interrupts are interfering with your DAC/DMA startup, either due to higher priorities or polling in the shared EXTI9_5 vector?