beautypg.com

7 adc conversion result, Atmega4hvd/8hvd – Rainbow Electronics ATmega8HVD User Manual

Page 96

background image

96

8052B–AVR–09/08

ATmega4HVD/8HVD

17.7

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 input pin and V

REF

the voltage reference. 0x000 represents analog

ground, and 0x3FF represents 5 times the reference voltage minus one LSB.

17.7.1

Temperature Measurement using the internal temperature sensor – TBD

The temperature measurement is based on an on-chip temperature sensor that is coupled to a
single ended ADC channel. Selecting the ADC Temperature channel by writing the ADTEMP
bit in ADCSRA register enables the temperature sensor. 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 tempera-
ture as described in

Table 17-2 on page 96

. The voltage sensitivity is approximately 1 mV / °C

and the accuracy of the temperature measurement is +/- 10°C.

The values described in

Table 17-2 on page 96

are typical values. However, due to the pro-

cess 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 software calibration requires that a calibration value is measured
and stored in a register or EEPROM for each chip, as a part of the production test. The sof-
ware calibration can be done utilizing the formula:

where V

TEMP

is the ADC reading of the temperature sensor signal, k is a fixed coefficient (TBD,

1.07 mV/°C) and T

OS

is the temperature sensor offset value determined and stored into

EEPROM as a part of production test.

ADC

V

IN

1024

5

V

REF

--------------------------

=

Table 17-2.

Temperature vs. Sensor Output Voltage (Typical values)

Temperature (°C)

-45 °C

+27 °C

+105 °C

Voltage (mV)

225 mV

297 mV

327 mV

Temperature

k V

TEMP

T

OS

+

=