定时器中断为什么只能进一次!!!!!!!!!!!!!!!!!!!!!!
#include<MSP430x14x.h>
unsigned char temp=0xf0;
void main( void )
{
P1DIR = 0XFF;P1OUT = 0XFF;
P2DIR = 0XFF;P2OUT = 0XFF;
P3DIR = 0XFF;P3OUT = 0XFF;
P4DIR = 0XFF;P4OUT = 0XFF;
P5DIR = 0XFF;P5OUT = 0XFF;
P6DIR = 0XFF;P6OUT = 0Xff;
WDTCTL = WDTPW + WDTHOLD; //关闭看门狗
TACTL=TASSEL_1 +TAIE+MC_2;
_EINT();
while(1);
}
#pragma vector = TIMERA1_VECTOR
__interrupt void Timer_A (void)
{
TACTL&=0XFE;
temp=~temp;
P2OUT=temp;
}
此帖出自
小平头技术问答
一周热门 更多>