cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f4 ADC & DMA multi channel - problem with reading the values

j239955
Associate II
Posted on December 23, 2014 at 14:40

The original post was too long to process during our migration. Please click on the attachment to read the original post.
5 REPLIES 5
Posted on December 23, 2014 at 15:11

/* ADC1 Init */
ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;
ADC_InitStructure.ADC_ScanConvMode = ENABLE; // Multiple Channels
ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; // Keep Sampling
ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None; // NONE !Edge!
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_CC1; // Ignored, but valid
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
ADC_InitStructure.ADC_NbrOfConversion = 5;
ADC_Init(ADC1, &ADC_InitStructure);

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
raptorhal2
Lead
Posted on December 23, 2014 at 16:49

This can happen if a channel is connected to one source and other channels are unconnected, or if the signal sources have high impedance. Using a buffer amplifier between each sensor and the ADC channel pin is a good solution if you have the problem with all channels connected.

Cheers, Hal

j239955
Associate II
Posted on December 23, 2014 at 16:59

Thanks for your help.

I changed it but still got the problem that the other channels are entrained. 

My values without any voltage on the pins is okay. (toggles between 0 and 300) i can live with that.

If I put 3 V on pin PA1: Just PA1 shows 4095 --> okay

If I put 3 V on pin PA 2: PA2, PA3, PC1 and PC2 show me 4095

If I put 3V on pin PA3: something like the backgroundcolour of the LCD turns blue, nothing else happens

If I put 3 V on PC1: PC1 and PC2 show 4095

If I put 3 V on PC2: nothing happens

Very strange 🙂

Posted on December 23, 2014 at 18:47

LCD? What board do you actually have an STM32F4-DISCO or the STM32F429I-DISCO?

The latter has VERY FEW available pins, you'll need to go over the pin list in the manual.

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4%20ADC%202channels%20%2b%20DMA&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2120

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
j239955
Associate II
Posted on December 24, 2014 at 05:37

Thanks a lot for your reply.

I thought I did already chose the pin's very carefully but it seems that I have got a wrong verified table with the pin availability of the STM32F429 Disco. I will try my luck with the new pins and reply again when I got some news.

Merry X-mas !!!!!