![](http://datasheet.mmic.net.cn/90000/MEGA32M1-15AZ_datasheet_3507761/MEGA32M1-15AZ_244.png)
244
7647F–AVR–04/09
ATmega16/32/64/M1/C1
The measured voltage has a linear relationship to the temperature as described in
Table 18-3 onpage 244. The voltage sensitivity is approximately 2.5 mV/
° C and the accuracy of the tempera-
ture measurement is +/- 10°C after bandgap calibration.
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 appli-
cation software.
18.8.1
User Calibration
The software calibration requires that a calibration value is measured and stored in a register or
EEPROM for each chip. The software calibration can be done utilizing the formula:
T = { [ (ADCH << 8) | ADCL ] - T
OS } / k
where ADCH & ADCL are the ADC data registers, k is a fixed coefficient and T
OS is the temper-
ature sensor offset value determined and stored into EEPROM.
18.8.2
Manufacturing Calibration
The calibration values are determined from values measured during test at room temperature
which is approximatively +25°C and during test at hot temperature which is approximatively
+125°C. Calibration measures are done at V
CC = 3V and with ADC in internal Vref (2.56V)
mode.
There are two algorithms for determining the Centigrade Temperature
formula 1 for ATmega32 up to rev B
formula 2 for ATmega16/64 and ATmega32 rev C.
formula 1: Temp_C = (((ADC_ts - 273)* TS_Gain) / 128) + TS_Offset [Applicable to devices with
0xFF or 0x42 ('B') in the signature memory at address 0x003F]
formula 2: Temp_C = ((((ADC_ts -(298 - TS_Offset)) * TS_Gain) / 128) + 25 [Applicable to
devices with 0x43 ('C') in the signature memory at address 0x003F]
Where :
Temp_C is the result temperature in degrees centigrade.
ADC_ts is the 10 bit result the ADC returns from reading the temperature sensor.
TS_Gain is the unsigned fixed point 8-bit temperature sensor gain factor in 1/128th units stored
as previously in the signature row at address 0x0007.
TS_Offset is the signed twos complement 7-bit temperature sensor offset reading stored as pre-
viously in the signature row at address 0x0005.
Table 18-3.
Temperature vs. Sensor Output Voltage (Typical Case)
Temperature / °C
-40°C
+25°C
+125°C
Voltage / mV
600 mV
762 mv
1012 mV