完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
只是为了分享我的经验来挽救别人浪费了我几个小时。使用MPLABX 3.60/XC8 1.40和所有构建模式中的相同问题。使用PIC10F320编写两个字符变量的快速和简单的程序。首先,我发现了α-DelayyMs和其他延迟宏给出了野生错误或挂起,直到WDT跳闸。错误与FoSC等不相关,所以我想我会编写自己的延迟循环。发现了简单的(和)..,而循环在硅中断裂,但在MPSIM工作。我以为我疯了!然后我在这个论坛上发现了一个旧的引用(HTTP://www. McCHIP.COM/FUMMS/M62770.ASPX),用于10F320的勘误表,纠正了一个不正确的SRAM映射……当然,就是这样!XC8把变量放在内存中,设备没有。当手动分配到实际位置时,所有的都是好的。失望的是看到这个bug 4年后,微芯片宣布了映射错误。但我也应该阅读勘误表!
以上来自于百度翻译 以下为原文 Just to share my experience to save someone else wasting the couple of hours I did. Using MPLABX 3.60 / XC8 1.40 and same problems in all build modes. Writing a quick and simple program for a PIC10F320 using just two char variables. First I found __delay_ms and other delay macros gave wild errors or hung until the WDT tripped. Errors were not correlated with FOSC etc. So I thought I'd write my own delay loops. And found simple for() and do..while loops were broken in silicon, but worked in MPSIM. I thought I was going crazy!! Then I discovered on this forum an old reference (http://www.microchip.com/forums/m623700.aspx) to an errata for the 10F320, correcting an incorrect SRAM map...and sure enough, that was it! XC8 was putting variables in memory that the device did not have. When manually assigned to real locations all came good. Disappointing to see this bug 4+ years after Microchip announced the mapping error. But I should also read the errata! |
|
相关推荐
6个回答
|
|
此外,微芯片的延迟功能被称为不清除看门狗:因此,您可以调用它们的块,以较低的间隔重置WDT…或者禁用WDT,或者从头开始编写自己的WDT。
以上来自于百度翻译 以下为原文 Also, Microchip's delay functions are known for not clearing the watchdog: so, you can either call them in chunks, resetting the WDT at lower intervals... or disable the WDT, or write your own from scratch. |
|
|
|
QHB -好点!他们在我的零件箱里踢了一段时间-买了2012,在第47周制造了2011。很可能是一个旧的修订版——我会把它一条鱼看出来。
以上来自于百度翻译 以下为原文 qhb - good point! They've been kicking about in my parts boxes for a while - bought in 2012 and manufactured in week 47 2011. So likely an old revision - I'll fish one out and see what it says. |
|
|
|
…或者调用清除例程WORKDO.JEF的延迟例程的O.DelayWdTh()和相关版本。
以上来自于百度翻译 以下为原文 ... or call the _delaywdt() and related versions of the delay routines that do clear the watchdog. Jeff. |
|
|
|
啊,是的,我记得你曾经指给我看那些!谢谢(不确定他们从哪个版本开始可用……)
以上来自于百度翻译 以下为原文 Ah yep, I remember you once pointed me to those! thanks (not sure since which version they become available...) |
|
|
|
在当前的情况下,我假设我失败的{ DelayaysMs()是因为宏在内存中设置了变量,这些变量实际上不存在于设备上。
以上来自于百度翻译 以下为原文 In the current case, I presume my failed __delay_ms() was because the macro was putting variables for looping in memory that didn't actually exist on the device. |
|
|
|
这是可能的,如果它是一个你正在使用的A1芯片,你可以通过编辑XC8文件夹中的Picc.In文件来修复它。
以上来自于百度翻译 以下为原文 That's possible if it is an A1 chip you're using. You may be able to fix it by editing the picc.ini file in your XC8 folder. C:Program Files (x86)Microchipxc8v1.40datpicc.ini Change to RAMBANK=60-7F |
|
|
|
只有小组成员才能发言,加入小组>>
4825 浏览 9 评论
1831 浏览 8 评论
1748 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
2955 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2060 浏览 5 评论
461浏览 1评论
1111浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
364浏览 0评论
263浏览 0评论
LAN9252使用SQI通信,进行数字复位后读BYTE_TEST异常
1799浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-25 04:58 , Processed in 1.046828 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号