2025-07-11 7:14 AM - last edited on 2025-07-11 10:00 AM by Andrew Neil
Hello,
Just a quick question as I need confirmation :
Using a STM32H7 ADC in a differential input mode, does this circuit work ?
The output of the op-amp is Vout = G * (Vin[+] - Vin[-]) + 1.65 .
Then the ADC output should be between :
But from the datasheet it says that CMV (average between INP and INN) should be around Vref+/2. I'm not sure that's true here.
So can you confirm this wont work and I should do single-ended and substract 1.65V from the result ?
Regards, Adrien
2025-07-11 7:33 AM - edited 2025-07-11 7:34 AM
Is the "opamp" in the above schematics a gain-block, i.e. an amplifier with a built-in feedback set to a fixed gain?
> can you confirm this wont work
ST won't guarantee ADC parameters if the common-mode voltage is outside the datasheet-prescribed range (i.e. close to VREF+/2).
> should do single-ended and substract 1.65V from the result ?
Yes.
But you always can connect the nominally 1.65V node to another input of ADC, perform two single-ended conversions and subtract them in software. This compensates for the possibility that voltage at that 1.65V node is not exactly 1.65V, e.g. due to tolerances of parts used.
JW
2025-07-11 9:55 AM
> [0 - INT16_MAX] when op-amp output is between 1.65V and 3.3V.
> [INT16_MIN - 0] when op-amp output is between GND and 1.65V.
In differential mode, this won't be the case. It'll only be 0 when signal is 0 and INN is 3.3V. If INN if fixed, you lose half of the output range. Output is an unsigned integer, not signed.
I've used differential mode when the common mode is not fixed at VREF+/2 and have not noticed any degradation in performance, but as you saw it doesn't match the datasheet. Up to you if you're willing to live with the uncertainty.
Using single ended mode here to capture both and subtract makes the most sense.