Skip to main content
ETone
Associate III
March 4, 2023
Question

change dac dma from circular to normal using HAL?

  • March 4, 2023
  • 4 replies
  • 1078 views

..

This topic has been closed for replies.

4 replies

AScha.3
Super User
March 5, 2023

no. why ?

If you feel a post has answered your question, please click on " Best Answer ".
ETone
EToneAuthor
Associate III
March 5, 2023

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
March 5, 2023

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

No. &=.

JW

ETone
EToneAuthor
Associate III
March 6, 2023

Yes, my bad.