English
Language : 

AN1711 Datasheet, PDF (31/40 Pages) STMicroelectronics – SOFTWARE TECHNIQUES FOR COMPENSATING ST7 ADC ERRORS
SOFTWARE TECHNIQUES FOR COMPENSATING ST7 ADC ERRORS
Offset error (approx.) = Ideal digital value - Actual digital value
Eo approx. = 10-(DIgital code AIN2)
Gain error (approx.) = Actual digital value - Ideal digital value
Eg approx. = (Digital code AIN1)-1013
Please note that the offset error is the difference between first actual transition and first ideal
transition. When the actual digital code for same input voltage is received less than the ex-
pected (ideal) analog input, this means that a higher input voltage will be required to produce
the same digital code. This results in a positive offset error. So we have reversed the polarity
and used the ideal digital value - actual digital value, instead of actual analog value- ideal an-
alog value. This calculation is approximate. The results received thus can be used for cali-
brating the ADC.
Similarly we can calculate the Gain errors.
Mathematic calculations
Assuming the ADC transfer curve is a straight line, we obtain the linear function:
Y= ax+b .........[1]
where Y is the converter output i.e digital code
a is the slope of the transfer curve
x is the input/ actual reading
b is the offset
For the 1st conversion result of an input voltage equivalent to 10LSB:
Y1 = a * x1 + b .... [2]
For the 2nd conversion result of an input voltage equivalent to 1013LSB:
Y2 = a * x2 + b ..... [3]
Subtracting [3] - [2]
Y2-Y1 = a (x2-x1) ......[4]
slope a = (Y2-Y1)/(x2-x1) ....[5]
Putting this value of ‘a’ in the equation [2]
b = Y1- ((Y2-Y1)/(x2-x1)) * x1 .....[6]
as, Y = ax + b
x = (Y-b)/a
31/40