共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网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【笔记】生成报错synthdesignERROR被打赏50分 | |
【STM32H7S78-DK评测】LTDC+DMA2D驱动RGBLCD屏幕被打赏50分 | |
【STM32H7S78-DK评测】Coremark基准测试被打赏50分 | |
【STM32H7S78-DK评测】浮点数计算性能测试被打赏50分 | |
【STM32H7S78-DK评测】Execute in place(XIP)模式学习笔记被打赏50分 | |
每周了解几个硬件知识+buckboost电路(五)被打赏10分 | |
【换取逻辑分析仪】RA8 PMU 模块功能寄存器功能说明被打赏20分 | |
野火启明6M5适配SPI被打赏20分 | |
NUCLEO-U083RC学习历程2-串口输出测试被打赏20分 | |
【笔记】STM32CUBEIDE的Noruletomaketarget编译问题被打赏50分 |