Offset and Gain Compensation

When the OPAMP is used in combination with the ADC, the OPAMP offset and gain errors can be compensated. To calculate offset and gain error compensation values

  1. 1.Configure OPAMP as Voltage Follower
  2. 2.Route the OPAMP output to the ADC:
    • Write a '1' to the Analog Output bit in the Operational Amplifier x Control register (OPAMPCTRLx.ANAOUT)
    • Select the OPAMP as input for the ADC, see ADC – Analog-to-Digital Converter.
  3. 3.Measure and set the Offset Correction value for the ADC OFFSETCORR register as in Offset Compensation.
  4. 4.Measure and set the Gain Correction value for the ADC GAINCORR register as in Gain Compensation.
The offset error compensation must be determined before gain error compensation.

The relation for offset and gain error compensation is shown in this equation:

Result = (converted value + OFFSETCORR)*GAINCORR