void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1SEL|=BIT2;
P1IE|=BIT2;// P1.0 output
P1IES=BIT2;
TA1CCTL0 = CM_1+SCS+CCIS_0+CAP+CCIE; // CCR0 interrupt enabled
TA1CCR0 = 60000-1;
TA1CTL = TASSEL_3 + MC_1 ; // SMCLK, contmode, clear TAR
WDTCTL=WDT_ADLY_1000;
SFRIE1|=WDTIE;
_EINT();
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, enable interrupts
__no_operation(); // For debugger
}
// Timer1 interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=TIMER1_A0_VECTOR
__interrupt void TIMER1_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER1_A0_VECTOR))) TIMER1_A0_ISR (void)
#else
#error Compiler not supported!
#endif
{
//xianshi();
Overflow_Cnt++; // Add Offset to CCR0
}
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
{
Frq=TA1R+60000*Overflow_Cnt;
TA1CTL = TACLR;
Overflow_Cnt=0;
}
为什么上升沿捕获触发中断不行,现在直接进不了中断。