2014-04-11 05:46 AM
Hello Together,
I have a problem with my ADC. I tried to search through the Forum but I couldn't find a similar problem.My plan is to read 6 different Analog Digital Channel on STM32F407 therefore I use ADC1, ADC2 and ADC3. On each of the ADC there are two input Channels. Now I tried to read out the Data in 1Mhz frequency. Therefore I configured my ADCs and my DMA2. The code of my initiation see below.Now to the description of my Problem, I read out the 6 Channels, but only the first 3 Channels, 1 Channel of each ADC is updated in the Array “ADCConvertedValue[6]�? the other 3 Channels would not be read.
I am looking forward to read your answers and wish you a nice Weekend
Best Regards
Benjamin
2014-04-11 06:39 AM
I don't think you have the DMA set up correctly wrt the common ADC data register. I don't believe it packs the 8-bit pairs as a half word.
There is a triple mode example at the .2014-04-14 01:03 AM
Hi Clive1,
thank you for your request and the nice example. I changed the DMA Setup now but I don't understand, why the ADC is not using my second channel. Do you have some idea regarding to this?I changed the DMA setup like your exampe to this: DMA_InitStructure.DMA_Channel = DMA_Channel_0; DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)ADC_CDR_ADDRESS; DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADCConvertedValue[0]; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; DMA_InitStructure.DMA_BufferSize = (ADCSENSORn*MEASUREDDATA); DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull; DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; DMA_Init(DMA2_Stream0, &DMA_InitStructure);Thank you very much.Benjamin2014-04-14 06:19 PM
but I don't understand, why the ADC is not using my second channel. Do you have some idea regarding to this?
Well it's got to SCAN the channels, and you have that disabled. ScanConvMode is disabled for a single channel, for multiple channels it would need to be enabled.2014-04-14 06:21 PM
2014-04-15 01:39 AM
Hi clive1,
thank you very much for your support! Now it is working fine :)cheersBenjamin