STM32 gotchas
38.Analog switch voltage booster is needed for analog features to work properly at lower VDD on certain STM32

While many frown upon the performance of analog blocks in the STM32 such as ADC, DAC, opamps and comparators, mainly based on comparison with their standalone counterparts; it's honestly amazing how well these blocks perform when considering the technology upon which they are built, which is aimed primarily at high-speed digital circuits. Consequently, there are not only fundamental limitations to the expectable performance, but there are also quirks which have to be taken into mind, and also extra requirements when operating these analog blocks. While these requirements are clearly set in the documentation, they are often overlooked - given the "I've just whipped up some libraries/clicked in configurator" and "who reads the documentation anyway" attitude we see so often today - ultimately resulting in less-than-optimal operation and unnecessary disappointment.

One of such details to be observed is the usage of an internal analog switch booster at lower VDDs. The STM32 generally work at a rather wide supply voltage range, roughly from 3.3V down to 1.8V. MOSFET transistors are not fully opened at lower gate voltages. While the associated higher channel resistance generally does not matter much for digital operation, it is detrimental when used as analog switches, e.g. in the ADC input multiplexer, which switches the individual channels (as assigned to physical pins) to the ADC "core".

To decrease MOSFET channel resistance, some STM32 families feature an internal higher-voltage source (boost), to drive these MOSFETs' gates high enough at lower VDD. User has to switch this boost on, if the analog switches are to be operated at lower VDDs. The exact VDD is given by the individual datasheets, for example the 'L476 specifies ADC parameters at VDDA<2.4V with boost ON (and above 2.4V with boost OFF).

Of course, using this boost is not "free" - it involves an increased current consumption. For example, DS for mentioned 'L476 specifies the boost current consumption as 0.5mA at VDD between 2.0V and 2.7V.

Also, it takes some time after having the boost enabled in the given register bit, until the high voltage is actually available; again, this time is specified in the respective DS.

The analog switch booster is controlled by a peripheral register bit, given in the respective RM; for example in 'L4, 'G0 and 'G4 it's SYSCFG_CFGR1.BOOSTEN; in H7 it's SYSCFG_PMCR.BOOSTE.

Analog switch booster may also influence VDDA.