2010-05-16 11:28 PM
ADC/DMA array setup and read
2011-05-17 04:51 AM
2011-05-17 04:51 AM
How do you read the ADC from DMA, I tried using usart but it can only display value in int format? I need a double or float format for accuracy of decimal points.
2011-05-17 04:51 AM
I read in the firmware library manual that it can only read from 0 to 3.6V adc values. For this, can I use u16 ADC_RegularConvertedValueTab[5]; and read the values with floating point accuracy? or it can only display 0,1,2 and 3 since u16 is unsigned integer. Any idea on how to implement using usart to display in hyperterminal. I will use this for checking if the ADC values are correct.
2011-05-17 04:51 AM
You will have to scale the number, the 12-bit number represents 4096 states between 0 and Vref
double Vadc, Vref = 3.3; u16 Sample; Vadc = (double)Sample * (Vref / 4096.0);2011-05-17 04:51 AM
How do you set the ADC channels,
GPIOC pin 4,ADCvalue[0]
GPIOC pin 5, ADCvalue[1]
GPIOA pin 3,ADCvalue[2],
ADC_RegularChannelConfig(ADC1, ADC_Channel_14, 1, ADC_SampleTime_28Cycles5);
ADC_RegularChannelConfig(ADC1, ADC_Channel_15, 2, ADC_SampleTime_28Cycles5);
ADC_RegularChannelConfig(ADC1, ADC_Channel_3, 3, ADC_SampleTime_28Cycles5);
It works for GPIOC pins, 4 and 5. ADC channel 14 and 15, how do you setup the ADC channel for GPIOA input, how will you know what ADC channel is for the corresponding GPIOA input.
Does GPIOC pins correspond to channel=(pin number +10). For example GPIOC pin 4 is ADC channel 14 because 4+10=14. For A is it just channel=pin number, example GPIOA pin 3 is ADC channel 3. I'm confused because it doesn't work.
2011-05-17 04:51 AM
Look in the reference manual for your device. In the 105 manual it is Chapter 3 Pin Descriptions, Table 5 Pin Definitions.
Cheers, Hal2011-05-17 04:51 AM
Thanks. I've read it and the pins corresponding to the ADC channels are written there. I'm just confused why some ADC channel config doesn't work like channels 2,3,8,9.