完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我在一个奇怪的行为纺纱事实上几天,但几乎耗尽了我所有的调试想法…我正在一孔矩阵原板,但我熟悉电子,我已经建立了很多奇迹之前没有问题。这是经过多次检查的,芯片也被替换了,看起来很好。在这种情况下,我的FW开始了,但是奇怪的行为开始了。基本上,FW的实际功能很简单:1)运行一个time0来生成20MHz晶体的MIISEC计数器。2)做一个通道自动重复广告转换器。离子与Cp2+TMR3特殊事件自动触发循环。中断从该通道获取结果,检查AD最小值/最大值等。两个int型都以高优先级运行。主代码将结果写入2x16行LCD,并且大约1000毫秒停止转换循环,改变AD信道,从其他信道中进行一些转换,而不置CHANN。NEL到原版,然后重新启动循环……在我面对广告完全冻结之前的几天,“0”的比特根本不会达到“0”。8 -(基本上这就是为什么我改变了我的代码到CCP2+TMR3 AutoLoP,以避免从while((go)&;(i--));(最后)追踪到广告错误:广告的内部RC在睡眠模式之外冻结。世界跆拳道联盟????18F562不是一个年轻的芯片,但勘误表没有这个,我已经发现了关于谷歌上的广告SIMAE的独立勘误表…好的,我把广告从内线设置到OSC/32,建议到20MHz。广告再次冻结。(可以,设置为Tax到max,OSC/64)。TMR3的后缩放器也达到最大值。现在没有更多的冻结广告,但是!它开始悬挂核心的随机位置。首先,我在我的代码中被踢了SWDT,没有运气,仍然是随机的。我把WDT焊接到了配置字中,但是令人惊讶的是仍然可以停止代码执行或突然重置!世界跆拳道联盟?- OI已经实现了许多跟踪解决方案,包括BOR检查@ 4.5V,启动状态检查POR,BOR,栈下/溢出,MCLR,以及所有计数器,这是有效的,因为有时WDT触发,MCLR计数器增加,如果我拉MCR向下,所以它是好的。现在我有OBS4个不同的结束状态:1)完全冻结,WDT忽略。(如果我拉MCLR,清洁POR报告!世界跆拳道联盟???)2)WDT或堆栈溢出触发,WDT/STO在LCD上报告。3)LCD显示垃圾,或挂起,但心跳仍在继续。(我拉着MCLR向下报告!在连续VDD上,没有BOR,没有MCLR报告!!!!)4)RAM变量淹没了0x2020的大部分时间,比几分钟后1或2或3发生。最奇怪的是,如果我评论ADCONBITS.ON=1;行,系统变得超级稳定!-哦,WTF????如果我让广告模块在循环中自由运行,但不接触结果,仍然会得到同样的问题。如果我禁用CCP2-TMR3 AD AutoLoop,以避免广告中断,带有通道开关的主代码仍然会影响系统,但稍后……有人知道去哪里调查或如何去做。解决问题?谢谢,
以上来自于百度翻译 以下为原文 Hi, I am spinning on one really strange behavior for days actually but almost run out all of my debug ideas... I am working on one hole-matrix proto-board, but i am familiar with electronics, i have build a lot of wonder things before without a problem. :) This is checked many times, chip replaced as well, looks good. In this case i am on the quite beginning of my fw, but strange behavior starts. Basically the fw's actual function is simple: 1) runs a timer0 to generate ~milisec counter out of the 20MHz crystal. 2) do one channel auto-repeat AD conversion with CCP2+TMR3 special event auto-trigger loop. interrupt fetches the result from this channel, checks for AD min/max, etc.... Both ints runs on high priority. The main code writes the results to the 2x16 line LCD, and about 1000 msec stops the conversion loop, changes the AD channel, do some conversions from other channels, than set back the channel to the original, and restarts the loop... Some days before i have faced that the AD FREEZES completely, the _done_ bit won't go to 0 at all ! 8-( (Basically this is why i changed my code to CCP2+TMR3 autoloop, to avoid glitches from the While((GO)&&(i--)); .) Finally tracked down to the AD bug: internal RC of the AD freezes outside of SLEEP mode. WTF??? The 18F452 not a young chip, but the ERRATA don't have this, i have found on independent ERRATA about AD simewhere on google... OK, i have set the AD from intRC to the OSC/32 which is recommended to the 20MHz. The AD freezes again. :( OK, set to Tad to the MAX, OSC/64. the TMR3's postscaler to the max too. Now there is no more freeze of the AD, BUT! It starts to hung up the core random places. :( First i was kicked up the SWDT in my code, no luck, still random hangs. OK, i have welded the WDT into the config word, but surprisingly still can STOP the code execution or sudden reset! WTF? :-O I have implemented a lot of tracking solutions, including BOR checking @ 4.5V, startup status check for POR, BOR, Stack under/overrun, MCLR, and all with counters, which is works, because sometimes the WDT triggered, the MCLR counter increases, if i pull the MCLR down, so it is OK. Now i have observed 4 different ending status: 1) freeze completely, WDT ignored. (If i pull MCLR, clean POR reported ! WTF???) 2) WDT or stack overflow triggered, WDT/Sto reported on LCD. 3) LCD show garbage, or hang up, but the heartbeat led still goes. (i pull the MCLR down -> POR reported! On continous VDD, no BOR, no MCLR reported !!!) 4) RAM variables flooded with 0x2020 most of the times, than some minute later 1 or 2 or 3 happens. The most strange thing is, if i comment out the ADCONbits.ON = 1; lines, the system gets hyper-stable! :-o WTF???? If i let the AD module free running in the loop, but not touching the result, still gets the same issue. If i disable the CCP2-TMR3 AD autoloop, to avoid AD interrupts, the main code with channel switches still screws up the system, but later... Somebody have any idea where to investigate or how to workaround? Thanks, |
|
相关推荐
1个回答
|
|
就我所见,这看起来像是硬件错误。对我来说,它看起来像在芯片内部。VDD源于电池+5V稳压器,4个电容器,所以它是清晰稳定的。它是一个显影板,没有任何连接,它可以从12V电池的瞬变中自由运行,没有螺线管,没有尖峰,没有。没什么特别的。如果我只修改了我的代码ADON=1—& & Adon=0,代码就稳定了10个多小时。如果我打开广告状态,在第一个0-10分钟内存被损坏,和/或冻结了核心,甚至WDT在配置字上。广告结果在测试中被忽略,INS。TEAD我用(Unt)MSEC计数器从0到FFFF测试AD的结果,用AD HWAutoOP中断测试,没有中断。它不重要。只有AD打开(工作),我的代码崩溃。如果我用一个ADON位禁用AD,问题就消失了。我不敢相信18。F45有完全无用的AD模块用于大规模数字化……除了购买另一个MCU之外,还有人有其他想法吗?
以上来自于百度翻译 以下为原文 As far as i see, this looks like hardware error. For me it looks like inside the chip. VDD sourced from battery + 5V regulator, + 4 capacitor, so it is clear and stable. It is a development protoboard, nothing is connected, it runs freely from the 12V battery No transients, no solenoids, no spikes, no nothing unusual. If i modify only ONE BIT in my code ADON = 1 -> ADON = 0, the code is stable for more than 10 hours. If i turn the AD ON state, on the first 0-10 minutes the memory is corrupted, and/or freezed up the core even WDT is ON in the config word. The AD result is ignored in the test, instead i used the (uint) msec counter from 0 to FFFF to test my code as AD result. Tested with AD hw autoloop interrupt, and without interrupt. It doesint matter. Only if the AD is ON (and working) my code is crashed. If i disable the AD with the one ADON bit, the problem disappear. I can't believe the 18F452 have completely useless AD module for mass digitalizing..... Somebody have any idea other than buy another MCU? |
|
|
|
只有小组成员才能发言,加入小组>>
5248 浏览 9 评论
2037 浏览 8 评论
1957 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2265 浏览 5 评论
788浏览 1评论
680浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
608浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
582浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-28 12:18 , Processed in 1.172033 second(s), Total 46, Slave 40 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号