11.07.2015 Views

ATMega chip full datasheet - UCSD Department of Physics

ATMega chip full datasheet - UCSD Department of Physics

ATMega chip full datasheet - UCSD Department of Physics

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ATmega48A/PA/88A/PA/168A/PA/328/P24.7 ADC Conversion ResultAfter the conversion is complete (ADIF is high), the conversion result can be found in the ADCResult Registers (ADCL, ADCH).For single ended conversion, the result isADC=V IN ⋅ 1024--------------------------V REFwhere V IN is the voltage on the selected input pin and V REF the selected voltage reference (seeTable 24-3 on page 264 and Table 24-4 on page 265). 0x000 represents analog ground, and0x3FF represents the selected reference voltage minus one LSB.24.8 Temperature MeasurementThe temperature measurement is based on an on-<strong>chip</strong> temperature sensor that is coupled to asingle ended ADC8 channel. Selecting the ADC8 channel by writing the MUX3...0 bits inADMUX register to "1000" enables the temperature sensor. The internal 1.1V voltage referencemust also be selected for the ADC voltage reference source in the temperature sensor measurement.When the temperature sensor is enabled, the ADC converter can be used in singleconversion mode to measure the voltage over the temperature sensor.The measured voltage has a linear relationship to the temperature as described in Table 24-2.The voltage sensitivity is approximately 1 mV/°C and the accuracy <strong>of</strong> the temperature measurementis +/- 10°C.Table 24-2.Temperature vs. Sensor Output Voltage (Typical Case)Temperature / °C -45°C +25°C +85°CVoltage / mV 242mV 314mV 380mVThe values described in Table 24-2 are typical values. However, due to the process variation thetemperature sensor output voltage varies from one <strong>chip</strong> to another. To be capable <strong>of</strong> achievingmore accurate results the temperature measurement can be calibrated in the application s<strong>of</strong>tware.The s<strong>of</strong>tware calibration requires that a calibration value is measured and stored in aregister or EEPROM for each <strong>chip</strong>, as a part <strong>of</strong> the production test. The s<strong>of</strong>tware calibration canbe done utilizing the formula:T = { [(ADCH

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!