44.6.11.2 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
- Configure OPAMP as Voltage Follower
- 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.
- Measure and set the Offset Correction value for the ADC OFFSETCORR register as in 44.6.11.3 Offset Compensation.
- Measure and set the Gain Correction value for the ADC GAINCORR register as in 44.6.11.4 Gain Compensation.
The relation for offset and gain error compensation is shown in this equation:
Result = (converted value + OFFSETCORR)*GAINCORR