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.

Timer問題

Other Parts Discussed in Thread: CC430F6137

我最近在研究 CC430F6137的Timer的功能

抓了網路上的範例

我發現到 當程式進入了中斷副程式之後

程式不會再跑回主程式

請問到底是哪裡出了錯誤?

感謝 懇請賜教 

#include "cc430x613x.h"

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0x01; // P1.0 output
TA1CCTL0 = CCIE; // CCR0 interrupt enabled
TA1CCR0 = 50000;
TA1CTL = TASSEL_2 + MC_2 + TACLR; // SMCLK, contmode, clear TAR

__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, enable interrupts
__no_operation(); // For debugger

}


// Timer A0 interrupt service routine
#pragma vector=TIMER1_A0_VECTOR
__interrupt void TIMER1_A0_ISR(void)
{
P1OUT ^= 0x01; // Toggle P1.0

}