2016-03-02 09:12 AM
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 :)2016-03-02 09:27 AM
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.3V2016-03-02 10:24 AM
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.
2016-03-02 10:28 AM
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?!2016-03-02 10:59 AM
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)