cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 internal DAC dual channels with DMA for audio sample playback

Manu Abraham
Senior

Hi,

Greetings!

Wondering whether the following logic works:

Configure TIM7 for a sampling rate of 48khz. TIM7 triggers DMA to fetch audio samples at this rate, dumps it into the DAC buffer.

Is this the right path ?

If so, how to go about with the dual channels of the DAC. I am bit confused on how that part needs to be handled.

Any thoughts ?

Thanks,

Manu

1 ACCEPTED SOLUTION

Accepted Solutions

You simply use the dual registers as target in DMA.

0693W000005BOq3QAG.pngJW

View solution in original post

4 REPLIES 4
Piranha
Chief II

For a two mono audio streams you'll probably have to use two DMA streams. For a one stereo audio stream... Most likely the internal 12-bit DACs are not enough anyway and you have to use external DAC preferably connected through I2S connection on SAI peripheral.

An external DAC is for a later day, audio quality is not a big issue for this test scenario, but the need to use a stereo stream with the internal DAC (I am pretty aware that, it wouldn't be the best audio quality. Likely FM quality alone).

That said, confusion still exists on the single channel DMA usage for a stereo audio stream (DAC with 2 outputs).

You simply use the dual registers as target in DMA.

0693W000005BOq3QAG.pngJW

That was the missing part of the puzzle. Somehow managed to miss that register!

Thanks,

Manu