Electronic – STM32F1 Can’t I use the internal voltage reference as the ADC reference

adcstm32stm32f10x

There seems to be a badgap voltage reference built-in in the STM32F1 microcontrollers (on ADCx_IN17).

Coming from AVRs it seems to me very strange that it's not possible to use this reference as the ADC VREF, at least I think it's impossible. Am I right ? Why is it there than ?

Best Answer

It is possible to use the internal reference, albeit indirectly. You measure it using the Vdd, and then measure the external voltage you are interested in, using the same Vdd as ADC reference. You can then calculate what the supply must be, knowing Vref and the counts it gave. Then you know more accurately what the ADC is using, and can calculate the external channel voltage you want. The assumption here is that Vdd does not move much between the two readings. If this is a concern, measure Vref before and after measuring the channel with your data on, and use an average. For battery operated systems, this gives you the battery voltage as well, which is probably of interest. This is not as accurate as an external precision reference, but is cheaper, uses less power and does not tie up extra pins...