dsp实验全部程序
更新时间:2023-03-15 12:09:01 阅读量: 教育文库 文档下载
实验1_常用指令实验
;File Name:exp01.asm
;the program is compiled at no autoinitialization mode .mmregs .global _main _main: stm #3000h,sp ssbx xf ;将XF置1 call delay ;调用延时子程序,延时 rsbx xf ;将XF置0 call delay ;调用延时子程序, b _main ;程序跳转到\ nop nop
;延时子程序 delay: stm 270fh,ar3 loop1: stm 0f9h,ar4 loop2: banz loop2,*ar4- banz loop1,*ar3- ret nop nop .end
实验2_数据存储
*File Name:exp02.asm
;get some knowledge of the cmd file
;the program is compiled at no autoinitialization mode .mmregs .global _main _main:
;store data stm 1000h,ar1 ;address of internal memory rpt #07h st 0bbbbh,*ar1+ ;将数据\存放到以地址1000H~1007H的八个存储单元中. ;read data then re-store stm 7h,ar3 stm 1000h,ar1 stm 1008h,ar2
loop: ;循环的将1000H~1007H的八个单元中的数据COPY到1008H~100F的 ;八个存储单元中. ld *ar1+,t
st t,*ar2+ banz loop,*ar3- .end
实验3_ IO实验
;File Name :exp03.asm
;learn how to operate the I/O ports ;get some knowledge of the rts.lib file ;in the I/O space 0x8000=>8 switches ; 0x8001=>8 LEDs .mmregs .global _main .text _main: stm 3100h,sp stm 1000h,ar1 portr 8000h,*ar1 ;读入I/O 8000H数据,将其存储到数据空间的1000H nop ;NOP为空操作,起延时作用. nop portw *ar1,8001h ;将数据空间的1000H单元的数据,写出到I/O 8000H nop nop b _main ;程序跳转到\执行. nop nop
.end
实验4_定时器实验
.mmregs .global _initial _initial: NOP LD #0, DP ; reset data pointer STM #0, CLKMD ; software setting of DSP clock STM #0, CLKMD ; (to divider mode before setting) TstStatu1:
LDM CLKMD, A
AND #01b, A ;poll STATUS bit BC TstStatu1, ANEQ STM #0xF7FF, CLKMD ; set C5402 DSP clock to 10MHz STM 0x3FA0, PMST ; vectors at 3F80h stm 300h,ar1 ;initial 300h data address st #00h,*ar1 ssbx 1,11 ;set ST1.INTM=1,stop all interrrupt stm 0ffffh,ifr ;clear all interrupt indicate
stm 00h,imr ;set imr=0,stop all interrrupt stm 410h,tcr ;stop timer stm 4e1fh,prd ;set prd=4e1fh stm 420h,tcr ;start timer stm 08h,imr ;allow timer interrupt rsbx 1,11 ;set ST1.INTM=0,start all interrrupt ret
实验5_INT中断实验 .mmregs .global _initial .text _initial: NOP LD #0, DP ; reset data pointer STM #0, CLKMD ; software setting of DSP clock STM #0, CLKMD ; (to divider mode before setting) TstStatu1:
LDM CLKMD, A
AND #01b, A ;poll STATUS bit BC TstStatu1, ANEQ STM #0xF7FF, CLKMD ; set C5402 DSP clock to 10MHz STM 0x3FA0, PMST ; vectors at 3F80h ssbx 1,11 ; set st1.intm=1 stop all interrupt stm #00h,imr ;stop all interrupt stm #0ffffh,ifr ;clear all interrupt sign stm #04h,imr ;allow int2 interrupt rsbx 1,11 ;allow all interrupt ret .end
实验6_AD转换实验 .global _InitC5402 .global _OpenMcBSP .global _CloseMcBSP .global _READAD50 .include MMRegs.h _InitC5402: NOP LD #0, DP ; reset data–page pointer STM #0, CLKMD ; software setting of DSP clock STM #0, CLKMD ; (to divider mode before setting) TstStatu1:
LDM CLKMD, A
AND #01b, A ;poll STATUS bit
BC TstStatu1, ANEQ STM #0xF7FF, CLKMD ; set C5402 DSP clock to 10MHz ******* Configure C5402 System Registers ******* STM #0x7fff, SWWSR ; 2 wait cycle for IO space & STM #0x0000,BSCR ; set wait states for bank switch: STM #0x1800,ST0 ; ST0 at default setting STM #0x2900,ST1 ; ST1 at default setting(note:INTM=1) STM #0x00A0,PMST ; MC mode & OVLY=1, vectors at 0080h ******* Set up Timer Control Registers ******* STM #0x0010, TCR ; stop on–chip timer0 STM #0x0010, TCR1 ; stop on–chip timer1 ******* Initialize McBSP1 Registers ******* STM SPCR1, McBSP1_SPSA ; register subaddr of SPCR1 STM #0000h, McBSP1_SPSD ; McBSP1 recv = left–justify STM SPCR2, McBSP1_SPSA ; register subaddr for SPCR2 ; XINT generated by frame sync STM #0000h, McBSP1_SPSD ; McBSP1 Tx = FREE(clock stops ; to run after SW breakpoint STM RCR1, McBSP1_SPSA ; register subaddr of RCR1 STM #0040h, McBSP1_SPSD ; recv frame1 Dlength = 16 bits STM RCR2, McBSP1_SPSA ; register subaddr of RCR2 STM #0040h, McBSP1_SPSD ; recv Phase = 1 ; ret frame2 Dlength = 16bits STM XCR1, McBSP1_SPSA ; register subaddr of XCR1 STM #0040h, McBSP1_SPSD ; set the same as recv STM XCR2, McBSP1_SPSA ; register subaddr of XCR2 STM #0040h, McBSP1_SPSD ; set the same as recv STM PCR, McBSP1_SPSA ; register subaddress of PCR STM #000eh, McBSP1_SPSD ; clk and frame from external (slave) ; FS at pulse–mode(00)
******* Finish DSP Initialization ******* STM #0x0000, IMR ; disable peripheral interrupts STM #0xFFFF, IFR ; clear the intrupts’ flags RET ; return to main NOP NOP
******* Waiting for McBSP0 RX Finished ******* IfRxRDY1: NOP STM SPCR1, McBSP1_SPSA ; enable McBSP1 Rx LDM McBSP1_SPSD, A AND #0002h, A ; mask RRDY bit BC IfRxRDY1, AEQ ; keep checking NOP NOP RET ; return NOP NOP
******* Waiting for McBSP0 TX Finished *******
IfTxRDY1: NOP STM SPCR2, McBSP1_SPSA ; enable McBSP1 Tx LDM McBSP1_SPSD, A AND #0002h, A ; mask TRDY bit BC IfTxRDY1, AEQ ; keep checking NOP NOP RET ; return NOP NOP
****************************************** ****************************************** _OpenMcBSP: stm 1000h,ar0 st 00,*ar0 portw *ar0,8001h ;reset AD50 XF=0 NOP call wait NOP NOP NOP STM SPCR1, McBSP1_SPSA ; enable McBSP1 RX for ADC data in LDM McBSP1_SPSD,A OR #0x0001, A STLM A, McBSP1_SPSD STM SPCR2, McBSP1_SPSA ; enable McBSP1 TX for DTMF out LDM McBSP1_SPSD,A OR #0x0001, A STLM A, McBSP1_SPSD LD #0h, DP ; load data page 0 rpt #23 NOP stm 1000h,ar0 st 0xff,*ar0 portw *ar0,8001h ;out reset aD50 XF=1 NOP NOP nop nop
CALL IfTxRDY1 ;initial ad50 register STM #0x0001, McBSP1_DXR1;request secondary communication NOP CALL IfTxRDY1 STM #0100h, McBSP1_DXR1;write 00h to register 1 15+1bit mode CALL IfTxRDY1 STM #0000h, McBSP1_DXR1
正在阅读:
dsp实验全部程序03-15
2015全国民事审判工作会议纪要07-06
2017年高考数学(第01期)小题精练系列专题24综合训练3理(含)讲义10-04
自考金融市场学重点06-13
PRO-E灵活操作小技巧100项04-07
煤矿防治煤与瓦斯突出综合防突设计01-11
创优结构方案01-29
文献检索实习题209-09
- exercise2
- 铅锌矿详查地质设计 - 图文
- 厨余垃圾、餐厨垃圾堆肥系统设计方案
- 陈明珠开题报告
- 化工原理精选例题
- 政府形象宣传册营销案例
- 小学一至三年级语文阅读专项练习题
- 2014.民诉 期末考试 复习题
- 巅峰智业 - 做好顶层设计对建设城市的重要意义
- (三起)冀教版三年级英语上册Unit4 Lesson24练习题及答案
- 2017年实心轮胎现状及发展趋势分析(目录)
- 基于GIS的农用地定级技术研究定稿
- 2017-2022年中国医疗保健市场调查与市场前景预测报告(目录) - 图文
- 作业
- OFDM技术仿真(MATLAB代码) - 图文
- Android工程师笔试题及答案
- 生命密码联合密码
- 空间地上权若干法律问题探究
- 江苏学业水平测试《机械基础》模拟试题
- 选课走班实施方案
- 实验
- 全部
- 程序
- dsp
- 海南大学物理C表面张力实验自测习题 - 图文
- C语言期中试卷
- 小学综合实践活动案例1
- 福建黄国才 群文阅读的突围
- 部编人教版2018-2019学年九年级语文上册期末课内古诗文专项复习(含答案)
- 2009年广州市优秀教师名单
- 大学物理第8章 稳恒磁场 课后习题及答案
- 湖南省岳阳县第一中学2014年物理奥赛教案 第六讲 物体的性质 物态变化
- 2013级临床基础化学模拟试题 仅供参考
- 2015报关水平测试基础部分:第二篇第五章练习题及答案
- 2019-2020学年度小学语文四年级下册15 鸟语苏教版复习特训二十七
- 动点问题,直角三角形斜边上的中线等于斜边的一半
- 辽宁省人民政府关于做好征地补偿安置工作切实维护农民合法权益的通知
- 《大学的理想》的读后感
- 元朝行省制度的内容
- 第3章整流电路习题详解
- 建筑设计方法概论
- 医学统计学+流行病学+卫生学试题及答案济
- 公租房运营管理主体公司化的思考(1)
- 应用型本科与研究型本科高职的区别