完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想用F2812的gpio口模拟一个通信信号,对频率一致性要求很严格,目前直接用C语言写的方式是:
GpioDataRegs.GPDDAT.all = period; period &= 0x62; asm("RPT #31 || NOP"); GpioDataRegs.GPDDAT.all = period; period |= 0x1; asm("RPT #31 || NOP"); 其中period 是一个unsigned int 的变量,用CCS查看了反汇编出来的汇编代码,发现编译器会随机在上下两条GPIO中插入数量不等汇编指令,造成最终输出的信号频率一致性比较差,有的长有的短,但是我又不懂DSP的汇编言语,求大神告诉我这四条指令: “ GpioDataRegs.GPDDAT.all = period; period &= 0x62; GpioDataRegs.GPDDAT.all = period; period |= 0x1;“ 用汇编怎么内嵌编写。 这里贴上ccs反汇编的代码: "AND AL, *+XAR4[1], #0xff" "MOV @0x2c, AH" "RPT #31 || NOP" "ANDB AH, #0x62" "MOV @0x2c, AH" "RPT #31 || NOP" "MOVW DP, #0xfe46" "AND AL, @0x27, #0xff00" "MOVW DP, #0x1c3" "OR AL, @AH" "MOV AH, @AL" "LSR AH, 8" "MOV @0x2c, AH" "RPT #31 || NOP" "ANDB AH, #0x62" "ORB AL, #0x1" "MOVB AL.MSB, @AH" "OR @AL, #0x0100" "MOV @0x2c, AH" "MOVW DP, #0xfe46" "MOV @0x27, AL" "RPT #31 || NOP" "MOVW DP, #0x1c3" "AND AH, *+XAR4[2], #0xff" "MOV @0x2c, AH" "RPT #31 || NOP" "ANDB AH, #0x62" "MOV @0x2c, AH" "RPT #31 || NOP" "MOVW DP, #0xfe46" "AND AL, @0x28, #0xff00" "MOVW DP, #0x1c3" "OR AL, @AH" "MOV AH, @AL" "LSR AH, 8" "MOV @0x2c, AH" "RPT #31 || NOP" "ANDB AH, #0x62" "ORB AL, #0x1" "MOVB AL.MSB, @AH" "OR @AL, #0x0100" "MOV @0x2c, AH" "MOVW DP, #0xfe46" "MOV @0x28, AL" "RPT #31 || NOP" "MOVW DP, #0x1c3" "AND AH, *+XAR4[3], #0xff" "MOV @0x2c, AH" "RPT #31 || NOP" "ANDB AH, #0x62" "MOV @0x2c, AH" "RPT #31 || NOP" "MOVW DP, #0xfe46" "AND AL, @0x29, #0xff00" "MOVW DP, #0x1c3" "OR AL, @AH" "MOV AH, @AL" "LSR AH, 8" "MOV @0x2c, AH" "RPT #31 || NOP" "ANDB AH, #0x62" "ORB AL, #0x1" "MOVB AL.MSB, @AH" "OR @AL, #0x0100" "MOV @0x2c, AH" "RPT #31 || NOP" |
|
相关推荐
4个回答
|
|
拿出C2000 的指令手册来,应该不难!
|
|
|
|
把你要模拟的信号描述出来
|
|
|
|
要模拟XY2-100信号,时钟频率2MHZ,就是不懂汇编语言,dsp都是才接触个把月 |
|
|
|
是模拟XY2-100信号,时钟频率2MHZ,我不懂汇编语言,dsp也才接触个把月 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于 DSP5509 进行数字图像处理中 Sobel 算子边缘检测的硬件连接电路图
3262 浏览 0 评论
796 浏览 0 评论
普中科技F28335开发板中,如何使用aic23播放由代码生成的正弦波
3695 浏览 0 评论
4454 浏览 1 评论
1376 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 15:52 , Processed in 0.578991 second(s), Total 49, Slave 42 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号