Quantcast
Channel: MSP 低功耗微控制器论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 3634

MSP430F149 P1.1 P1.2 P1.3 TA0 TA1 TA2频率捕获问题

$
0
0

void cap_init(void)
{
P1SEL =BIT2; //选择1.2作为捕获的输入端子


TACCTL1|=CM0+SCS+CCIS_0+CAP+CCIE;//上升沿触发,同步模式,使能中断


TACTL |=TASSEL1+ID_0; //选择8M-SMCLK时钟

}

#pragma vector=TIMERA1_VECTOR
__interrupt void TimerA1(void)
{

switch(TAIV)
{
case 2:
{
count++;
break;
};
case 4:
break;
case 10:
break;
}
}

之前的程序实现了P1.2 TA1的频率捕获。

现在想要加上TA0和TA2两个捕获,TA0,TA2对应的中断应该怎么设置?


Viewing all articles
Browse latest Browse all 3634

Trending Articles