92
8126F–AVR–05/12
ATtiny13A
• Quantization Error: Due to the quantization of the input voltage into a finite number of codes,
a range of input voltages (1 LSB wide) will code to the same value. Always ± 0.5 LSB.
• Absolute Accuracy: The maximum deviation of an actual (unadjusted) transition compared to
an ideal transition for any code. This is the compound effect of offset, gain error, differential
error, non-linearity, and quantization error. Ideal value: ± 0.5 LSB.
14.11 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 V
IN
is the voltage on the selected input pin and V
REF
the selected voltage reference (see
and
). 0x000 represents analog ground, and
0x3FF represents the selected reference voltage minus one LSB.
14.12 Register Description
14.12.1
ADMUX – ADC Multiplexer Selection Register
• Bits 7, 4:2 – Res: Reserved Bits
These bits are reserved bits in the ATtiny13A and will always read as zero.
• Bit 6 – REFS0: Reference Selection Bit
This bit selects the voltage reference for the ADC, as shown in
. If this bit is changed
during a conversion, the change will not go in effect until this conversion is complete (ADIF in
ADCSRA is set).
•
Bit 5 – ADLAR: ADC Left Adjust Result
The ADLAR bit affects the presentation of the ADC conversion result in the ADC Data Register.
Write one to ADLAR to left adjust the result. Otherwise, the result is right adjusted. Changing the
ADLAR bit will affect the ADC Data Register immediately, regardless of any ongoing conver-
sions. For a complete description of this bit, see
“ADCL and ADCH – The ADC Data Register” on
ADC
V
IN
1024
⋅
V
REF
--------------------------
=
Bit
7
6
5
4
3
2
1
0
–
REFS0
ADLAR
–
–
–
MUX1
MUX0
ADMUX
Read/Write
R
R/W
R/W
R
R
R
R/W
R/W
Initial Value
0
0
0
0
0
0
0
0
Table 14-2.
Voltage Reference Selections for ADC
REFS0
Voltage Reference Selection
0
V
CC
used as analog reference.
1
Internal Voltage Reference.