void Init_TimerA(void)
{
TACTL |= TASSEL_1+TACLR; //选择ACLK
// CCTL0 |= CCIE;
CCR0 = 32768;
TACTL |= MC_1;
TACCTL1|=CM_1+CCIS_0+SCS+CAP+CCIE; //CCR1上升沿捕获,
}
#pragma vector=TIMERA0_VECTOR
__interrupt void TimerA_ISR(void)
{
fre=count; //flag=1,定时一秒
count=0;
TACCTL0&=~CCIE;
} |
|