2016-03-29 05:36 AM
Dear Friends,
I have a good experience in STM32F103, but trapped in STM32F407's ADC two weeks already. My HW plateform is STM32F407VGT.Vref+ connect to 2.048V; Vdda connect to 3.1VADC resolution configured to be 12bitsQuestions :1. I can read and transfer ADC value to AdcValue, how to calculate to transfer ADCvalue to proper voltage? Is the formula : 1-1. AdcValue x 3.1 / 4095... or 1-2. AdcValue x (3.1 - 2.048) / 4095 ...or 1-3. AdcValue x (2.048 -1.8) / 4095 .....or 1-4. There is another proper formula..Because I cannot find the proper reference in two weeks searching, while reading ADC-CH17, Vref (2.048V) internal channel, AdcValue is around 400. #!stm32 #adc #stm32f4 #dac #filter2016-03-29 07:32 AM
The +VREF external is the full-range value for the ADC, rather than 3.1V, not sure VDDA/VREF can be that different.
The VREFINT is NOT the same thing, it is an internal reference voltage. Nominally 1.21 V, from the Data Manual/Sheet2016-03-29 07:43 AM
Assuming VSSA is at 0V and VREF is 2.048 then you should use
Vin=ADCReading / 4096 * VRef So an ADCReading of 1234 would correspond to Vin of 0.617 Volts. If it's more complicated than that I've misunderstood your question. For a helpful diagram and more information about errors and their causes see the Data Sheet section 5.3.21.2016-03-29 07:44 AM
An ADC always uses a reference voltage to make it's conversion. (One might connect Vdda to Vref, making Vdda to Vref).
One bit of a <n>-bit ADC always represents Vref / 2^n. For the 12-bit ADC of the STM32, that would be Vref / 4096. In mathematical terms, the formula would be: Vmeasure = Measure_count * Vref / Max_count Max_count is 2^12 in your case, i.e. 4095. Be aware of possible pitfalls involving integer conversion/promotion in C language.2016-03-29 07:47 AM
http://www.st.com/web/en/resource/technical/document/datasheet/DM00037051.pdf
Data Sheet from the product page for your part.Search ''Embedded reference voltage'' or ''VREFINT''2016-03-29 08:20 AM