AVR® ADC Operating Modes
The AVR® Analog to Digital Conversion (ADC) Peripheral Operation Modes are just some of the features this peripheral offers. Refer to the ADC section of the datasheet for the device you've selected for more detail.
Single Conversion Mode
A single conversion is started by writing a to the Power Reduction ADC bit in the Power Reduction Register PRR0.PRADC, and writing a 1 to the ADC Start Conversion bit in the ADC Control and Status Register A ADCSRA.ADSC. The ADCS bit will stay high as long as the conversion is in progress and will be cleared by hardware when the conversion is completed. If a different data channel is selected while a conversion is in progress, the ADC will finish the current conversion before performing the channel change.
Auto Triggering Mode
A conversion can be triggered automatically by various sources. Auto Triggering is enabled by setting the ADC Auto Trigger Enable bit ADCSRA.ADATE.
The trigger source is selected by setting the ADC Trigger Select bits in the ADC Control and Status Register B ADCSRB.ADTS. See the description of the ADCSRB.ADTS for a list of available trigger sources.
When a positive edge occurs on the selected trigger signal, the ADC prescaler is reset and a conversion is started. This provides a method of starting conversions at fixed intervals. If the trigger signal is still set when the conversion completes, a new conversion will not be started. If another positive edge occurs on the trigger signal during conversion, the edge will be ignored.
Free Running Mode
When Free Running Mode is selected the ADC Interrupt Flag is used as a trigger source and makes the ADC start a new conversion as soon as the ongoing conversion has finished. This Free Running mode, constantly samples and updates the ADC Data Register. The first conversion must be started by writing a 1 to ADCSRA.ADSC. In this mode, the ADC will perform successive conversions independently of whether the ADC Interrupt Flag ADIF is cleared or not.