cancel
Showing results for 
Search instead for 
Did you mean: 

Bad voltage on VREF+ pin (VDD instead of VREFBUF)

FRAUBRY
Associate II

I'm using an STM32H743VIT6 (rev V in LQFP100 package), powered at 3.3V and programmed with STM32CubeIDE.

I'm using the ADC2 and ADC3, and also want to use the VREFBUF voltage (available on VREF+ pin) programmed for 2.5V.

 

The *.ioc file is generated with:

VREFBUF Mode -> internal voltage reference

Internal Voltage reference scale -> SCALE 0: around 2.5V

Unfortunately I measure 3.3V on pin 20 (VREF+) instead of 2.5V!

In the generated file stm32h7xx_hal_msp.c,  in the HAL_MspInit(void) function I see:

 /** Enable the VREF clock */

  __HAL_RCC_VREF_CLK_ENABLE();

 

  /** Configure the internal voltage reference buffer voltage scale */

  HAL_SYSCFG_VREFBUF_VoltageScalingConfig(SYSCFG_VREFBUF_VOLTAGE_SCALE0);

 

  /** Enable the Internal Voltage Reference buffer*/

  HAL_SYSCFG_EnableVREFBUF();

 

  /** Configure the internal voltage reference buffer high impedance mode*/

  HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE);

 

In my main() function I've added the reading of the VREFBUF_CSR register to check what's going on:

uint32_t status = VREFBUF->CSR;

 

I get status = 9:

 

Bit 0 ENVR = 1 -> Internal voltage reference mode (reference buffer enable or hold mode) enable.

Bit 1 HIZ = 0 -> VREF+ pin is internally connected to the voltage reference buffer output.

Bit 2 NA

Bit 3 VRR = 1 -> the voltage reference buffer output reached the requested level.

Bit 6:4 VRS[2:0] = 000 -> Voltage reference set to 2.5 V

 

Everything seems OK!

 

If I change VREFBUF Mode to -> Disable, the voltage at pin 20 becomes 0V.

What is wrong?

1 ACCEPTED SOLUTION

Accepted Solutions

Continuing my investigations, I ran the program in Debug mode.

Before the function MX_GPIO_Init() I have 2.5V in VREF+, but 3.3V after!

In the function, it's after the HAL_GPIO_Init(GPIOE, &GPIO_InitStruct) function that the value changes!

On Port E I have 7 outputs used in GPIO_Output mode.

Putting the outputs one after the other into Reset_State mode, I discovered that one of the pins on Port E was causing the problem.

This pin controlled two circuits of type 74LVC2G66. I changed the two circuits and everything is now OK!

I don't quite see what that has to do with it, but the main thing is to have found the solution.
Thanks for all your help.

JJA

View solution in original post

10 REPLIES 10

Missing capacitor (of a quite particular value)?

JW

Thank you for your reply, but I have 1uF // 100nF connected to pin VREF+.

JJA

Is there anything else connected to VREF+ pin?

How are VDDA/VSSA connected?

Can you try this on some "known good" board like Nucleo?

JW

On VREF+ pin I have a voltage divider (10k + 10k) to ground and a voltage follower to have 1.25V

Attached is part of my MCU schematic.

I've been working on my project for several years (!!!) with several iterations of the PCB, and as far as I remember it worked well (perhaps with an STM32H753 instead of the STM32H743 that was nowhere to be found at the time of the COVID-19 shortage).
I have an old NUCLEO-H743ZI2 (144 pins).
I'll see if I can get it working again.

JJA

Try to disconnect the voltage divider.

JW

Voltage divider disconnected, always 3.3V on VREF+ pin!

JJA

On the NUCLEO demonstration board I removed the resistor R36 (0Ω) which connects VREF+ to VDDA.
From STM32CubeIDE I downloaded the COMP_Interrupt example.
As there is no *.ioc file, I added the following lines to the HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp) function
/** Enable the VREF clock*/
__HAL_RCC_VREF_CLK_ENABLE();

/** Configure the internal voltage reference buffer voltage scale */
HAL_SYSCFG_VREFBUF_VoltageScalingConfig(SYSCFG_VREFBUF_VOLTAGE_SCALE0);

/** Enable the Internal Voltage Reference buffer */
HAL_SYSCFG_EnableVREFBUF();

/** Configure the internal voltage reference buffer high impedance mode */
HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE);

Compiled and loaded the program.

I measure 2.5V on pin 32 (VREF+)  :)

Could the problem be with the STM32H743VIT6 MCU, as I have a second PCB with the same problem?

All the other functions (ADC, DAC, USARTx, TIMx, DEGUG, GPIO) work normally!

I'm going to try and replace it with a STM32H753VIT6 (not easy...)

Can you try the same example as on the Nucleo also on your board?

JW

FRAUBRY
Associate II

I don't think this is possible without modifying the initialisation code because I'm using the internal oscillator (HSI RC at 64MHz) and not a 32.768kHz Xtal (X2 on the NUCLEO board)!
Without the use of an *.ioc file I won't get started!

JJA