ADC reading correction per VREF_INT
Using STM32F030 Discovery board.
I read the ADC channels including the internal temperature sensor and vrefint.
#define TEMP30_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FFFF7B8))
#define VREF_INT_ADDR ((uint16_t*) ((uint32_t) 0x1FFFF7BA))The calibration value of the sensor I get from VREF_INT_ADDR is 0x05F4 or 1524. Calculating the value for a 3.30V value on VDDA I get 1.228V, which is consistent with internal reference voltage per data sheet.
When I read the vrefint channel I get a 0x06A2 or 1698. Calculating the VDDA considering 1.228V I get 2.96V, which is consistent with the VDD voltage I am reading on my Discovery board.
So, to correct the ADC readings taking VDDA into account I have to do the following calculation:
adc_val_corr = (*VREF_INT_ADDR * adc_val)/vrefint;Is that correct? Am I missing something?
Thanks in advance.
