cancel
Showing results for 
Search instead for 
Did you mean: 

How to use DAC dual Channels simultaneously using DMA

LDesa.1
Associate II

Hello,

I am using STM32F765BI MCU.

I want to generate an audio on both the channel of DAC using DMA simultaneously, currently I am facing a problem that I am able to generate audio only on one DAC channel at a time.

So please suggest a method that how can I use both the DAC channel using DMA simultaneously.

Regards,

Lalabhai

3 REPLIES 3

DAC has registers to load both channels in one operation, so direct DMA to one of those registers instead of the data register of the one channel.

Read the Dual DAC channel conversion subchapter in DAC chapter in RM.

JW

PS> Coincidence? https://community.st.com/s/question/0D53W00000HLMJ0SAP/how-to-use-two-dac-channels-simultaneously

LDesa.1
Associate II

Thanks for your quick response.

I gone through the RM and found that I can use DAC_DHR12RD register but I don't know how to direct this data to DMA. In drivers there is an API for DMA as shown below,

"HAL_DAC_Start_DMA (&hdac,DAC_CHANNEL_1,(uint32_t*)Audio.AudioBuffer1,(uint32_t)Audio.TotalSize,DAC_ALIGN_12B_R);

Using this API, I can transmit the data over DAC through channel1 and same for channel -2. But there is no provision for both channels using DMA means I can found such API for both the channels simultaneously. Please give some suggestion.

Waiting for your response.

Regards,

Lalabhai

Maybe there is no provision for dual conversions using DMA in Cube/HAL, I don't know, I don't use Cube.

JW