#include <msp430x14x.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P3DIR |= 0x02; // P3.1
P3OUT = 0; //P3.1=0
CCTL0 = CCIE;
CCR0 = 4096-1; //1S //CCR0=2047
TACTL = TASSEL_1 + MC_1+ ID_3; // TACTL = TASSEL_1 + MC_3+ ID_3 ,这两行有啥区别呢,我感觉都一样啊,都是1秒啊。
_BIS_SR(LPM0_bits + GIE);
}
// Timer A0 interrupt service routine
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
p3out^=BIT0;
}
问题在旁边写了,谢谢了