完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
场景:具有4线LCD、DS1302 RTC、25LC1024 EEPROM、ADM48 8 RS422接口的控制盒全部连接到18F46J11。这个盒子已经完美地工作了好几年,在它的一生中已经有几次成功的固件升级。需要对代码进行非常微小的更改,重新编译源代码和使用PICtiT3的MPLABX IPE重新编程。死盒子!实际上,并不是完全死掉,但是EEPROM和RTC都失败了,串行例程仍然工作良好,正如它的LCD所显示的那样,它显示了它正确地发送和接收串行数据。我的第一个想法是恢复到我已经存档的以前版本。它根本没有改变症状。从逻辑分析仪上看,EEPROM和RTC的信号是非常错误的。从编译器中查看程序集列表,很容易看出BIT的例程是可以的,但是PIC上的实际引脚似乎没有遵循代码。波尔塔、PORTB和PORTC都是错误的,但奇怪的是,驱动LCD的PORTD上有正确的信号。我尝试改变PIC,但新的工作原理完全相同。我开始认为IPE程序有问题,以前我使用了PICTIT2,但不幸的是它不支持IPE V 5。它看起来像预期的那样运动,PIC验证为正确编程,但似乎有一个基本的失败,这么多的功能,它必须与配置有关。配置寄存器读回正确,但是我注意到在寄存器视图中从CONT1L中删除了调试位,我想知道它是否与其他位中的一个交换。类似于启用扩展指令集而不是禁用调试位会引起我看到的问题。有人对此有什么经验吗?布莱恩。
以上来自于百度翻译 以下为原文 Scenario: Control box with 4-line LCD, DS1302 RTC, 25LC1024 EEPROM, ADM488 RS422 interface all hooked to an 18F46J11. The box has been working flawlessly for several years and has has several successful firmware upgrades in it's lifetime. A very minor change to the code was needed, the source recompiled and MPLABX IPE with Pickit3 used to reprogram it. Dead box! Actually, not completely dead but the EEPROM and RTC both fail, the serial routines are still working fine as witnessed on it's LCD which shows it is sending and receiving serial data correctly. My first thought was to revert to the previous version which I have archived. It didn't change the symptoms at all. Looking on a logic analyzer, the signals to the EEPROM and RTC are quite wrong. Looking at the assembly listing from the compiler it is easy to see the bit-banged routines are OK but the actual pins on the PIC don't seem to be following the code. PORTA, PORTB and PORTC are wrong but curiously PORTD which drives the LCD has the correct signals on it. I tried changing the PIC but the new one works exactly the same. I'm beginning to think something is wrong with the IPE program, previously I used a Pickit2 but unfortunately it isn't supported in IPE v 5. It seems to go through the motions as expected and the PIC verifies as programmed correctly but something seems to be causing a fundamental failure to so many functions it has to be configuration related. The config registers read back correctly but I notice the DEBUG bit is missing from CONFIG1L in the register view, I'm wondering if it is swapped with one of the other bits. Something like enabling the extended instruction set instead of disabling the DEBUG bit would cause the kind of problem I see. Has anyone any experience of this? Brian. |
|
相关推荐
2个回答
|
|
我不确定MCLR pin是否对你的情况有任何影响,但是你能检查MCLR管脚上的电压是多少吗?据我所知,最大电压应该是3.5V。
以上来自于百度翻译 以下为原文 I'm not sure if the MCLR pin has any impact in your case, but can you check how much is the voltage on the MCLR pin? The max voltage should be 3.5V as far as I know. |
|
|
|
谢谢你,Vkalyan。我检查了所有的针脚电压,它们看起来很好,而且很干净。几乎所有的PIC所做的工作都是对输入串行数据的位操作、解码和在LCD上显示和发送串行回复。所有这些部分都工作在预测波特率下,所以时钟频率不是问题。LCD是PORTD上标准的4x20字符类型,它是唯一能正常工作的字符。我看到完全奇怪的信号,甚至像一个循环发送8个SPI时钟脉冲(在模拟中验证)只发送7和数据不排队的时钟。事实上,改变程序中的时间并不改变准备就绪和时钟脉冲启动之间的偏差。一个外部中断完全崩溃,并需要一个电源重新启动它,尽管监视器被启用。正如我所说,它已经工作了很长一段时间,唯一的变化源代码是一个数字在一个串行答复,所以任何时间都应该受到影响。甚至以前的工作代码现在也失败了。我在这件事上已经拖了两天了。这么多的事情一下子打破了软件错误,但众所周知的好代码也失败了。我试图启用调试工具,当我发现IpI1l中的调试位在IPE读取配置返回时丢失。这必须是微芯片文件中的一个bug,这很可能是原因。
以上来自于百度翻译 以下为原文 Thank you Vkalyan. I have checked all the pin voltages and they seem fine and 'clean'. Almost all the work done by the PIC is bit manipulation of incoming serial data, decoding it and displaying on the LCD and sending back serial replies. All that part works and at the predicted Baud rate so the clock frequency isn't the issue. The LCD is a standard 4x20 character type on PORTD which is the only one that works properly. I see completely strange signals, even things like a loop sending 8 SPI clock pulses (verified in simulation) only sending 7 and the data not lining up with the clock. In fact changing the timing in the program doesn't seem to alter the skew between data being ready and the clock pulse starting. An external interrupt crashes it completely and requires a power down to restart it, despite the watchdog being enabled. As I said, it has worked perfectly for a long time and the only change made to the source code was one digit in a serial reply so none of the timing should be affected. Even the previous working code now fails. I've been scratching my head for two days over this. So many things breaking at once suggests a software error but known good code also fails. i tried to enable the debug facility and that's when I discovered the DEBUG bit in CONFIG1L was missing when the IPE reads the configuration back. That has to be a bug in Microchips files and it could well be the cause. Brian. |
|
|
|
只有小组成员才能发言,加入小组>>
5195 浏览 9 评论
2013 浏览 8 评论
1937 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3185 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2240 浏览 5 评论
748浏览 1评论
635浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
520浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
646浏览 0评论
547浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-2 11:58 , Processed in 1.275071 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号