expWord格式文档下载.docx
- 文档编号:22396437
- 上传时间:2023-02-03
- 格式:DOCX
- 页数:49
- 大小:30.69KB
expWord格式文档下载.docx
《expWord格式文档下载.docx》由会员分享,可在线阅读,更多相关《expWord格式文档下载.docx(49页珍藏版)》请在冰豆网上搜索。
STM#a,AR3
STM#x,AR4
RPTZA,#3
MAC*AR3+,*AR4+,A
;
ld#1,dp
stm#y,AR2
stlA,*AR2
STLA,@y
RET
.end
乘累加实验.cmd
MEMORY/*TMS320C54xmicroprocessormodememorymap*/
{
PAGE0:
PROG:
origin=0x2400,length=0x1b80
/*5b80codeindebugmodesetlength=5b80,elseset1b80*/
VECTORS:
origin=0x3F80,length=0x80
/*7f80interruptvectortableintdebugmode,elseset3f80*/
PAGE1:
DARAM:
origin=0x0080,length=0x1f80/*databuffer,8064words*/
STACK:
origin=0x2000,length=0x400/*stack,1024words*/
}
SECTIONS
/*Cdefinition*/
.text:
load=PROGpage0/*executablecode*/
.cinit:
load=PROGpage0/*tablesforinitializingvariablesandconstants*/
.switch:
load=PROGpage0/*tablesforswitchstatement*/
.const:
load=PROGpage0/*datadefinedasCqualifierconst常数表*/
.data:
load=PROGpage0/*.datfiles*/
.bss:
load=DARAMpage1/*globalandstaticvariables*/
.stack:
load=STACKpage1/*Csystemstack*/
.coeff:
load=DARAMpage1/*.hfile*/
/*ASMdefinition*/
.vectors:
>
VECTORSpage0/*interruptvectortable*/
.daram_buffers:
DARAMpage1/*globaldatabuffers*/
.control_variables:
DARAMpage1/*globaldatavariables*/
P205带中断的乘累加
*MAINT2.asmy=a1*x1+a2*x2+a3*x3+a4*x4*
MAINT2.asm"
.def_c_int02
STM#STACK+10h,SP
RSBXINTM
STM#0004h,IMR
_c_int02:
NEGA
RETE
P214C程序
Sin_am.c
#include<
stdio.h>
math.h>
#defineTURE1
inty[500],i;
floatM;
voidmain()
puts("
Amplitudemodulationsinewaveexamplestarted.\n"
);
M=50;
for(i=0;
i<
500;
i++)
{y[i]=0;
while(TURE)
{
for(i=0;
{
y[i]=(int)((1+M/100*sin(i*2*3.14159*20/4000))*sin(i*2*3.14159*200/4000)*16384);
}
puts("
programend"
}
Sin_am_v.asm
.title"
sin_am_v.asm"
.sect"
.vectors"
.ref_c_int00;
Centrypoint
RESET:
;
resetvector
B_c_int00;
branchtoCentrypoint
.end
Sin_am.cmd
-stack256
-heap256
MEMORY
PAGE0:
EPROG:
origin=0x1400,len=0x7c00
VECT:
origin=0xff80,len=0x80
PAGE1:
origin=0x60,len=0x1c
IDATA:
origin=0x80,len=0x3000
.vectors:
VECTPAGE0
EPROGPAGE0
.cinit:
.bss:
IDATAPAGE1
.const:
.switch:
.sysmem:
.stack:
.cio:
Vary_M.gel
menuitem"
MyFunctions"
slidervary_M(0,100,10,1,Amount_of_modulation)
M=Amount_of_moulation;
闪灯程序(XF)
;
*文件名称:
EXP01.ASM
*--------------------------------------------------
--------------------伪指令-------------------------
.mmregs;
54X存储器影射寄存器定义
.global_main;
声明_main为全局符号
SWWCR.set0x002B;
设置"
SWWCR"
寄存器的地址
---------------------------------------------------
******************主函数*******************
_main:
nop
-----------------------------------------------------
----------------------初始化CPU---------------------
ssbxINTM;
INTM=1,禁止所有可屏蔽中断
ld#0,DP;
设置数据页指针DP=0
stm#0,CLKMD;
切换CPU内部PLL到分频模式
-------------------------------------------------------------------
CLKMDDEFINITIONS:
PLLMUL(bit15-12)-0000PLLmultiplier=0(multby1)
PLLDIV(bit11)-0PLLdivider=0(divby1)
PLLCOUNT(bit10-3)-11111111PLLcountersettomax
PLLONOFF(bit2)-1PLLon
PLLNDIV(bit1)-1SelectPLLmode
PLLSTATUS(bit1)-xPLLStatus(readonly)
------------------
0000011111111111=0x07ffCLKMD=1XCLKIN
--------------------------------------------------------------------
Statu1:
ldmCLKMD,A
and#01b,A
bcStatu1,ANEQ;
检查是否已经切换到分频模式?
stm#0x07ff,CLKMD;
设置DSP时钟10MHZ
--------------------------------------------------------------------
stm#0x3FF2,PMST
PMSTDEFINITIONS
IPTR(bit15-7)-001111111Run-timeInterruptvectorlocation=0x3f80(fornow)
MP/~MC(bit6)-1TurnoffinternalInstructionROM(useRAM)
OVLY(bit5)-1TurnoninternalRAM
AVIS(bit4)-1Addressvisibilityon
DROM(bit3)-0DataROMofFF00~FFFFisexternal
CLKOFF(bit2)-0Clockoutenabled,onlyforuseclkout=cpuclock
SMUL(bit1)-1SaturatebeforemultiplyonMAC
SST(bit0)-0Donotsaturatebeforestore
-----------------
0011111111110010=0x3ff2
*---------------------------------------------------------------------*/
stm#0x7FFF,SWWSR
---------------------------------------------------------------------
SWWSRDEFINITIONS
XPA(bit15)-0Extendedprogramaddresscontrolbit.XPAisusedinconjunctionwiththeprogramspacefields
(bits0through5)toselecttheaddressrangeforprogramspacewaitstates
I/O(bits14-12)-111settomaxwaitstatesforseven
Data1(bits11-9)-111SevenWaitstateforUpperdataspace(0x8000-0xFFFF)
Data2(bits8-6)-111SevenWaitstatesforLowerdataspace(0x0000-0x7FFF)
Prog1(bits5-3)-111SevenWaitstateforUpperprogramspace.(xx8000-xxFFFF)
Prog2(bits2-0)-111SevenWaitstatesforProgramspace.(xx0000-xx7FFF)
1111111111111111-0x7fff
*--------------------------------------------------------------------*/
stm#0x0001,SWWCR
--------------------------------------------------------------------
SWCRDEFINITIONS
Reserved(bits15-1)
SWSM(bit0)-1wait-statebasevaluesaremulitpliedby2
foramaximumof14waitstates.
--------------------------
0000000000000001
stm#0xF800,BSCR
BSCRDEFINITIONS
BNKCMP(bit15-12)-1111Bankcompare.Determinestheexternalmemory-banksize.BNKCMPisusedtomaskthefourMSBsof
anaddress.
11114k
11108k
110016k
100032k
000064k
PS-DS(bit11)-1Oneextracycleisinsertedbetweenconsecutivedataandprogramreads.
Reserved(bits10-3)-00000000
HBH(bit2)-0Thehpibusholderisdisabled
BH(bit1)-0Thedatabusholderisdisabled
EXIO(bit0)-0Theexternalbusinterfacefunctionsasusual
------------------------------------
1111100000000000
stm#0x0000,IMR;
禁止所有可屏蔽中断
IMRDEFINITIONS
Writinga1toanyIMRbitpositionenablesthecorrespondinginterrupt(whenINTM=0)
Reserved(bits15-14)-xx
DMAC5(bit13)-0DMAchannel5interruptmaskbit
DMAC4(bit12)-0DMAchannel4interruptmaskbit
BXINT1/DMAC3(bit11)-0McBSP1transmitinterruptmaskbit,ortheDMAchannel3
BRINT1/DMAC2(bit10)-0McBSP1receiveinterruptmaskbit,ortheDMAchannel2
HPINT(bit9)-0Hostto’54xinterrup/mask
INT3(bit8)-0Externalinterrupt3mask
TINT1/DMAC1(bit7)-0timer1interruptmaskbit,ortheDMAchannel1interruptmaskbit
DMAC0(bit6)-0reserved,ortheDMAchannel0interruptmaskbit
BXINT0(bit5)-0McBSP0transmitinterruptmaskbit
BRINT0(bit4)-0McBSP0receiveinterruptmaskbit
TINT0(bit3)-0Timer0interruptmaskbit
INT2(bit2)-0Externalinterrupt2maskbit
INT1(bit1)-0Externalinterrupt1maskbit
INT0(bit0)-0Externalinterrupt0maskbit
------------------------------
0000000000000000
stm#0xFFFF,IFR;
清除中断标志
IFRDEFINITIONS
Writinga1toanyIFRbitpositionclearthecorrespondinginterruptmask,whencorrespondinginterruptoccurIFRcorrespondingbit=1
DMAC5(bit13)-1DMAchannel5interruptflagbit
DMAC4(bit12)-1DMAchannel4interruptflagbit
BXINT1/DMAC3(bit11)-1McBSP1transmitinterruptflagbit,ortheDMAchannel3
BRINT1/DMAC2(bit10)-1McBSP1receiveinterruptflagbit,ortheDMAchannel2
HPINT(bit9)-1Hostto’54xinterrutpflak
INT3(bit8)-1Externalinterrupt3flag
TINT1/DMAC1(bit7)-1timer1interruptflagbit,ortheDMAchannel1interruptmaskbit
DMAC0(bit6)-1reserved,ortheDMAchannel0interruptflagbit
BXINT0(bit5)-1McBSP0transmitinterruptflagbit
BRINT0(bit4)-1McBSP0receiveinterruptflagbit
TINT0(bit3)-1Timer0interruptflagbit
INT2(bit2)-1Externalinterrupt2flagbit
INT1(bit1)-1Externalinterrupt1flagbit
INT0(bit0)-1Externalinterrupt0flagbit
1111111111111111
stm#0x2000,SP;
设置堆栈指针SP=2000,栈底
*--------------------------------------------------------------*/
--------------C
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- exp