.cdecls C,LIST, "msp430.h"
;------------------------------------------------------------------------------
.text ; Progam Start
;------------------------------------------------------------------------------
RESET mov.w #0A00h,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
SetupP1 bis.b #001h,&P1DIR ; P1.0 output
;
Mainloop mov.b #00fh,&P1OUT ; Toggle P1.0
mov.b #000h,&P1OUT
jmp Mainloop ; Again
;------------------------------------------------------------------------------
; Interrupt Vectors
;------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET
程序如上。仿真的时候每次复位PC都是从0x00开使的,不在线仿真时也是不能运行的。手动把PC设为0x10000程序即可正常运行,网上没找到资料。请大家看看是哪里错了。
编译器还报过如下警告
。
复位后如下:![]()