MSP430F2013实现内部温度传感器测温[转载日本]
[IMGA=0,absMiddle]http://www.page.sannet.ne.jp/kenjia/MSP430/sconnection3.jpg[/IMGA]
源代码下载
[URL=http://www.page.sannet.ne.jp/kenjia/Download/eZ430_sample_0_by_JH1PJL.zip][COLOR=#ff0000]MSP430F2013实现内部温度传感器测温[/COLOR][/URL]
详情请查看:[URL=http://www.page.sannet.ne.jp/kenjia/J_msp430_0.html#msp_5]http://www.page.sannet.ne.jp/kenjia/J_msp430_0.html#msp_5[/URL]
VCC与温度关系计算:
VCC計算のインプリメント
/********** Nomalize Vcc data subroutine ******************************************/
// (Normalized Vcc) = (ADC converted data ) x Constant_Vcc
// Constant = 201.4 [uV/bit]
void normalize_adcvcc( void )
{
nor_adc_vcc = ((unsigned long)((int)(adc_vcc)-(adc_offset))*20142)/100000;
}
温度計算のインプリメント
/********** Nomalize Temperature data subroutine ***********************************/
// (Normalized Temperature) = (Vsen - Voffset)/TCsen - 273
// Vsen = (ADC converted data ) x Constant_temp
// Constant_temp = 18.311 [uV/bit], Voffset = 0 [V], TCsen = 1.32 [mV/K]
void normalize_adctemp( void )
{
nor_adc_temp =
(unsigned int)((((unsigned long)((int)(adc_temp)-(adc_offset))* 18311)/132 - 2730000)/100);
}