STML431 ADC differential mode
Hey guys,
I'm a bit confused in using the ADC in differential mode.
I've got a shunt resistor and want to measure the voltage as exact as possible. One side of the shunt is connected to GND, but with higher currents, this GND is not anymore GND (it's a few mV higher, because of the resistance of the PCB trace). So measuring the voltage only on the top of the shunt is inaccurate. I thought using the ADC in differential mode to compense that.
I connected the top of the shunt to the ADC channel 5, the bottom of the shunt to channel 6 and configured channel 5 in differential mode. Before reading the values, I called the ADC calibration function in differential mode. Now I getting results, but I don't know how to convert this register value into a voltage.
For single-ended ADC configuration I found this formula in the reference manual:

Maybe my ADC_DATA values are wrong, but with this formula I get wrong values.
Is there another formula to calculate the voltage in differential mode?
Thanks
