完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我的数据表(PIC24F)指出,为了成功地完成操作,必须连续两次写到DSGPR0。该页有一个程序集示例,但当我在代码中运行内联程序集时,这就是结果。我认为“mov.w0,w0”行把我搞得一团糟,但我不知道如何摆脱它(这个语句存在似乎有点浪费,不是吗?)我确信我遗漏了一些基本的东西,但是我没有打算成为在线组装的主人。我遗漏了什么吗?C是怎么做的?谢谢!编辑:我摆脱了扩展的内联程序集,它看起来是固定的(见下文),但是即使这个代码也不能成功地写入DSGPR1。有没有我丢失的解锁?
以上来自于百度翻译 以下为原文 My datasheet (PIC24F) states that one must write to DSGPR0 twice in a row in order to successfully complete the operation. The page has an assembly example, but when I run inline-assembly in my code, this is the result. I think the "mov.w w0, w0" line is messing me up, but I don't know how to get rid of it (seems a bit wasteful for that statement to exist any, no?) asm volatile("MOV.w w0, %0" : "=a" (DSGPR1)); 63f6: 00 00 78 mov.w w0, w0 63f8: a0 08 88 mov.w w0, 0x114 asm volatile("MOV.w w0, %0" : "=a" (DSGPR1)); 63fa: 00 00 78 mov.w w0, w0 63fc: a0 08 88 mov.w w0, 0x114 I am sure that I am missing something basic, but I have no plans to be a master at inline assembly. Is there something that I am missing? How do I do this in C? Thanks! EDIT: I got rid of the extended inline assembly, and it looked fixed (seen below), but even this code does not successfully write to the DSGPR1. Is there an unlock that I am missing? asm volatile("MOV.w w0, _DSGPR1"); 2c86: a0 08 88 mov.w w0, 0x114 asm volatile("MOV.w w0, _DSGPR1"); 2c88: a0 08 88 mov.w w0, 0x114 |
|
相关推荐
3个回答
|
|
在PIC24FJ64 GA202中,它看起来PIC似乎有不同的要求…顺便问一下,你的PIC是什么?
以上来自于百度翻译 以下为原文 in PIC24FJ64GA202, it says every PIC seems have different requirements...by the way, what's your PIC? |
|
|
|
PIC24FJ64 GA204谢谢!我猜当你认为你有RTFM…你应该RTFM…再一次。
以上来自于百度翻译 以下为原文 PIC24fj64ga204 Thanks! I guess when you think you've rtfm... you should rtfm... again. |
|
|
|
我使用的是PIC24FJ128GC010。虽然它不在我的手册中,但是必须使用CW4的DSSWEN位来使用这些寄存器。当该位被设置为“深度睡眠操作由DSEN位启用并控制”时。我想应该很清楚DSWEN必须设置为寄存器DSGPR0和DSGPR1是深度休眠模式的特征。
以上来自于百度翻译 以下为原文 I'm using PIC24FJ128GC010. Although it isn't in my manual, the DSSWEN bit of CW4 must be set to use these registers. When this bit is set "Deep Sleep operation is enabled and controlled by the DSEN bit". I suppose it should be obvious that DSSWEN must be set as the registers DSGPR0 and DSGPR1 are features of deep sleep mode. |
|
|
|
只有小组成员才能发言,加入小组>>
5170 浏览 9 评论
2001 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3176 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
737浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
635浏览 0评论
531浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 21:59 , Processed in 1.442633 second(s), Total 82, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号