cancel
Showing results for 
Search instead for 
Did you mean: 

How to recover from DAC - DMAUDR ?

Mr_M_from_G
Senior

Hello,

I use DAC with DMA on STM32F439 (Nucleo board). Now it happens that I create a DAC trigger although all DMA data is sent, ie NDTR has already reached zero. Therefore DMAUDR gets set. When I want to start a new DAC - DMA run I get an unwanted DMA transfer that is not triggered by DAC DMA request. I tried a lot but the only ways I found to fix this is to reset DAC by using RCC_APB1RSTR_DACRST. This has the side effect of an ugly glitch on DAC output, because I use 2048 as the base level.

Is there any other way to recover from this situation?

Thanks for any help.

Martin

(sorry, I accidentally posted this also in STM32 MCU group)

2 REPLIES 2

It should be enough to disable/reenable the DAC, i.e. toggle the DAC_CR.ENx bit.

JW

[EDIT] On second thought, it's not a good idea as that disables the DMA output, too; however, clearing and setting DAC_CR.DMAENx should also have the effect of clearing "spurious/outstanding" DMA request, without disabling DMA output.

Mr_M_from_G
Senior

Hello Jan,

thank you for your answer.

I have not tried it but I guess, as you write in your edit, this will also cause a glitch on DAC output (??)

Meanwhile I found another solution and that is to control end of DMA by the peripheral so I can set NDTR to 0xFFFF which is always sufficient.

Martin