This application note introduces some software techniques for compensating and minimising ST7 ADC errors. The document also provides some general tips on writing ADC software. For a list of related application notes that contain other useful information about ADCs see section 6 on page 39. This document provides some methods of calibrating the ADC. Some ADC errors like Offset and Gain errors can be cancelled using these simple software techniques. Other errors like Differential Linearity Error and Integral Linearity Error are associated with the ADC design and cannot be compensated easily. The example software provided with this application note is explained in brief in section 5 on page 35.
The document provides guidelines for programming the ADC, including checking device support for maximum frequency, selecting conversion channels, polling for end of conversion, and reading results. It details specific procedures such as entering HALT mode and using timers for periodic conversions.
Furthermore, it covers advanced software techniques to improve accuracy, such as averaging, histogram analysis, and noise filtering algorithms. The note also discusses methods for reducing system noise by utilizing slow or wait modes and executing code from RAM.
Read the ADCDRL register first, then read the ADCDRH register. Combine them by left-shifting ADCDRH by 2 bits and OR-ing with the value of ADCDRL.
Switch the built-in amplifier ON using a control bit to zoom for lower voltages.