|
msp430g2553写一段定时捕获,中断也进不了
[复制链接]
用msp430g2553写一段定时捕获,中断也进不了,下面是程序:
void Timing_acquisition(void)
{
P1SEL|=BIT1; //P1.1 CCI0A
P1DIR &=~BIT1;
TACTL = TASSEL_2 + MC_2+TACLR; //L连续计数模式
TACCTL1 =CAP+CCIS_0+CM_1+CCIE; //+SCS捕获模式,上升xia捕获,选择 CCI0A,同步,捕获中断开
TACTL &= ~CCIFG;
_EINT(); //开总中断
while(1)
{.... }
#pragma vector=TIMER0_A1_VECTOR
__interrupt void Timer_A1(void)
{
pwm_wide=CCR1-pwm_last;
pwm_last=CCR1;
LPM0_EXIT;
}
不知道是哪里出了问题?
|
|