beautypg.com

3 operation – Rainbow Electronics ATtiny861_V User Manual

Page 143

background image

143

2588B–AVR–11/06

ATtiny261/461/861

Figure 19-1. Analog to Digital Converter Block Schematic

19.3

Operation

The ADC converts an analog input voltage to a 10-bit digital value through successive approxi-
mation. The minimum value represents GND and the maximum value represents the voltage on
V

CC

, the voltage on the AREF pin or an internal 1.1V / 2.56V voltage reference.

The voltage reference for the ADC may be selected by writing to the REFS2..0 bits in ADMUX.
The VCC supply, the AREF pin or an internal 1.1V / 2.56V voltage reference may be selected as
the ADC voltage reference. Optionally the internal 1.1V / 2.56V voltage reference may be decou-
pled by an external capacitor at the AREF pin to improve noise immunity.

The analog input channel and differential gain are selected by writing to the MUX5..0 bits in
ADMUX. Any of the 11 ADC input pins ADC10..0 can be selected as single ended inputs to the
ADC. The positive and negative inputs to the differential gain amplifier are described in

Table

19-4

.

If differential channels are selected, the differential gain stage amplifies the voltage difference
between the selected input pair by the selected gain factor, 1x, 8x, 20x or 32x, according to the
setting of the MUX5..0 bits in ADMUX and the GSEL bit in ADCSRB. This amplified value then
becomes the analog input to the ADC. If single ended channels are used, the gain amplifier is
bypassed altogether.

ADC CONVERSION

COMPLETE IRQ

8-BIT DATA BUS

15

0

ADC MULTIPLEXER

SELECT (ADMUX)

ADC CTRL. & STATUS

REGISTER A (ADCSRA)

ADC DATA REGISTER

(ADCH/ADCL)

MUX2

ADIE

ADATE

ADSC

ADEN

ADIF

ADIF

MUX1

MUX0

ADPS0

ADPS1

ADPS2

MUX3

CONVERSION LOGIC

10-BIT DAC

+

-

SAMPLE & HOLD
COMPARATOR

MUX DECODER

MUX4

ADC7

ADC6

ADC5

ADC4

ADC3

ADC2

ADC1

ADC0

REFS0

REFS1

ADLAR

+

-

CHANNEL SELECTION

GAIN SELECTION

ADC[9:0]

ADC

MULTIPLEXER OUTPUT

GAIN
AMPLIFIER

INTERNAL 1.18V

REFERENCE

PRESCALER

SINGLE ENDED /

DIFFERENTIAL SELECTION

AGND

POS.

INPUT

MUX

NEG.

INPUT

MUX

ADC10

ADC9

ADC8

VCC

AREF

TEMPERATURE

SENSOR

INTERNAL 2.56/1.1V

REFERENCE

MUX

ADC CTRL. & STATUS

REGISTER B (ADCSRB)

REFS2

GSEL

MUX5