Datasheet

148
ATtiny828 [DATASHEET]
8371A–AVR–08/12
z 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.
z 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.
15.11 ADC Conversion Result
After the conversion is complete (ADIF is high), the conversion result can be found in the ADC Data Registers (ADCL,
ADCH). The result is, as follows:
where V
IN
is the voltage on the selected input pin and V
REF
the selected voltage reference (see Table 52 on page 150).
0x000 represents analog ground, and 0x3FF represents the selected reference voltage minus one LSB. The result is
presented in one-sided form, from 0x3FF to 0x000.
15.12 Temperature Measurement
The temperature measurement is based on an on-chip temperature sensor that is coupled to a single ended ADC
channel. The temperature sensor is enabled by writing MUX bits. The internal 1.1V reference must also be selected for
the ADC reference source in the temperature sensor measurement. When the temperature sensor is enabled, the ADC
converter can be used in single conversion mode to measure the voltage over the temperature sensor.
The measured voltage has a linear relationship to the temperature as described in Table 50 The sensitivity is
approximately 1 LSB / °C and the accuracy depends on the method of user calibration. Typically, the measurement
accuracy after a single temperature calibration is ±
10°C, assuming calibration at room temperature. Better accuracies
are achieved by using two temperature points for calibration.
Table 50. Temperature vs. Sensor Output Voltage (Typical Case)
The values described in Table 50 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 software. 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.
ADC
V
IN
1024
V
REF
-------------------------
=
Temperature -40°C +25°C +85°C
ADC 235 LSB 300 LSB 360 LSB