这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 基础知识 » tbccr1,adc12 tbccr1触发adc12?

共2条 1/1 1 跳转至

tbccr1,adc12 tbccr1触发adc12?

院士
2006-09-17 18:14:16     打赏
tbccr1,adc12 tbccr1触发adc12?



关键词: tbccr1     adc12     触发    

院士
2006-12-22 22:43:00     打赏
2楼
问 我用tbccr1触发adc12序列单次转换,tb0中断处理a/d结果,发现a/d只触发一次
个位大虾帮我找一下原因!!谢谢
void init_ad (void)
{ ADC12CTL0&=~ENC;//DISABLE A/D,please notice the low error;
ADC12CTL0|=ADC12ON+MSC+SHT0_1+SHT1_1;
ADC12CTL1=SHP+SHS_3+ADC12SSEL_2+CONSEQ_1;//ADC12DIV_1,MCLK/2=4M,TIMEB1 //OUTPUT TRIG THE SAMPLING OF AD
ADC12MCTL0=INCH_0;//UA
ADC12MCTL1=INCH_1;//IA
ADC12MCTL2=INCH_0;//ua
ADC12MCTL3=INCH_2;//UB
ADC12MCTL4=INCH_3;//IB
ADC12MCTL5=INCH_2;//ub
ADC12MCTL6=INCH_4;//UC
ADC12MCTL7=INCH_5;//IC
ADC12MCTL8=INCH_4;//uc
//ADC12MCTL10=INCH_11;
ADC12MCTL9=INCH_6+EOS;//offset
ADC12CTL0|=ENC;//ENABLE A/D
}
void init_tb(void)
{ TBCTL=TBSSEL1+TBCLR;//TBCLK=smCLK,STOP TB
TBCCTL0=CCIE;
TBCCR0=1667;
TBCCTL1=OUTMOD_3;
TBCCR1=1400;
TBCTL|=MC_1;
}

共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]