#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW | WDTHOLD;
// Configure GPIO
P1OUT = 0;
P1DIR = 0xFF;
P2OUT = 0;
P2DIR = 0xFF;
P3OUT = 0;
P3DIR = 0xFF;
P4OUT = 0;
P4DIR = 0xFF;
P5OUT = 0;
P5DIR = 0xFF;
P6OUT = 0;
P6DIR = 0xFF;
P7OUT = 0;
P7DIR = 0xFF;
P9OUT = 0;
P9DIR = 0xFF;
PJOUT = 0;
PJSEL0 = BIT4 | BIT5; // For XT1
PJDIR = 0xFFFF;
// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
// XT1 Setup
CSCTL0_H = CSKEY >> 8; // Unlock CS registers
CSCTL1 = DCOFSEL_0; // Set DCO to 1MHz
CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers to 1
CSCTL4 &= ~LFXTOFF; // Enable LFXT1
do
{
CSCTL5 &= ~LFXTOFFG; // Clear XT1 fault flag
SFRIFG1 &= ~OFIFG;
}while (SFRIFG1&OFIFG); // Test oscillator fault flag
CSCTL0_H = 0; // Lock CS registers
__bis_SR_register(LPM3_bits);
}
使用官网的LPM3低功耗程序下载到调试板上后,再下载程序就下载失败了。
检测到TEST引脚一直为低。
望赐教啊!!!
gaoyang9992006:
点重试,然后按系统复位试试看。或者换其他下载接口下载试试。