cancel
Showing results for 
Search instead for 
Did you mean: 

change dac dma from circular to normal using HAL?

ETone
Associate III
 
This discussion is locked. Please start a new topic to ask your question.
4 REPLIES 4
AScha.3
Super User

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.

waclawek.jan
Super User

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

No. &=.

JW

ETone
Associate III

Yes, my bad.