2016-06-20 05:39 AM
I'm working on a preliminary feasibility study of a device based on the STM32F303RE platform.
The first step of this study is quite simple:1. record a stereo stream from ADC peripheral2. play the stereo stream using the DAC peripheral using a different sample rateObviously I'll use the DMA both to record and to play the data.The problem is this: if I set the DMA for the ADC, the samples are recorded in an interleaved mode (even: samples from CH1, odd: samples from CH2). On the other hand, the two DACs need to be attached to two different DMA channels.In other words: I cannot use the same array for both the ADC and the DACs, because the ADC creates an interleaved array (i.e., CH1(0), CH2(0), CH1(1), CH2(1). CH1(2), CH2(2), ...), but the DAC accepts only contiguous data (i.e., CH1(0), CH1(1), CH1(2), ...)Is there an efficient way directly ''connect'' via DMA the data acquired by the ADC to the data the DACs will play?The only alternative I know is to use one array for the ADC and two arrays (half sized) for the DAC, manually copying the data from the interleaved input array to the two output arrays. But this approach increases the SRAM requested memory, reduces the performance of the code and, more in general, eliminates all the benefits of using the DMA.Thanks in advance! #adc #stm32 #dac #dma2016-06-20 07:00 AM
> Is there an efficient way directly ''connect'' via DMA the data acquired by the ADC to the data the DACs will play?
No - because (if I remember correctly) Peripheral-to-Peripheral DMA is generally not supported with STM32 MCUs. And as such, it wouldn't make much sense, since such a feed-through would at most change the audio level, and add noise.> The first step of this study is quite simple: ...
This suggests further steps were you want to manipulate the data on the way from the ADC to the DAC. Thus, implementing a proper software interface for the data/buffer handling would not be lost time.
2016-06-20 07:09 AM
Thank you!
So I've got the solution: I'll start writing the middleware.:)Thanks again