cancel
Showing results for 
Search instead for 
Did you mean: 

slow down DMA speed for DAC

Wleon.1
Associate II

Hi, is there a way to slow down the DMA speed for DAC? I am using stm32F72x, and I am trying to generate a customize PWM wave from using DMA+DAC.

7 REPLIES 7
S.Ma
Principal

start by generating a pwm from a timer pin and connect it to the DAC trigger pin. once happy, use internal signals...

DMA2 is controlled by APB2 is there a way to change the time source ?

>DMA2 is controlled by APB2

No, it is not. Normally, DMA transfers from memory into DAC are triggered by DAC itself.

In turn, you should trigger DAC (transfer from DAC holding to output register) from a timer, as . said above. Read the DAC (and DMA and TIM) chapter in Reference Manual (RM).

JW

I mean If I only want to trigger once and let the DMA run in a circular mode the DMA speed of each element is controlled by APB right ?

RMcCa
Senior II

You need a constant sample rate. I would use memory to peripheral dma triggered by a timer. ​the dmas have independent source and destination addresses so that a dma triggered by a timer can do a memory to dac output register transfer.

> I would use memory to peripheral dma triggered by a timer

There's no point to do that. The timer triggered DAC is there for a reason. DMAing into non-triggered DAC (DAC_CR.TENx=0) results in DAC output being subject to DMA jitter, unnecessarily.

JW

> I mean If I only want to trigger once and let the DMA run in a circular mode the DMA speed of each element is controlled by APB right ?

Trigger what?

If you'd use non-triggered DAC (DAC_CR.TENx=0) and use the DAC-requested DMA stream/channel, then the APBx clock would have some impact on the transfer speed, but there are more influences involved - transfers of other streams of the same DMA, transfers and their latencies on the memory side of the DMA, conflicts between DMA and processor within the given APB. You'd have a high and irregular transfer rate. OTOH, DAC's analog side wouldn't be able to cope with that speed anyway.

Why don't you want to do things as they are supposed to be done? I've outlined the procedure above.

JW