在CCS5.5下连接DSP进行仿真调试时,将代码拷贝。代码如下
.ref _c_int00
.global copy_sections
.global _cinit_loadstart, _cinit_runstart, _cinit_size
.global _const_loadstart, _const_runstart, _const_size
.global _econst_loadstart, _econst_runstart, _econst_size
.global _pinit_loadstart, _pinit_runstart, _pinit_size
.global _switch_loadstart, _switch_runstart, _switch_size
.global _text_loadstart, _text_runstart, _text_size
***********************************************************************
* Function: copy_sections
*
* Description: Copies initialized sections from flash to ram
***********************************************************************
.sect "copysections"
copy_sections:
MOVL XAR5,#_const_size ; Store Section Size in XAR5
MOVL ACC,@XAR5 ; Move Section Size to ACC
MOVL XAR6,#_const_loadstart ; Store Load Starting Address in XAR6
MOVL XAR7,#_const_runstart ; Store Run Address in XAR7
LCR copy ; Branch to Copy
MOVL XAR5,#_econst_size ; Store Section Size in XAR5
MOVL ACC,@XAR5 ; Move Section Size to ACC
MOVL XAR6,#_econst_loadstart ; Store Load Starting Address in XAR6
MOVL XAR7,#_econst_runstart ; Store Run Address in XAR7
LCR copy ; Branch to Copy
MOVL XAR5,#_pinit_size ; Store Section Size in XAR5
MOVL ACC,@XAR5 ; Move Section Size to ACC
MOVL XAR6,#_pinit_loadstart ; Store Load Starting Address in XAR6
MOVL XAR7,#_pinit_runstart ; Store Run Address in XAR7
LCR copy ; Branch to Copy
MOVL XAR5,#_switch_size ; Store Section Size in XAR5
MOVL ACC,@XAR5 ; Move Section Size to ACC
MOVL XAR6,#_switch_loadstart ; Store Load Starting Address in XAR6
MOVL XAR7,#_switch_runstart ; Store Run Address in XAR7
LCR copy ; Branch to Copy
MOVL XAR5,#_text_size ; Store Section Size in XAR5
MOVL ACC,@XAR5 ; Move Section Size to ACC
MOVL XAR6,#_text_loadstart ; Store Load Starting Address in XAR6
MOVL XAR7,#_text_runstart ; Store Run Address in XAR7
LCR copy ; Branch to Copy
MOVL XAR5,#_cinit_size ; Store Section Size in XAR5
MOVL ACC,@XAR5 ; Move Section Size to ACC
MOVL XAR6,#_cinit_loadstart ; Store Load Starting Address in XAR6
MOVL XAR7,#_cinit_runstart ; Store Run Address in XAR7
LCR copy ; Branch to Copy
LB _c_int00 ; Branch to start of boot.asm in RTS library
copy: B return,EQ ; Return if ACC is Zero (No section to copy)
;// SUB ACC,#1
RPT AL ; Copy Section From Load Address to
|| PWRITE *XAR7, *XAR6++ ; Run Address
return:
LRETR ; Return
.end
DSP28xxx_CodeStartBranch.asm的代码如下:
***********************************************************************
WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0
.ref copy_sections
.global code_start
***********************************************************************
* Function: codestart section
*
* Description: Branch to code starting point
***********************************************************************
.sect "codestart"
code_start:
.if WD_DISABLE == 1
LB wd_disable ;Branch to watchdog disable code
.else
LB copy_sections ;Branch to copy_sections .endif
;end codestart section
***********************************************************************
* Function: wd_disable
*
* Description: Disables the watchdog timer
***********************************************************************
.if WD_DISABLE == 1
.sect "wddisable"
wd_disable:
SETC OBJMODE ;Set OBJMODE for 28x object code
EALLOW ;Enable EALLOW protected register access
MOVZ DP, #7029h>>6 ;Set data page for WDCR register
MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
EDIS ;Disable EALLOW protected register access
LB copy_sections ;Branch to copy_sections
.endif
;end wd_disable
.end
在仿真调试时代码可以运行,引脚有输出信号,断电重启不使用仿真调试时引脚无输出。XA12,13,14,15均接高电平。
为什么引脚没有输出呢?
user4192203:
回复 Eric Ma:
使用仿真器进行运行时,焊接的板子的PWM引脚上有输出。但是断开仿真器,断电重新运行之后相关引脚无输出。
程序在开发板上断电后可以运行。
TI中文支持网



