
99
1477K–AVR–08/10
ATtiny26(L)
Special care should be taken when changing differential channels. Once a differential channel
has been selected, the gain stage may take as much as 125 s to stabilize to the new value.
Thus conversions should not be started within the first 125 s after selecting a new differential
channel. Alternatively, conversion results obtained within this period should be discarded.
The same settling time should be observed for the first differential conversion after changing
ADC reference (by changing the REFS1:0 bits in ADMUX).
ADC Noise
Canceler Function
The ADC features a noise canceler that enables conversion during ADC Noise Reduction mode
CPU core and other I/O peripherals. If other I/O peripherals must be active during conversion,
this mode works equivalently for Idle mode. To make use of this feature, the following procedure
should be used:
1. Make sure that the ADC is enabled and is not busy converting. Single Conversion mode
must be selected and the ADC conversion complete interrupt must be enabled.
ADEN = 1
ADSC = 0
ADFR = 0
ADIE = 1
2. Enter ADC Noise Reduction mode (or Idle mode). The ADC will start a conversion once
the CPU has been halted.
3. If no other interrupts occur before the ADC conversion completes, the ADC interrupt will
wake up the CPU and execute the ADC Conversion Complete interrupt routine.
ADC Conversion
Result
After the conversion is complete (ADIF is high), the conversion result can be found in the ADC
Result Registers (ADCL, ADCH).
For single ended conversion, the result is
where VIN is the voltage on the selected input pin and VREF the selected voltage reference (see
represents the selected reference voltage minus one LSB.
If differential channels are used, the result is
where VPOS is the voltage on the positive input pin, VNEG the voltage on the negative input pin,
GAIN the selected gain factor, and VREF the selected voltage reference. Keep in mind that VPOS
must be higher than VNEG, otherwise, the ADC value will saturate at 0x000. Figure 56 shows the decoding of the differential input range.
Table 44 shows the resulting output codes if the differential input channel pair (ADCn - ADCm) is
selected with a gain of GAIN and a reference voltage of VREF.
ADC
VIN 1024
VREF
--------------------------
=
ADC
VPOS VNEG
–
() GAIN 1024
VREF
---------------------------------------------------------------------------
=