4 Gain and Offset Compensation
For further improved performance, both gain and offset compensation can be done using a second non-zero voltage reference measurement. The zero point cannot be used due to the possibility of a negative offset that cannot be measured. An external resistor voltage divider can be used in conjunction with another ADC input for this purpose. The suggested reference is AVDD/16 or below (CalrefL). Values below AVDD/16 can provide additional robustness to component tolerances. However, care must be taken to ensure the reference voltage is not below the maximum absolute error so that the resulting ADC result is always at least one count. The compensation coefficients are calculated with Equation 4-1 using 1/16*AVDD as CalrefL.