2016-02-04 04:50 PM
I am using a STM32F072RB discovery board and trying to calculate the voltage on a pin (PA1). I attached VDDA to the pin and measured the voltage with a voltmeter and it is 2.97 V.
The raw value that is read using a single-shot configuration is 4029.4029 * 3.3 / 4096 = 3.246That is too high. The actual value is 2.97The value read form 0x1FFF F7BA - 0x1FFF F7BB is 0x60ccalibvalue = *(uint32_t *) 0x1FFF F7BA;But I am not sure how to use that and make sense of the value.Appreciate any pointers.2016-02-04 10:33 PM
> 4029 *
3.3
/ 4096 = 3.246 That formula is based upon the assumption that Vref for the ADC is 3.3V. The Discovery boards use to have Schottky diodes in the different supply lines, to decouple them from each other. That reduces VCC (and also Vref) to about 3.0 ... 3.1 Volt. For your calculations, take the actual Vref value of the ADC into account.