溫度
如何使用基板內建溫度計?
The msp430g2553 data sheet has the usual footnote describing how to convert ADC measurements from channel 10 into a temperature:
The following formula can be used to calculate the temperature sensor output voltage:
VSensor,typ = TCSensor (273 + T [°C] ) + VOffset,sensor [mV]
where TCSensor is 3.55 mV/Cel. VOffset,sensor is presumably a part-specific calibration value.
The msp430g2x33_adc10_temp.c example has the following calculation to convert an ADC10 measurement of INCH10 to a temperature:
// oC = ((A10/1024)*1500mV)-986mV)*1/3.55mV = A10*423/1024 - 278
temp = ADC10MEM;
IntDegC = ((temp - 673) * 423) / 1024;
Where did the 986mV come from? It corresponds to an offset of 278 degrees, and seems to suggest the zero volt measurement would be at about 5 degrees below absolute zero. The equation from the data sheet suggests it should be 969mV (273 Cel * 3.55 mV/Cel).