cancel
Showing results for 
Search instead for 
Did you mean: 

VREFINT

mmsya
Associate II
Posted on May 16, 2018 at 21:40

In STM32L152 do we have the option to choose the VDDA as VREFINT?

My other question is in regard to the VDDA battery monitoring.  If VREFINT is fixed how can we measure the VDDA please?  Therefore VREFINT_DATA would in the following formula be fix,

VDDA = 3.3V x VREFINT_CAL / VREFINT_DATA.

4 REPLIES 4
Artur IWANICKI
ST Employee
Posted on May 17, 2018 at 07:39

Hello,

I am not sure I have caught  your idea with this choose Vdda as Vrefint. In general Vrefint is not a reference voltage for ADC.

Vrefint is used within STM32L1 in various places as it provides always constant value (~1.22V), while Vdda may vary.

ADC_IN16 is always connected to Vrefint and we cannot change it. Vdda is used instead as a reference voltage for ADC so based on this value ADC is setting max voltage to which it would refer all measured channels. In case Vdda will go down you will see increased value on your ADC channel for the same voltage. This is why we are recommending to use Vrefint measurement to detect changes in ADC reference voltage (Vdda). As Vrefint is constant and Vdda will vary, you will have different VREFINT_DATA value, thus using formula VDDA = 3.3V x VREFINT_CAL / VREFINT_DATA you will have a real value of Vdda in current moment. Having this you can correct your measurements.

There is a dedicated application note describing in details how ADC is implemented within STM32 family. It is

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/3f/4c/a4/82/bd/63/4e/92/CD00211314/files/CD00211314.pdf/jcr:content/translations/en.CD00211314.pdf

.

I hope it helps you.

Best Regards,

Artur

mmsya
Associate II
Posted on May 17, 2018 at 20:04

Dear Artur,

Thank you for your explanation.  Here is my following question please.  I assume that 

ADC_IN17 is always connected to Vrefint

 not the ADC_IN16 .  When I monitor the Vbat do I externally connect the VREF+ to VDDA?

Thanks, ALi.

Posted on May 18, 2018 at 01:38

Yes, either connect VRef+ to Vdda or to an exact reference voltage very close to Vdd.

Artur IWANICKI
ST Employee
Posted on May 21, 2018 at 06:52

Dear Ali,

Just to add, the absolute difference between Vdda and Vref+ should not exceed 0.4V and a maximum difference between Vdd and Vdda should not exceed 300mV at power up and 140mV during normal work (after startup and reset release). 

Best Regards.

Artur