cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 ADC vrefbuf and vrefint

abhijith_raj
Associate III

Hi,

I’m using the STM32G491RET6 MCU and currently working on the ADC.

I have three analog inputs:

  • Two connected to ADC1

  • One connected to ADC2

At the moment, the ADCs are configured to use an external VREF+.

I would like to switch to the internal reference instead:

  • How do I configure the ADC to use the internal reference?

  • How do I enable and configure VREFBUF?

  • Does changing the VREFBUF voltage scaling affect the VREFINT value used by the ADC?

  • If I use the internal reference, can the external VREF+ pin be left unconnected or removed?

Any guidance or example configuration would be appreciated.

1 REPLY 1
mƎALLEm
ST Employee

Hello,

Answer with the help of STM32 Sidekick: 

mALLEm_0-1768984319888.png

  • How do I configure the ADC to use the internal reference?

1- Ensuring the connection between VREF (VREF+) and VDDA is removed on your schematic to avoid a short when using the internal reference. In STM32CubeMX, locate the VREFBUF configuration under the ‘analog’ category and enable it. Select the ‘internal voltage reference’ option and choose the desired voltage scale (e.g., 2.048V, 2.5V, or 2.9V).
Save, generate code, and program your device. Verify the VREF+ pin voltage with a multimeter to confirm the internal reference is active.

  • How do I enable and configure VREFBUF?

2. Alreay answerd in 1.

  • Does changing the VREFBUF voltage scaling affect the VREFINT value used by the ADC?

3. Changing the VREFBUF voltage scaling does not affect the VREFINT value used by the ADC. VREFINT is a separate, factory-calibrated bandgap reference voltage, independent of the VREFBUF output. VREFINT is always available to the ADC and is not influenced by the VREFBUF settings. But you need to take care about the voltage scale you've selected for the VREFBUF (e.g., 2.048V, 2.5V, or 2.9V) when you do the ADC input voltage computation.

  • If I use the internal reference, can the external VREF+ pin be left unconnected or removed?

4. Even when using the internal VREFBUF, you must connect decoupling capacitors externally to the VREF+ pin for a proper operation and noise performance depend on these external components. Indeed you need to disconnect VREVBUFF from your external reference voltage you have used previously.

Read How to configure VREFBUF on my STM32

Continuation of the post: question about VREFBUF config in CubeMx in this post.

Continuation of the post: Are VREFINT and VREFBUF output the same on STM32G4?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.