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.

求解:为什么捕获不到数据?程序如下

Other Parts Discussed in Thread: MSP430F5529

用的是MSP430F5529芯片:

{

   /*捕获*/

    P2DIR &= ~BIT4; // P2.4 input
    P2REN |= BIT4; // P2.4 上下拉电阻
    P2OUT |= BIT4; // P2.4 输出为1 上拉
    P2SEL |= BIT4;   // P2.4 options select

    // TA0CCTL0 = CCIE + CAP + SCS + CM_2 + CCIS_0;// CCR0中断使能,捕获模式,同步,下降沿捕获,CCIxA
    TA0CCTL1 = CCIE + CAP + SCS + CM_2 + CCIS_0;// CCR1中断使能,捕获模式,同步,下降沿捕获,CCIxA
    TA0CTL = TAIE + TASSEL_2 + MC_2 + ID_0 + TACLR;//使能中心计数器中断,SMCLK, continue mode,不分频, clear TAR
}

// Timer2_A8 interrupt service routine
#pragma vector=TIMER0_A1_VECTOR
__interrupt void TIMER0_A1_ISR(void)
{
    switch(__even_in_range(TA0IV,14))
    {
        case 0:
             break; // No interrupt
        case 2: // CCR1
            if(F_C1)
            {
                number[1]=TA0CCR1;
                number[2]=number[1]+count*65535-number[0];
                count=0;
                F_C1=0;
                F0_C=1;
            }
            else
            {
                number[0]=TA0CCR1;
                F_C1=1;
                count=0;
            }
            break;
        case 4: // CCR2
            break;
        case 6:
            break; // reserved
        case 8:
            break; // reserved
        case 10:
            break; // reserved
        case 12:
            break; // reserved
        case 14:
        count++; // overflow
            break;
        default:
            break;
        }
}

补充:程序没进入case 2中,调试时候,TA0CCR1没有捕获TA0R的值,但是能在P2IN中看到输入数据变化,不明白为什么?