我在使用msp430g2553的time_A0的连续模式下,我把TACCTL0做为捕获模式用,捕获一个矩形波的上升沿并读取中断时TAR的值,读不到正确的值,我又换了读TACCR0中的值,也读不出来,我参考一些其他类型的430关于这方面的程序,都差不多,为什么我的不行呢,求解?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我在使用msp430g2553的time_A0的连续模式下,我把TACCTL0做为捕获模式用,捕获一个矩形波的上升沿并读取中断时TAR的值,读不到正确的值,我又换了读TACCR0中的值,也读不出来,我参考一些其他类型的430关于这方面的程序,都差不多,为什么我的不行呢,求解?
请详细描述下“读不到正确的值”和“读不除TACCR0的值“
检查下你的初始化配置是否正确。
首先配置timer 捕获模式
TA1CTL = TASSEL_2 + MC_2; // SMCLK, contmode
TA1CCTL0 = CM_3 + CCIS_1 + SCS + CAP + CCIE; // Interrupt at both edges
然后通过中断读取ccr0数值
#pragma vector=TIMER1_A0_VECTOR
__interrupt void Timer_A (void)