2012-12-06 04:55 AM
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-adc2012-12-06 08:49 AM
DMA into an array, the samples will be in sequence, use the DMA HT or TC interrupts to track when samples have all completed.
2012-12-06 08:41 PM
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);