完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好!所以我决定把这个大的代码块变成一个子程序,我可以在需要的时候调用它,但是现在它不起作用了。最初,当我第一次编写代码时,它在我的启动代码中运行了一次,在0x2f开始。当我把它变成一个子程序时,我把它一直移到我的代码的起点,在0x7d开始。这个问题与这个代码中的一个表有关。表的代码基本上向PCL添加了偏移量,然后跳到RestLW某个值,但现在不这样做。在我的代码开始时,它跳到某个位置。我知道它在做什么和为什么,但是不知道如何补救。ADDWF PCL,F是指令0x11b,但是PCL显示0x1b。跳跃之后它在0x1c。这和PcLaTe有关系吗?我必须用PCL才能到达我需要的地方?我该怎么做?
以上来自于百度翻译 以下为原文 Hello everyone! So I decided to turn this large block of code I have into a subroutine that I can call whenever I need it, but now it's not working. Originally, when I first wrote the code, I had it run once in my Start code where it started at 0x2F. When I made it a subroutine I moved it all the way to the end of my code where is starts at 0x7D. The problem is related to a table I have in this code. The code for the table basically adds an offset to the PCL and then jumps to RETLW some value, but now it's not doing that. It's jumping to some position way back in the start of my code. I know what it's doing and why, but don't know how to remedy this. The ADDWF PCL, F is instruction 0x11B but the PCL is showing 0x1B. After the jump it's at 0x1C. This has to do with PCLATH right? I have to use it with PCL to get to where I need to be? How do I do that? |
|
相关推荐
6个回答
|
|
你为什么不提实际的PIC模型?
以上来自于百度翻译 以下为原文 Any reason you don't mention what actual PIC model you have? |
|
|
|
OP使用16F83:这里是HTTP://www. McCHIP.COM/FUMMS/FANDPOST/1024465,所以请看一下:HTTP://www. McCHIP.COM/FUMMS/FUNDSPAS/861818
以上来自于百度翻译 以下为原文 OP uses 16F883 here: http://www.microchip.com/forums/FindPost/1024465 So take a look to this: http://www.microchip.com/forums/FindPost/876718 |
|
|
|
对不起的。我使用的是PIC16F83。我检查了你连接的其他线程,我仍然有点无能。数据手册和技术手册并不能很好地解释这一点。我发现PIC16F83只有4K内存,而不是8K。我被告知它有8K。所以这个PIC只有两页。在我问更多问题之前,我需要一些睡眠。
以上来自于百度翻译 以下为原文 Sorry. I'm using a PIC16F883. I checked out that other thread you linked and Im still a bit clueless here. The data sheet and tech manual doesn't explain this all that well. I just found out that the PIC16F883 only has 4k memory, not 8k. I was told it had 8k. So the this PIC only has two pages. I need some sleep before I ask more questions. |
|
|
|
16F83有4K字闪光灯。因为一个字是14位,它几乎是8K字节。
以上来自于百度翻译 以下为原文 16f883 has 4K words flash. Since a word is 14bits, it's almost 8K bytes. From section 2.3.1 in the datasheet concerning ADDWF PCL, F |
|
|
|
|
|
|
|
好啊。谢谢。我想我知道我现在该做什么了。我真的必须考虑IM如何组织一切。
以上来自于百度翻译 以下为原文 Ok. Thanks. I think I know what I have to do now. I really have to think about how Im to organize everything. |
|
|
|
只有小组成员才能发言,加入小组>>
5158 浏览 9 评论
1997 浏览 8 评论
1926 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3169 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2222 浏览 5 评论
723浏览 1评论
606浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
494浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
620浏览 0评论
519浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 13:35 , Processed in 1.437860 second(s), Total 91, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号