cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 interleaved ADCs and single DMA confusion

linuxfan
Associate II

Hi all,

I am trying to implement ADC acquisition on one channel, with 14 bit, 4x oversample, at 1 Msmps (1 megasample per second). This is possible only using dual interleaved mode. Moreover, I want to acquire continuosly with circular DMA.

But it is not clear to me how to set the right values in CubeMX, and I can't use the datasheet (which I have read) to understand, it seems CubeMX and datasheet use different names for the same thing.

Let start from my ADC1 settings:

Clipboard01.gif

Are the settings right until now? What I don't understand is the role of "DMA Access Mode" and "Conversion data management mode": I can disable DMA Access Mode and still have Conversion Data Management Mode = DMA Circular Mode; so what?

Or, viceversa, I can have DMA Access Mode enabled, but Conversion Data Management Mode set to "Data stored to DR register only"; is DMA used in this case or what?

Now go on to ADC2 settings. Correctly, once ADC1 is set to "Dual interleaved mode only", some values become read-only. But other can be modified, and I again don't understand. These are the settings for ADC2:

Clipboard02.gif

It can be seen in the image above that Conversion Data Management Mode can not be set to DMA One Shot Mode (ok), nor DMA Circular Mode (?). So what should I choose to have both ADC1 and ADC2 (interleaved) results in the same DMA stream? Moreover, what format will be used? 32 bit (16 + 16) for every DMA request, or 16 bit - and twice the requests?

I configured just one DMA channel under ADC1, but I can not decide about the transfer width. I suppose that, if Word and HalfWord are both viable, Word (32 bit) should be more efficient. But again, it is possible to choose incompatible values between DMA settings and ADC (2 of them!).

Can someone give some help? TY

 

2 REPLIES 2
MasterT
Senior III

H7 has some limitation regarding DMA access to memory. Search this pattern, I remember 've seen a few threads on this forum.

STM32CubeMX has an example "ADC_DMA_Transfer", study.

../STM32Cube/Repository/STM32Cube_FW_H7_V1.11.2/Projects/STM32H743I-EVAL/Examples/ADC

 

Thank you @MasterT , but I already succeded with a single ADC plus DMA. Works perfectly.

My problem is that, when using Dual Interleaved, things change a lot (just to say, the setting "DMA Access Mode" in CubeMX becomes visible, while it is invisible when ADC Mode is "Independent mode").

And I want to understand the CubeMX, this is why I posted in this very forum (CubeMX) and not elsewhere.