cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 reading internal reference voltage

Peter Mather
Associate III
Posted on June 29, 2018 at 14:28

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.

#stm32h7
3 REPLIES 3
Tobias Wedell
Associate II
Posted on June 29, 2018 at 14:55

Can't see your problem. Vrefint is about 1.2V (datasheet page 103). Everything is fine.

Peter Mather
Associate III
Posted on June 29, 2018 at 15:12

Thanks. I'd assumed 

HAL_SYSCFG_VREFBUF_VoltageScalingConfig(); would set the internal reference voltage to the ADC but apparently not. 

Posted on June 29, 2018 at 15:57

'

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.