2016-11-17 09:26 AM
Why if i put a voltage equal to 1V to the ADC input of the microcontroller, i read a value equal to 1.4 V??
It seems that the Voltage_Actual_Value=0.7*ADC_ValueThanks #more-facts #!stm32-!adc #please.2016-11-18 12:26 AM
>Why if i put a voltage equal to 1V to the ADC input of the microcontroller, i read a value equal to 1.4 V??
What makes you think so ?
2016-11-18 12:30 AM
Hello,
Which board are you using?You may refer to your product datasheet or reference manual for more clarification.Regards2016-11-18 12:36 AM
I used different boards: STM32F411RE_NUCLEO, STM32F401RE_NUCLEO and STM32L071 microcontroller.
2016-11-18 01:48 AM
> Which board are you using?
This is less a question of board(s) involved, but rather of missing knowledge at the O.P.'s side about the inner workings of an ADC.2016-11-18 03:31 AM
If you read an ADC value out, you read no voltage but some number between 0 and 4095 (for 12-bit ADC). The weight of the lowest bit depends on the reference voltage Vref used by the ADC. In the most cases that is the VCC - the supply voltage of the CPU. Mostly 3.3V, some Discovery boards have 3.0V. Thus, the actual voltage measured by the ADC is
V = Vref * ADC_Value / 4095 for the Vref = VCC = 3.3V: V = 3.3 * ADC_Value / 4095 The VCC can vary. To solve this, you can use alternatively the internal voltage reference Vint = 1.2V to find the weight of the lowest ADC bit out. Measure the Vint by the ADC, you'll get some number ADC_Int: Weight = Vint / ADC_Int = 1.2 / ADC_Int (volts per bit) then the measured external voltage would be V = Weight * ADC_Value = Vint * ADC_Value / ADC_Int and the VCC used as the Vref: VCC = 4095 * Weight = 4095 * Vint / ADC_Int = 4914 / ADC_Int . Check this on your boards.2016-11-18 03:57 AM
Thanks for the explanation. I'll check it on my board