Introduction
Microchip megaAVR® devices have a successive approximation Analog-to-Digital Converter (ADC) capable of conversion rates up to 15 ksps with a resolution of 10 bits. It features a flexible multiplexer, which allows the ADC to measure the voltage at multiple single-ended input pins and an internal channel from the bandgap reference in the device. Single-ended input channels are referred to ground.
This application note describes the basic functionality of the ADC in Microchip megaAVR devices in single-ended mode with code examples on Microchip ATmega88 to get started. The code examples are written in ‘C’ language and have been tested on the Microchip STK®600 starter kit for functionality.