Datasheet

138
2586N–AVR–04/11
ATtiny25/45/85
assuming calibration at room temperature. Better accuracies are achieved by using two
temperature points for calibration.
The values described in Table 17-2 are typical values. However, due to process variation the
temperature sensor output voltage varies from one chip to another. To be capable of achieving
more accurate results the temperature measurement can be calibrated in the application soft-
ware. The sofware calibration can be done using the formula:
T = k * [(ADCH << 8) | ADCL] + T
OS
where ADCH and ADCL are the ADC data registers, k is the fixed slope coefficient and T
OS
is the
temperature sensor offset. Typically, k is very close to 1.0 and in single-point calibration the
coefficient may be omitted. Where higher accuracy is required the slope coefficient should be
evaluated based on measurements at two temperatures.
17.13 Register Description
17.13.1 ADMUX – ADC Multiplexer Selection Register
Bits 7:6, 4 – REFS[2:0]: Voltage Reference Selection Bits
These bits select the voltage reference (V
REF
) for the ADC, as shown in Table 17-3. If these bits
are changed during a conversion, the change will not go in effect until this conversion is
complete (ADIF in ADCSR is set). Whenever these bits are changed, the next conversion will
take 25 ADC clock cycles. When differential channels and gain are used, using V
CC
or an
external AREF higher than (V
CC
- 1V) as a voltage reference is not recommended as this will
affect the ADC accuracy.
Note: 1. The device requries a supply voltage of 3V in order to generate 2.56V reference voltage.
Table 17-2. Temperature vs. Sensor Output Voltage (Typical Case)
Temperature -40°C+25°C+85°C
ADC 230 LSB 300 LSB 370 LSB
Bit 76543210
0x07 REFS1 REFS0 ADLAR REFS2 MUX3 MUX2 MUX1 MUX0 ADMUX
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value00000000
Table 17-3. Voltage Reference Selections for ADC
REFS2 REFS1 REFS0 Voltage Reference (V
REF
) Selection
X00V
CC
used as Voltage Reference, disconnected from PB0 (AREF).
X01
External Voltage Reference at PB0 (AREF) pin, Internal Voltage
Reference turned off.
0 1 0 Internal 1.1V Voltage Reference.
0 1 1 Reserved
110
Internal 2.56V Voltage Reference without external bypass
capacitor, disconnected from PB0 (AREF)
(1)
.
111
Internal 2.56V Voltage Reference with external bypass capacitor at
PB0 (AREF) pin
(1)
.