完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我使用PICIT 3与PIC18F47 K40-44 PIN TQFP。我已经定义了我的变量,如给定的BeloWudAtAsAppNo0RE 1TMP1 RES 1RXYDATAY长度RES 1SLaveEX地址RES 1:等等……有大约50个变量如上文所示。当我调试代码时,我发现了TEMP1(即RAM)的值。位置0x01)随机改变为0xFC。这与我是否在代码中使用Tun1或不使用任何地方无关。我无法理解为什么会发生这种情况?而且,我看到当我读写任何端口寄存器时都会发生这种情况。如果我在任何其他指令上设置断点而不是读/写任何端口寄存器,我运行代码,当MCU停止时,我看不到“Tun1”值的任何变化。现在,我一步一步地到达一个我正在读/写任何端口寄存器的指令。一旦执行涉及端口寄存器的指令,我就看到“Tun1”(即0x01 RAM位置)的值变为0xFC。例如,MOVFF PORTB,WREGI尝试定义在代码中不使用的附加变量,如BeloWudAtAcAtPun2020 RES 1TEMP21RES 1TEMP22 RES 1TEMP23 RES 1TEMPO RES 1TEMP1 RES 1IN,如果我执行代码,我看到Tave21-即RAM位置0x01的值被更改为0xFC。任何涉及端口寄存器(BCF,BSF,MOVF,MOVFF)的指令都被执行。为什么PACIT 3改变RAM 0x01的值?有什么想法吗?
以上来自于百度翻译 以下为原文 I am using PICKit 3 with PIC18F47K40 - 44pin TQFP. I have defined my variables as given belowudata_acstemp0 res 1temp1 res 1rx_data_length res 1slave_address res 1:and so on...There are about 50 variables defined as shown above.When I am debugging the code, I am finding that value of temp1 (i.e. RAM location 0x01) is changed to 0xFC randomly. This is irrespective of whether I am using temp1 in the code or not used anywhere. I am unable to understand why should this happen? Also, I have seen that this happens when I am reading/writing any Port register. If I set breakpoint at any other instruction other than reading/writing any Port register and I run the code, when the MCU halts, I don't see any change in 'temp1' value. Now, I single-step till I reach an instruction where I am reading/writing any Port register. As soon as the instruction involving the port register is executed, I see that value of 'temp1' (i.e. 0x01 RAM location) becomes 0xFC. For example, MOVFF PORTB,WREG I tried defining additional variables which I am not using in the code as shown belowudata_acstemp20 res 1temp21 res 1temp22 res 1temp23 res 1temp0 res 1temp1 res 1 Now, if I execute the code, I see that value of temp21 i.e. again RAM location 0x01 is changed to 0xFC the moment any instruction that involves Port register (BCF, BSF, MOVF, MOVFF) is executed. Why is PICKit 3 changing value of RAM 0x01? Any thoughts? |
|
相关推荐
1个回答
|
|
|
你能提供代码来帮助我们重现这个问题吗?此外,您使用的是什么版本的MPLAX?
以上来自于百度翻译 以下为原文 Can you provide code to help us reproduce this issue? Also, what version of MPLAB X are you using? |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
490 浏览 0 评论
5806 浏览 9 评论
2346 浏览 8 评论
2234 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3541 浏览 3 评论
1146浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1115浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
883浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
490浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-9 22:10 , Processed in 0.617895 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
7927