2018-06-29 5:28 AM
I want to read the internal reference voltage to calibrate the ADC on a Nucleo H743ZI. I can read the clock backup battery voltage and the temperature perfectly (ADC3) and I get a value when reading the reference (also ADC3) so I think the code is correct but I always get a value of about 1.22 volts (scaling by 3.3). I've tried all combinations of setting up the reference voltage.
HAL_SYSCFG_DisableVREFBUF();
HAL_SYSCFG_EnableVREFBUF();
HAL_SYSCFG_VREFBUF_HighImpedanceConfig(); HAL_SYSCFG_VREFBUF_VoltageScalingConfig();I assume the buffer shouldn't be enabled as that would be driving the reference voltage against the input to VREF+ which is wired to 3.3V on the Nucleo.
Any ideas appreciated.
#stm32h72018-06-29 5:55 AM
Can't see your problem. Vrefint is about 1.2V (datasheet page 103). Everything is fine.
2018-06-29 6:12 AM
Thanks. I'd assumed
HAL_SYSCFG_VREFBUF_VoltageScalingConfig(); would set the internal reference voltage to the ADC but apparently not.
2018-06-29 8:57 AM
'
assumed'
^^^^^^^^^ ---> source of all evil,
seriously, in situations like this, you should also ask yourself: what should I expect? and compare it to what you get.