This Atmel Studio 7 bare metal example in Gain and Offset Calibration of the Analog Signal Conditioning (OPAMP) Peripheral (AN3633) shows how to calibrate the gain and offset of the OPAMP when configured as a Programmable Gain Amplifier (PGA). The internal Digital-to-Analog converter (DAC) and Analog-to-Digital converter (ADC) are used to perform the calibration procedure. No external components are required.