cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Reading

pranathi1091
Associate II
Posted on December 06, 2012 at 13:55

Hello All,

I using stm32f2xx. I wanted some help in programing ADC. It might be a silly question. But m a newbei

I have to read sensors ouput from ADC123_IN1and ADC123_IN2,ADC12_IN14,ADC12_IN15 of ADC chanells. I have set ADC in scanning mode and I am using DMA.

I have set the ranks for all the above channels accordingly.

My doubt is when the conversion is completed it will be stored in buffer defined for DMA.

So how can i differentiate between the sensor ouput ?

Or how will these values from different ADC channels stored in DMA buffer.Any help would be appreciated.

Thanks

#stm32-adc
2 REPLIES 2
Posted on December 06, 2012 at 17:49

DMA into an array, the samples will be in sequence, use the DMA HT or TC interrupts to track when samples have all completed.

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

Thanks.

You mean to say based upon the ranks i have set it will be stored in DMA array? Or will it be channel wise?

Currently i am doing like this for different channels

ADC_RegularChannelConfig(ADC1,ADC_Channel_1,3,ADC_SampleTime_15Cycles);

 ADC_RegularChannelConfig(ADC1,ADC_Channel_2,2,ADC_SampleTime_15Cycles);

 ADC_RegularChannelConfig(ADC1,ADC_Channel_3,1,ADC_SampleTime_15Cycles);

 ADC_RegularChannelConfig(ADC1,ADC_Channel_14,4,ADC_SampleTime_15Cycles);

 ADC_RegularChannelConfig(ADC1,ADC_Channel_15,5,ADC_SampleTime_15Cycles);