Setting REFON=1 enables the internal reference. When REF2_5V = 1, the internal reference is 2.5 V, the
reference is 1.5 V when REF2_5V = 0.
REFON=1时,如果REF2_5V=0,那么内部参考电压为1.5V,REF2_5V=1时内部参考电压为2.5V
选择外部参考电压通过SREFx,从datasheet里可以看到有很多种选择,Vref这种是内部参考电压,Veref这种是外部参考电压。
//******************************************************************************
// MSP430G2x33/G2x53 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 save 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.
// ACLK = n/a, MCLK = SMCLK = default DCO ~1.2MHz, ADC10CLK = ADC10OSC/4
//
// MSP430G2x33/G2x53
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// |A10 |
//
// D. Dang
// Texas Instruments Inc.
// December 2010
// Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10
//******************************************************************************
#include "msp430g2553.h"