2015-04-01 01:11 PM
Hi, I am using the STM32F303VCT6 chip on the STM32F3Discovery Kit. I want to use 37 of the 39 available ADC inputs for a data logger project.
I have successfully got ADC1 working with DMA1_Channel1 and ADC2 working withDMA2_Channel1
. Each dumps 10 or so values into RAM using DMA. But I can't get either to work with their respective DMA channels 2,3 or 4. I want to effectively use all 4 ADCs simultaneously so I start each off on a single sequenced conversion and dump the 8-12 ADC values per ADC into RAM using DMA. I then wait until the next data dump period, which is 100-1000ms, log the previously converted ADC values, and start off the next conversion for each ADC. Does anyone know why I can't effectively use DMA channels greater than 1 with the ADCs? I have attached the source code for my ADC initialization. The GPIO pins have already been configured as Analog in pins before the ADCxInit() functions are called. Thanks. #dma #stm32-adc #adc2015-04-01 01:29 PM
I'm not sure I have the time/patience to go through that, but my recollection (I don't use STM32F3 for anything here), is that the ADC units pair and then use 2 DMA unit to support 4x ADC. The Reference Manual no doubt details which DMA's would be workable.About 50% down the first page of this thread* is a Quad ADC F3 example, you'd need to expand the channels used, buffer sizes, etc keeping them all symmetrical. But should be serviceable.
*
Edit: Fixed broken link, original from 1-Apr-2015
2015-04-02 07:36 AM
Clive, I appreciate your input , especially knowing that STM32F3 is not your area of expertise. What I am confused about is that the
STM32F3
reference manual says that ADC Dual ModeCAN
be used, notDual Mode
MUST
be used (if you want to use ADC1/2 or 3/4 together). That implies to me that Dual Modecan optionally
be used, but is not mandatory. Surely all four ADCs can be operated independently of each other? The other strange thing I was reporting was thatthe ADCs 1/2 work independently using DMA1_Channel1and DMA2_Channel1 but not Channel2 for either DMA 1/2controller. Anyway, I shall investigate the other thread you referred me to and try to use Dual Mode. Thanks.I'm not sure I have the time/patience to go through that, but my recollection (I don't use STM32F3 for anything here), is that the ADC units pair and then use 2 DMA unit to support 4x ADC. The Reference Manual no doubt details which DMA's would be workable.
About 50% down the first page ofis a Quad ADC F3 example, you'd need to expand the channels used, buffer sizes, etc keeping them all symmetrical. But should be serviceable.
Hi, I am using the STM32F303VCT6 chip on the STM32F3Discovery Kit. I want to use 37 of the 39 available ADC inputs for a data logger project.
I have successfully got ADC1 working with DMA1_Channel1 and ADC2 working with DMA2_Channel1. Each dumps 10 or so values into RAM using DMA. But I can't get either to work with their respective DMA channels 2,3 or 4. I want to effectively use all 4 ADCs simultaneously so I start each off on a single sequenced conversion and dump the 8-12 ADC values per ADC into RAM using DMA. I then wait until the next data dump period, which is 100-1000ms,log the previously converted ADC values,and start off the next conversion for each ADC. Does anyone know why I can't effectively use DMA channels greater than 1 with the ADCs? I have attached the source code for my ADC initialization. The GPIO pins have already been configured as Analog in pins before the ADCxInit() functions are called. Thanks.2015-04-04 07:10 AM
Check the DMA channels assignments at the end of the DMA Functional Description in the reference manual.
DMA1 Ch3 has no peripheral assignments. DMA1 Ch 4 is either ADC 2 or no assignments depending on processor version. I believe yo need to use DMA 2 for ADC3 & 4. Cheers, Hal2015-04-04 09:27 AM
Thanks, Hal. I hadn't realized until now that each peripheral must use specific DMA channels. I thought that each DMA channel was completely generic in its application.
I now have ADC1/2 working together in dual mode using DMA1_Channel1 and ADC3/4working together in dual mode using DMA2_Channel5.
Thanks for your help.2015-10-26 01:37 AM
Hi David
i have problem in ADC4 configuration, about ADCx in STMF303RB, can i configure each ADCx (For exp ADC4) inINDEPENDENT
mode ??best regards.