AVR® ADC Differential Mode

A differential Analog-to-Digital Converter (ADC) measures the voltage difference between two signals. An ADC typically measures the voltage between the signal and ground but in differential mode, the ground pin is actually connected to another part of the circuit so the ADC can measure the difference between the two signals. This is often used to measure a small signal with a large offset. Using a differential input allows the ADC to measure a smaller portion of the signal.

Differential Setup

The differential inputs are run through a gain amplifier to increase the signal size to the converter. Some AVR® devices have pins with adjustable gain. When using differential gain channels, certain aspects of the conversion need to be taken into consideration. Differential channels should not be used with an Analog Reference voltage (AREF) less than 2 V. On AVR devices, differential conversions are synchronized to the internal clock CKADC2 equal to half the ADC clock. This synchronization is done automatically by the ADC interface in such a way that the sample-and-hold occurs at a specific phase of CKADC2 clock.

adcdiff.png

Timing Critical Measurements

On a typical AVR device with differential mode, a conversion you initiate (that is, all single conversions, and the first free-running conversion) when CKADC2 clock signal is low will take the same amount of time as a single-ended conversion (13 ADC clock cycles from the next prescaled clock cycle). A conversion you initiate when CKADC2 clock signal is high will take 14 ADC clock cycles due to the synchronization mechanism.

In free-running mode, a new conversion is initiated immediately after the previous conversion completes, and since CKADC2 is high at this time, all automatically started (that is, all but the first) free-running conversions will take 14 ADC clock cycles.

If differential gain channels are used and conversions are started by auto triggering, the ADC must be switched off between conversions. When auto triggering is used, the ADC prescaler is reset before the conversion is started. Since the gain stage is dependent on a stable ADC clock prior to the conversion, this conversion will not be valid. By disabling and then re-enabling the ADC between each conversion (setting the ADEN bit in ADCSRA to 0 then to 1), only extended conversions are performed. The result from the extended conversions will be valid.

Typical Application

Reading the voltage across a resistor with a steady three-volt offset is a simple example where a differential input can measure the signal above the DC offset.

Note: The Differential Schematic at 1:32 in the video above has the ADC pins reversed. Refer to the schematic below for proper connections.

adcdiff2.png

Additional Information

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.