共2条
1/1 1 跳转至页
tbccr1,adc12 tbccr1触发adc12?
问
我用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;
}
个位大虾帮我找一下原因!!谢谢
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 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |