#include
//unsigned char ad_value[];
int k=0;
unsigned int ad_temp[200];
void main()
{
WDTCTL=WDTPW+WDTHOLD; //关看门狗
BCSCTL1 =CALBC1_16MHZ; //设定DCO为1MHZ
DCOCTL =CALBC1_16MHZ;
P2SEL=0x01; //P2.0输入
P2DIR=0;
// TACTL=TASSEL_2+MC_0+;//增计数
/**********************ADC10*************************/
ADC10CTL0 &=~ENC;//关闭转换
ADC10CTL0=REFON+REF2_5V+ADC10SHT_2+ADC10ON; //打开参考,2.5V,启动AD模块
ADC10CTL1=ADC10SSEL_3+ADC10DIV_1;//时钟源选SMCLK时钟并2分频
ADC10CTL1=INCH_0+CONSEQ_2;//选通道0,AD启动信号来源选TA.OUT1,选单通道连续采样
ADC10CTL0|= ENC+ADC10IE; //开启转换,中断使能
//********************读波形***********************/
while(1)
{
_EINT();
ADC10CTL0 |=ADC10SC;
% |