Implementation

An example setup for calibrating the ADC is shown in the figure below.

Figure 1. Production Calibration Setup

During the production test phase, each device’s ADC must be characterized using a test setup similar to this. When the test fixture is ready for calibrating the AVR, the tester signals the AVR to start calibrating itself. The AVR uses the test fixture’s high accuracy DAC (e.g. 16-bit resolution) to generate input voltages to the calibration algorithm. When calibration is finished, the parameters for offset and gain error compensation are programmed into the EEPROM for later use, and the AVR signals that it is ready for other test phases.

Note: This requires the EESAVE fuse to be programmed, so that the Flash memory can be reprogrammed without erasing the EEPROM. Otherwise, the ADC parameters must be temporally stored by the programmer while erasing the device.