cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 64 pin package. Vref questions

DiBosco
Senior II
Posted on March 02, 2016 at 18:12

Folks,

The 64 pin package of the STM32F103 has no Vref pins. I can't see any way, though, of switching between external and internal ref for *any* of the parts.

I'm assuming that where there is no Vref pin, you can only use the internal Vref?

The internal Vref seems to be only 1.2V and you can't seem to feed this to the outside world. So, do you need another external 1.2V reference to feed to potentiometers?

You don't seem to be able to even use Vcc as Vref. Am I missing something or is the 64pin package not really very good if you want to use the ADC?

Thanks :)

4 REPLIES 4
Posted on March 02, 2016 at 18:27

VREF+ is bonded to VDDA, VREF- is bonded to VSSA

It is not a 1.2V reference point, but rather the full scale for the ADC and DAC. So would typically be 3V or 3.3V. For the latter the 12-bit decoding in millivolts would be (ADCVal * 3300) / 4096

You could measure the internal wrt the 3.3V

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
clark2
Associate II
Posted on March 02, 2016 at 19:24

If you measure Vref to get a reference number of ADC clicks, you can then do something like this:

adc_mv = (1200 * adc_raw_data)/adc_ref;

where adc_raw_data is ADC clicks for a given channel, and adc_ref is ADC clicks for the Vref channel.
DiBosco
Senior II
Posted on March 02, 2016 at 19:28

Thanks for the fast reply, Clive. I'm not quite following; if Vref is tied to Vcc surely full scale would be at an input of Vcc, not 1.2V? That's certainly what your equation points to.

What am I missing here?!

Posted on March 02, 2016 at 19:59

VREFINT is not related to +/-VREF

You can measure VREFINT (1.2V) with the ADC, but it is not used by the ADC, you frame the range of the ADC/DAC with VREF or analogue supplies depending on the package in question.

You'd expect the ADC to report approximately ((1200 * 3300) / 4096) for a part with a 3.3V VDDA (VREF)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..