微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 硬件电路设计 > TI模拟硬件电路设计 > 程序RUN时出错,求好心人!

程序RUN时出错,求好心人!

时间:10-02 整理:3721RD 点击:
我的程序编译连接都能通过,但是RUN时出现No valid program is currently loaded into memory.Do you still want to run?  这是怎么回事?我用的是汇编,请高手指点迷津啊!

这个问题解决,是因为没有load program,但是现在执行load program时还是回报错,意思是不可写的,这是怎么回事啊?

可能你的CMD文件有问题

我调的是书上的例程,如下:
.include \"f2407.h\"
.include \"vector.h\"

KICK_DOG .macro
LDP #00E0h
SPLK #05555h,WDKEY
SPLK #0AAAAh,WDKEY
LDP #0h
.endm

.bss TEMP,1
.bss TEMPA3,1
.bss TEMPC7,1
.bss TEMPC0,1

.text
_c_int0:
LDP #0h
SETC INTM
SPLK #0000h,IMR
LACC IFR
SACL IFR
LDP #WDKEY>>7h
SPLK #0204h,SCSR1
SPLK #006Fh,WDCR
KICK_DOG
MAR *,AR0
LDP #0E1h
SPLK #00000h,MCRA
SPLK #0FF00h,MCRB
SPLK #00000h,MCRC

SPLK #1111111100000000b,PADATDIR
SPLK #1111111100000000b,PCDATDIR

LDP #GPTCONA>>7h
SPLK #0000000000000000b,GPTCONA
SPLK #0000000000000000b,T1CNT
SPLK #0000111101000010b,T1CON

SPLK #1111111111111111b,T1PR
SPLK #0000000011111111b,T1CMPR
SPLK #0000011110000000b,EVAIMRA
SPLK #0000011110000000b,EVAIFRA

LDP #TEMP
SPLK #01h,TEMP
SPLK #01h,TEMPA3
SPLK #01h,TEMPC7
SPLK #01h,TEMPC0

LDP #0
SPLK #0000000000000010b,IMR
CLRC INTM

WAIT:
NOP
NOP
B WAIT

GISR2:
NOP
LDP #PIVR>>7h
LACL PIVR
XOR #002Ah
BCND SISR2A,EQ ;T1 OVERFLOW
LACL PIVR
XOR #0029h
BCND SISR29,EQ ;T1 UNDERFLOW
LACL PIVR
XOR #0028h
BCND SISR28,EQ ;T1 COMPARE
LACL PIVR
XOR #0027h
BCND SISR27,EQ ;T1 PERIOD
RET

SISR2A:
LDP #TEMP
LACL #1h
XOR TEMP
BCND LOOP1,EQ
CLRC XF
SPLK #1h,TEMP
B LOOP2
LOOP1:
SETC XF
SPLK #0h,TEMP
LOOP2:
CALL DELAY
LDP #GPTCONA>>7
LACC #0400h
SACL EVAIFRA
CLRC INTM
RET

SISR29:
LDP #TEMPA3
LACL #1h
XOR TEMPA3
BCND LOOP3,EQ
LDP #0E1h
SPLK #0FF08h,PADATDIR
LDP #TEMPA3
SPLK #1h,TEMPA3
B LOOP4
LOOP3:
LDP #0E1h
SPLK #0FF00h,PADATDIR
LDP #TEMPA3
SPLK #0h,TEMPA3
LOOP4:
CALL DELAY
LDP #GPTCONA>>7
LACC #0200h
SACL EVAIFRA
CLRC INTM
RET

SISR28:
LDP #TEMPC7
LACL #1h
XOR TEMPC7
BCND LOOP5,EQ
LDP #0E1h
SPLK #0FF80h,PCDATDIR
LDP #TEMPC7
SPLK #1h,TEMPC7
B LOOP6
LOOP5:
LDP #0E1h
SPLK #0FF00h,PCDATDIR
LDP #TEMPC7
SPLK #0h,TEMPC7
LOOP6:
CALL DELAY
LDP #GPTCONA>>7
LACC #0100h
SACL EVAIFRA
CLRC INTM
RET

SISR27:
LDP #TEMPC0
LACL #1h
XOR TEMPC0
BCND LOOP7,EQ
LDP #0E1h
SPLK #0FF01h,PCDATDIR
LDP #TEMPC0
SPLK #1h,TEMPC0
B LOOP8
LOOP7:
LDP #0E1h
SPLK #0FF00h,PCDATDIR
LDP #TEMPC0
SPLK #0h,TEMPC0
LOOP8:
CALL DELAY
LDP #GPTCONA>>7
LACC #0080h
SACL EVAIFRA
CLRC INTM
RET

DELAY:
LAR AR0,#1h
D_LOOP:
RPT #01h
NOP
BANZ D_LOOP
RET

GISR1:
RET

GISR3:
RET

GISR4:
RET

GISR5:
RET

GISR6:
RET

PHANTOM:
RET

.end
CMD文件如下:
MEMORY
{
PAGE 0:
VECS origin = 0000h, length = 0040h
FLASH: origin = 100h, length = 7F00h
SARAM_P: origin = 8100h, length = 1000h

PAGE 1:
B2: origin = 0060h, length = 020h
B0: origin = 200h, length = 100h
B1: origin = 300h, length = 100h
SARAM_D: origin = 0C00h, length = 400h
}

SECTIONS
{
vectors: > VECS PAGE 0
.text: > FLASH PAGE 0
.data: > FLASH PAGE 0
.bss: > B2 PAGE 1
stack: > B1 PAGE 1
buffer: > SARAM_D PAGE 1
}
有何问题?敬请高手指点。我用的是2407A

请教好心人呐!快点指点一下吧,好心急啊

你的vector.h是怎么样的?

vector.h如下:
.sect \"vectors\"

RSVECT B _c_int0
INT1 B GISR1
INT2 B GISR2
INT3 B GISR3
INT4 B GISR4
INT5 B GISR5
INT6 B GISR6
RESERVED B PHANTOM
SW_INT8 B PHANTOM
SW_INT9 B PHANTOM
SW_INT10 B PHANTOM
SW_INT11 B PHANTOM
SW_INT12 B PHANTOM
SW_INT13 B PHANTOM
SW_INT14 B PHANTOM
SW_INT15 B PHANTOM
SW_INT16 B PHANTOM
TRAP B PHANTOM
NMI B NMI
EMU_TRAP B PHANTOM
SW_INT20 B PHANTOM
SW_INT21 B PHANTOM
SW_INT22 B PHANTOM
SW_INT23 B PHANTOM
SW_INT24 B PHANTOM
SW_INT25 B PHANTOM
SW_INT26 B PHANTOM
SW_INT27 B PHANTOM
SW_INT28 B PHANTOM
SW_INT29 B PHANTOM
SW_INT30 B PHANTOM
SW_INT31 B PHANTOM

有错吗?请多多指教

看不出错来,我没招了.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top