Skip to main content
sukoy27k
Associate II
June 16, 2018
Question

STM32L072 Adc Vref source

  • June 16, 2018
  • 2 replies
  • 1388 views
Posted on June 16, 2018 at 20:16

Hi,

I'm a little bit confused about adc and vref.

From reference manual

The internal voltage reference (VREFINT) provides a stable (bandgap) voltage output for the

ADC and Comparators. VREFINT is internally connected to the ADC_IN17 input channel. The

precise voltage of VREFINT is individually measured for each part by ST during production

test and stored in the system memory area. It is accessible in read-only mode.

What exactly it means?

  1. I can use VREFINT as source for adc and ignore vref+? if so how I can select it from the code? I can't find anything to say 'adc select VREFINT as your source'
  2. VREFINT is only an adc channel to sample VDD and Temp? if so I have to supply a stable vref+ to increase adc accuracy?
  3. If VFREINT is only for internal purpose, I can use it to sample my unstable vref+ and correct the value I read from other ADC channel? if so there is a formula already cooked?

Thanks for your help

    This topic has been closed for replies.

    2 replies

    Tilen MAJERLE
    ST Employee
    June 16, 2018
    Posted on June 16, 2018 at 22:22

    Hello

    zazo.gennaro

    ‌,

    1. Vref+ is always used as ADC reference voltage. When Vref+ pin is not available in your favorite package, it is internally connected to VDDA.
    2. VREFINT is internally connected to one of ADC channels, which means you can measure this voltage with ADC. Since you have in your datasheet VREFINT calibration value, (at VDDA = 3V), you can use it to calculate your actual VREF+ voltage, connected externally.
    3. You can. To calculate your external VREF+ voltage when measuring internal VREFINT voltage, you may use following equation: VREF+ = VREFINT_CAL * VREFINT_CAL_VDD /12_BIT_ADC_VALUE, where:

      1. VREFINT_CAL is a value, stored in the memory. Refer to

        http://www.st.com/content/ccc/resource/technical/document/datasheet/98/e1/71/c0/ae/f5/4b/d4/DM00141pdf/files/DM00141pdf/jcr:content/translations/en.DM00141pdf

        , section 2.1
      2. VREFINT_CAL_VDD is voltage at which VREFINT_CAL was measured. Datasheet says it is 3.0V
      3. 12_BIT_ADC_VALUE is actual ADC value you get when you measure VREFINT channel.

    Some MCU families (STM32L4 for example) provide VREFBUF output where you can output stable bandgap voltage to ADC reference via buffer and VREF+ pin.

    sukoy27k
    sukoy27kAuthor
    Associate II
    June 16, 2018
    Posted on June 16, 2018 at 23:43

    Thanks for help.

    On Sat, 16 Jun 2018, 22:22 Tilen MAJERLE, <st-microelectronics@jiveon.com>