cancel
Showing results for 
Search instead for 
Did you mean: 

change dac dma from circular to normal using HAL?

ETone
Associate III
 
4 REPLIES 4
AScha.3
Chief II

no. why ?

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

Because in some sections of my application I want the dac to output continuous waveforms from a lookup table and in other sections I want it to output a single pass of a lookup table in response to an event. What I now have found to work is:

((DMA_Stream_TypeDef  *)hdma_dacX_chx.Instance)->CR |= 0x100;

For continuous output, bit 8 set selects continuous and

((DMA_Stream_TypeDef  *)hdma_dacX_chx.Instance)->CR |= ~0x100;

For one shot output, bit 8 reset selects normal, X is the dac and x is the channel.

The reference manual indicates the bit 8 information but getting to it using HAL definitions required some investigation.

>((DMA_Stream_TypeDef  *)hdma_dacX_chx.Instance)->CR |= ~0x100;

No. &=.

JW

ETone
Associate III

Yes, my bad.