//******************************************************************************
// MSP-FET430P140 Demo - ADC12 Sample A10 Temp and Convert to oC and oF
//
// Description; A single sample is made on A10 with refernce to internal
// 1.5V Vref. Software sets ADC12SC to start sample and conversion - ADC12SC
// automatically cleared at EOC. ADC12 internal oscillator times sample
// and conversion. In Mainloop MSP430 waits in LPM0 to s××e power until
// ADC10 conversion complete, ADC12_ISR will force exit from any LPMx in
// Mainloop on reti.
// ACLK = n/a, MCLK = SMCLK = default DCO ~ 800kHz, ADC12CLK = ADC12OSC
//
// Uncalibrated temperature measured from device to devive will vary do to
// slope and offset variance from device to device - please see datasheet.
//
// MSP430Fx49
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// |A10 |
//
// M.Buccini
// Texas Instruments, Inc
// January 2004
// Updated for IAR Embedded Workbench Version: 2.21B
//******************************************************************************
#include <msp430x14x.h>
int long temp;
int long IntDegF;
int long IntDegC;
//******************************************************************************
// MSP-FET430P140 Demo - ADC12, Converison of the Temperature Diode
//
//
// This example shows how to use the intergrated temperature diode to measure
// temperature. When the temperature diode channel (A10) is selected for
// conversion, the internal reference is automatically turned on as the source
// for the diode. Note however, that it is NOT automatically selected for the
// conversion. Any ××aila××e reference can be used for the conversion. In
// this example, a single conversion is performed of the temperature diode.
// The temperature is then calculated in degrees C and F, based on the A/D
// conversion value. Test by setting and running to a break point at "_NOP()"
// To view the temperature open a watch window in C-Spy and view DegC and
// DegF.
//
// Note: This example does not perform a calibration on the temperature diode
// A calibration of the temperature diode may be necessary in an application.
// see the device datasheet for the temperature diode specification.
//
// M.Mitchell
// Texas Instruments, Inc
// January, 2002
//******************************************************************************
#include "msp430x14x.h" // Standard Equations
static unsigned int ADCresult;
static unsigned long int DegC, DegF;