AnsweredAssumed Answered

STM32F0 ADC DMA, where are results of measurements

Question asked by esraf on Dec 28, 2012
Latest reply on Jan 2, 2013 by Martin Davey
Board STM32F0 Discovery, measurment on 4 analog inputs:
PC0 - ADC_IN10
PC1 - ADC_IN11
PC2 - ADC_IN12
PC3 - ADC_IN13
and Vbat, Vref, Vtemp.

Configuration of ADC1 and DMA is shown in attachment.


for "ADC_InitStructure.ADC_ScanDirection = ADC_ScanDirection_Upward"
content of table looks like below:
ADC_DATA[0]=2034
ADC_DATA[1]=2273 - PC0
ADC_DATA[2]=2069 - PC1
ADC_DATA[3]=2000 - PC2
ADC_DATA[4]=2225 - PC3
ADC_DATA[5]=1950
ADC_DATA[6]=1695

for: "ADC_InitStructure.ADC_ScanDirection = ADC_ScanDirection_Backward"
content of table looks like below:
ADC_DATA[0]=2135 - PC0
ADC_DATA[1]=2051
ADC_DATA[2]=1702
ADC_DATA[3]=1945
ADC_DATA[4]=2251 - PC3
ADC_DATA[5]=2078 - PC2
ADC_DATA[6]=2071 - PC1


results of measurements are transmitted via uart every 1 second (pure ascii string).
place of result of measurement of PC0, PC1, PC2 and PC3 i'm sure because it is zero when i shorted to gnd

Which index of array contains measurements of channel 16, 17 and 18 (Vbat, Vref and Vtemp)?
Why data are mixed?
In manual, on page 201, bit SCANDIR decides of direction of scanning, from CHSEL0 to CHSEL16 or opposite direction. What about chanels 17(Vref) and 18(Vbat)?
Where i'm doing wrong?

Attachments

Outcomes