Skip to main content
Robmar
Senior II
January 30, 2024
Question

HAL fails to switch VRef from internal to external H743

  • January 30, 2024
  • 1 reply
  • 883 views

Changing VRef source would seem simple, but it doesn't work, there is no change in the levels the ADC records.

 

__HAL_RCC_VREF_CLK_ENABLE();

HAL_SYSCFG_DisableVREFBUF(); // Disable the Internal Voltage Reference buffer, uses external 3.3v

HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE);

 

What could stop this code from switching from Internal to external VRef+?

 

This topic has been closed for replies.

1 reply

Robmar
RobmarAuthor
Senior II
February 3, 2024

The VRef source selection code is now working, I have no idea why it didn't work before.  I didn't changed the code, the only change was to update STM32CubeIDE and restart it.

What I have discovered though, is that the internal VRef is being affected by the internal ADC sampling rate of 384 KHz, and a sine-wave of 50mV peak-to-peak at that frequency is appearing on the VRef pin, and getting into the ADC samples and visible in the FFT data.

Switching to the external VRef input removes the interference from the ADC data, it can no longer be detected in the FFT data.

So it seems that the internal VRef is not very clean on the H743 MCU.

All in all, a lot of compromises, and ST doesn't seem to have any expert support available at this depth...or so it seems?

From AN5354 -

"Package impact 3.2
The reference voltage settling time can be degraded by the inductance of the package bonding. The package
adds a parasitic inductance on the VREF pin, increasing the VREF settling time. This limits the maximum
achievable ADC frequency."