我写进MSP430的最后一个程序,如下
include <msp430x14x.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD + WDTNMI + WDTNMIES;//WDT off NMI hi/lo
P2DIR |= 0X01;
P2OUT &= ~0X01; //Clear p2.0 led off
IE1 |= NMIIE;
_BIS_SR(LPM0_bits); //Enter LPM0
}
#pragma vector = NMI_VECTOR
__interrupt void nmi(void)
{
volatile unsigned int i;
P2OUT |= 0X01;
for(i = 20000;i > 0;i--); //delay
P2OUT &= ~0X01; //Clear p2.0 led off
IFG1 &= ~NMIIFG; // Reclear NMI flag in case bounce
IE1 |= NMIIE; //enable NMI
}
然后一直BSL初始化失败!连接不上。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>