cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L072 Adc Vref source

sukoy27k
Associate II
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

2 REPLIES 2
Tilen MAJERLE
ST Employee
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.

Posted on June 16, 2018 at 23:43

Thanks for help.

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