#include "msp430x54x.h"
int main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P5OUT|=BIT4;
P5DIR|=BIT4;
P7DIR|=BIT3;
P7OUT&=~BIT3;
P1DIR =BIT4+BIT5+BIT6+BIT7;
P1OUT = 0x0F; // 设置LED控制端IO属性
TA0CTL |= TASSEL1+MC0+TACLR; 增计数模式 选择时钟smclk
TA0CCR0 =900;
TA0CCTL0|= CCIE;
_EINT() ;
LPM3 ;
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer0_A0 (void)
{
P1OUT ^= 0xF0;
TA0CCR0 = 900;
}
该程序就是0 1翻转 为什么必须有LPM3这一行;没有它就不好使呢
|