给你个例子程序参考参考吧,呵呵。
//******************************************************************************
// MSP-FET430P120 Demo - ADC10 Sample A10 Temp and Convert to oC and oF
//
// Description; A single sample is made on A10 with reference to internal
// 1.5V Vref. Software sets ADC10SC to start sample and conversion - ADC10SC
// automatically cleared at EOC. ADC10 internal oscillator/4 times sample
// (64x) and conversion. In Mainloop MSP430 waits in LPM0 to s××e power until
// ADC10 conversion complete, ADC10_ISR will force exit from any LPMx in
// Mainloop on reti. Temperaure in oC stored in IntDegC, oF in IntDegF.
//
// Uncalibrated temperature measured from device to device will vary with
// slope and offset - please see datasheet.
// //*MSP430F1232 or MSP430F1132 Device Required*//
//
// MSP430F1232
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// |A10 |
//
// M.Buccini
// Texas Instruments, Inc
// January 2004
// Updated for IAR Embedded Workbench Version: 2.21B
//******************************************************************************
#include <msp430x12x2.h>
int long temp;
int long IntDegF;
int long IntDegC;