100
ATtiny26(L)
1477G–AVR–03/05
Figure 56. Differential Measurement Range
Example:
ADMUX = 0xEB (ADC0 - ADC1, 20x gain, 2.56V reference, left adjusted result)
Voltage on ADC0 is 400 mV, voltage on ADC1 is 300 mV.
ADCR = 1024 * 20 * (400 - 300) / 2560 = 800 = 0x320
ADCL will thus read 0x00, and ADCH will read 0xC8. Writing zero to ADLAR right
adjusts the result: ADCL = 0x20, ADCH = 0x03.
Table 44. Correlation Between Input Voltage and Output Codes
V
ADCn
Read code
Corresponding decimal value
V
ADCm
+ V
REF
/GAIN
0x3FF
1023
V
ADCm
+ (1023/1024) V
REF
/GAIN
0x3FF
1023
V
ADCm
+ (1022/1024) V
REF
/GAIN
0x3FE
1022
...
...
...
V
ADCm
+ (1/1024) V
REF
/GAIN
0x001
1
V
ADCm
0x000
0
0
Output Code
0x3FF
0x000
V
REF
/GAIN
Differential Input
Voltage (Volts)