STM32 gotchas
222. ADC differential mode has limited common mode voltage range

Some higher-end STM32 support in ADC differential mode. Usually, neighbouring channels can be paired and used as a differential pair. There are specific settings in ADC control registers to enable differential mode, and, usually, there is also a specific calibration for the differential measurements. As the ADC module vaires between STM32 families, it is necessary to look up the details in the ADC chapter of related Reference Manual.

However, users may be caught by surprise when checking the common-mode voltage for the differential ADC modes; it is rather restricted, and has to be at around half of the reference voltage ("analog midpoint").

In the 'F3 family, this is specified in form of Erratum as ((VSSA + VREF+)/2) +- 10%. For VREF+ around 3V this means, that common mode voltage ((V+ + V-) / 2, i.e. the voltage "in the middle of input voltages") may not be further off the "midpoint" than cca 150mV.

The 'H5 and 'U5 families specify the common-mode voltage for differential ADC mode similarly as +-10%, although this time this specification is already part of the ADC specification values in the datasheet.

The 'G4 specifies the common-mode voltage as (VREF- + VREF+)/2) +- 180mV.