完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
大家好,我在MPLAB X 4.10和ICD4下面临PIC16F18326的问题。我已经配置了PIC并开始调试,但是注意到奇怪的行为。在变量(或观察者)窗口中,堆栈值有异常值,这是我还没有遇到的。我已经阅读了论坛并尝试了许多DIF。另一个奇怪的事情是,当我“步进”程序进入“IF”语句时,这些语句不应该执行,“AF”循环只执行1次迭代而不是声明。我有配置调试位和低电压编程。我尝试过高电压编程,但没有……我有一种感觉,是因为ICD4,用模拟器尝试,猜猜它在工作和显示变量。有没有其他人遇到过同样的问题?顺便说一下,优化也不完善。谢谢。巴拉兹
以上来自于百度翻译 以下为原文 Hello everyone, I'm facing a problem with PIC16F18326 under MPLAB X 4.10 and ICD4. I've configured the PIC and started debugging, but noticed strange behavior. In the variable(or watcher) window the stack values have abnormal values, this I haven't encountered yet. I've read the forum and tried many different stuff, but nothing helps. Another strange thing is when I "step" the program in enters "if" statements which shouldn't execute and "for" loops do only 1 iteration instead of declared. I have the configuration #DEBUG bit ON and Low Voltage Programming. I've tried with High Voltage programming but nothing... I had a feeling it's because of ICD4 and tried with Simulator and guess what it was working and showing variables correctly. Has anyone else experienced same issue? By the way optimization is also disabled. Thanks. Balazs |
|
相关推荐
11个回答
|
|
|
不要将调试配置选项设置为任何东西——当选择调试/发布构建时,将其完全保留到IDE。不确定其他问题,不确定其他配置设置,以及显示问题的一些源代码(例如)“IF”语句。苏珊
以上来自于百度翻译 以下为原文 Don't ever set the DEBUG config option to anything - leave that entirely to the IDE when you select the debug/release build. Not sure about your other problems without seeing the other config settings and some source code that shows the problem with (say) the 'if' statement. Susan |
|
|
|
|
|
当奇怪的事情发生时,我关闭MPLABX并重新启动…
以上来自于百度翻译 以下为原文 When strange things happens, I close MPLABX and restart... |
|
|
|
|
|
你好,苏珊,我将粘贴我的配置位。附上3张图片,我会解释。在“Test1.PNG”上,程序已经停止在即将执行的返回中,但是它不应该。在变量屏幕中它的值是不正确的,它应该是7,而Y定义也是7。然后我按“步进”,然后退出函数,但是转到下一行,你可以在“Test2.pNG”上看到。接下来是“执行”循环,它执行1次输入,都是“IF”语句,然后执行SPI1x ExCHAGE…()函数,您在“Test3.PNG”上看到,但是如果仔细观察,索引变量仍然是0。因此,我觉得这是一个烂摊子。顺便说一下,我发现无论我放断点,它都会去那里,即使它不应该执行。程序计数器跳到那里…所以完全搞乱了…如果我使用模拟器,它运行良好。接下来的几天,我会尝试一个皮克特3,看到它的执行,如果它是真正的和ICD4的问题。谢谢,Balazs。
以上来自于百度翻译 以下为原文 Hello Susan, I will paste my Config Bits. // CONFIG1 #pragma config FEXTOSC = OFF // FEXTOSC External Oscillator mode Selection bits->Oscillator not enabled #pragma config RSTOSC = HFINT1 // Power-up default value for COSC bits->HFINTOSC (1MHz) #pragma config CLKOUTEN = OFF // Clock Out Enable bit->CLKOUT function is disabled; I/O or oscillator function on OSC2 #pragma config CSWEN = ON // Clock Switch Enable bit->Writing to NOSC and NDIV is allowed #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable->Fail-Safe Clock Monitor is enabled // CONFIG2 #pragma config MCLRE = ON // Master Clear Enable bit->MCLR/VPP pin function is MCLR; Weak pull-up enabled #pragma config PWRTE = OFF // Power-up Timer Enable bit->PWRT disabled #pragma config WDTE = OFF // Watchdog Timer Enable bits->WDT disabled; SWDTEN is ignored #pragma config LPBOREN = OFF // Low-power BOR enable bit->ULPBOR disabled #pragma config BOREN = OFF // Brown-out Reset Enable bits->Brown-out Reset enabled, SBOREN bit ignored #pragma config BORV = LOW // Brown-out Reset Voltage selection bit->Brown-out voltage (Vbor) set to 2.45V #pragma config PPS1WAY = ON // PPSLOCK bit One-Way Set Enable bit->The PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable bit->Stack Overflow or Underflow will cause a Reset #pragma config DEBUG = ON // Debugger enable bit->Background debugger enabled // CONFIG3 #pragma config WRT = OFF // User NVM self-write protection bits->Write protection off #pragma config LVP = ON // Low Voltage Programming Enable bit->Low Voltage programming enabled. MCLR/VPP pin function is MCLR. MCLRE configuration bit is ignored. // CONFIG4 #pragma config CP = OFF // User NVM Program Memory Code Protection bit->User NVM code protection disabled #pragma config CPD = OFF Attached 3 images and I will explain. On "test1.png" the program has been stopped at return which is about to execute, but it shouldn't. In the variable screen it's value is incorrect, it should be 7 and the #DEFINE is 7 also. Then I press "step into" and should exit the funciton, but instead goes to the next row, which you can see on "test2.png". Next comes the "for" cycle, which executes 1 time entering, both "if" statements and goes to execute SPI1_Exchage...() function, which you see on "test3.png", but if you watch closely the index variable is still 0. So this works like a mess. And by the way I figured out that anywhere I put a breakpoint it will go there, even if it shouldn't execute. The program counter jumps there... So it's totally messed up... If I use the Simulator it works well. The next days I will try to try out a PICKit3 and see you it performs, if it's truly and ICD4 issue or not. Thank you, Balazs Attached Image(s) |
|
|
|
|
|
我最初的评论是关于设置调试配置设置-它仍然存在,不应该是。至于为什么调试器显然坐错了线,当编译器*认为它正在处理一个语句时,我已经看到了这一点(就像您的IF)语句和“返回”一样。下一行的“那么”条款。试着在一个单独的块中做“返回”(即用花边环绕)。我不是说这是应该发生的,但这是我在其他地方看到的。有时你也会看到相反的情况(比如说)一个有很多'''和''和''',或者'''或'''以上的行被执行的条件,每一个“步骤”都会把光标跳转到另一个有条件的行,最后才知道下一步该怎么做。
以上来自于百度翻译 以下为原文 My original comment was about you setting the DEBUG config setting - it is still there and should not be. As for why the debugger is apparently sitting on the wrong line, I've seen this when the compiler *thinks* it is dealing with a single statement (as with your 'if' statement and the 'return' in the 'then' clause on the next line). Try making the 'return' in a separate block (i.e. surround with curly braces). I'm not saying that this is what should happen but it is what I have seen happen elsewhere. Also you sometimes see the opposite when (say) a conditional with lots of 'and's and 'or's over several lines is being executed and each 'step' has the cursor jump to a different line of the conditional before finally working out what to do next. Susan |
|
|
|
|
|
您好,我已经把调试设置为OFF了,但结果相同。最后,我把ICD4转换成了一个PICTIT3,所有的东西都开始正常工作。(变量显示正确的值,断点停止并输入正确的语句。)结论是ICD4没有准备好调试。NGPIC16F18326 OrPIC16F18336器件!问候,Balazs
以上来自于百度翻译 以下为原文 Hello, I've did the set the DEBUG to OFF, but same results. At the end I've switched the ICD4 to a PICKit3 and everything started work normally, as it should.(Variables show the right values, breakpoint halts and entering the correct statements.) So the conclusion is that ICD4 is not ready for debugging PIC16F18326 or PIC16F18346 devices! Regards, Balazs |
|
|
|
|
|
我记得在其他地方读过,默认情况下,ICD4试图运行的ICSP接口比PK3快得多,如果你的连接不足以支持更快的信号,它可能会失败。我认为应该有个地方告诉ICD4运行界面慢一些。
以上来自于百度翻译 以下为原文 I recall reading somewhere else that by default the ICD4 tries to run the ICSP interface much faster than the PK3, and it can fail if your conection isn't good enough to support the faster signals. I think there's meant to be an option somewhere to tell the ICD4 to run the interface slower. |
|
|
|
|
|
是的,在程序选项中确实有一个设置,您可以选择低、正常或高速编程。我试着把它设置到Low,但得到了同样的结果。我甚至试图禁用IPSP的下拉,但它甚至不编程目标设备。
以上来自于百度翻译 以下为原文 Yes, indeed there is a setting in the program option, where you can select low, normal or high speed programming. I've tried setting it to Low, but got the same result. I even tried to disable pull-down's for ICSP but then it doesn't even program the target device. |
|
|
|
|
|
第三次我会说,不要把那个配置变量设置成任何东西。完全从代码中删除它。IDE将自动为您设置(当您选择发布或调试生成)时,当您以任意方式设置时,可以干扰IDE所做的。苏珊
以上来自于百度翻译 以下为原文 I'll say it for the 3rd time - do not set that config variable to anything. Remove it completely from your code. The IDE will automatically set that for you (when you select release or debug builds) and when you set it either way, you can interfere with what the IDE does. Susan |
|
|
|
|
|
苏珊,我尝试删除一部分配置比特。我只留下了振荡器设置,因为这些是必要的。结果是相同的,所以我可以肯定地说,这是一个ICD4问题。
以上来自于百度翻译 以下为原文 Susan, I did try out removing a part of the config bits. I left the oscillator settings only, because those are necessary. The result is the same, so I can definitely say it's an ICD4 issue. |
|
|
|
|
|
D. Balazs,谢谢你提出来。它已经固定了4.15,应该在网上。请试试,让我们知道。关于,霍华德。
以上来自于百度翻译 以下为原文 D. Balazs, Thanks for bringing this up. It has been fixed for 4.15, that should be on the web. Please try it and let us know. Regards, Howard |
|
|
|
|
|
你好,霍华德,事实上,它已经被修复,测试,现在工作正常。谢谢你的支持。问候,Balazs。
以上来自于百度翻译 以下为原文 Hello Howard, Indeed it has been fixed, tested and it works correctly now. Thank you for the support. Regards, Balazs |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501 浏览 0 评论
5808 浏览 9 评论
2350 浏览 8 评论
2237 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3543 浏览 3 评论
1155浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1119浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
887浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 05:41 , Processed in 0.681086 second(s), Total 61, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1976