2015-07-24 01:27 PM
Hi. Let me describe the situation.
I have to do 8 AD conversions (using STM32F103) as fast as possible. Thus, I'd like to use ADC in DUAL mode to execute 4x2 conversions (on ADC1 as master and ADC2 as slave) and transfer them with DMA. As far as I know I should use dual regular simultaneous ADC mode for this task. And probably also SCAN mode for executing all 4 pairs of conversion one after another. I don't want to use CONTINUOUS mode, because I'd like to start conversions when I want.I have a problem with configuration of a DMA and ADC modules. I was searching a lot on the web, but everything that I found was written with STD Libraries. I am quite new on STM32 MCUs and have some experience only with newer HAL Drivers.Now, my question is, if anyone has such case made with HAL Drivers? Or if anyone has some kind of advice?Things that I'm the most interesting in are how to configure DataWidth for DMA Peripheral and Memory side (halfword, word). Any kind of advice would be very helpful and appreciated. #adc #adc_dual #dma #hal-driver #stm32f12015-07-27 05:40 AM
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-08-10 10:26 PM
Hi Mayla.
Thank you for your response. Now, that works for me. I make 8 AD conversions in DUAL mode (4 x 2 conv.). I get these values in 32-bit array with 4 elements and then separate them to 8 16-bit values. But this takes some time. Now, I have a further question: Is it possible to configure DUAL mode in the way, that I will get already separated values in my destination array? Thus, I should define an array with 8 16-bit elements instead of 4 32-bits. Thanks2016-02-24 07:50 AM
How you do that? Plz put your code here.
I use this procedure but unsuccessful. *** Multi mode ADCs Regular channels configuration *** ====================================================== [..] (+) Select the Multi mode ADC regular channels features (dual or triple mode) and configure the DMA mode using HAL_ADCEx_MultiModeConfigChannel() functions. (+) Start the ADC peripheral using HAL_ADCEx_MultiModeStart_DMA(), at this stage the user specify the length of data to be transferred at each end of conversion (+) Read the ADCs converted values using the HAL_ADCEx_MultiModeGetValue() function.2016-11-25 02:08 PM
Hello,
You would need to use HAL_ADC_Start() on all the slave ADCs prior to using HAL_ADCEx_Start_DMA on the master.