Skip to main content
Peter Mather
Associate III
June 29, 2018
Question

STM32H743 reading internal reference voltage

  • June 29, 2018
  • 3 replies
  • 863 views
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
This topic has been closed for replies.

3 replies

Tobias Wedell
Associate II
June 29, 2018
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
June 29, 2018
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. 

henry.dick
Associate II
June 29, 2018
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.