完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好,我在PIC18F25K50中使用XC8 V1.38设置ID位置有问题。代码“#pragma config IDLOC0=0xFF”是编译器手动页的副本+粘贴,它导致警告消息“MyConfig.h:5:warning:(1388)带有0xFF的“IDLOC0”的配置设置/寄存器将被0xF截断。似乎有些奇怪的编译器认为值是4位而不是8位。当我查看十六进制输出时,实际上较高的4位是0,低位在那里。有什么建议,我做错了什么?这对我来说更像是一个编译器错误。谢谢,帕维尔,亲切的问候。
以上来自于百度翻译 以下为原文 Hello, I have problem setting ID Locations using XC8 v1.38 for the PIC18F25K50. The code "#pragma config IDLOC0 = 0xFF", which is a copy+paste from the manual page of the compiler, causes warning message "MyConfig.h:5: warning: (1388) configuration setting/register of "IDLOC0" with 0xFF will be truncated by 0xF". It seems that compiler for some strange reason thinks that the value is 4-bit instead of 8-bit. When I look into the hex output, indeed the higher 4 bits are 0, lower bits are there. Any suggestions what am I doing wrong? This more looks like a compiler bug to me. Thanks in advance, kind regards, Pavel |
|
相关推荐
9个回答
|
|
PIC18体系结构中的ID位置是8位宽,而不是4位。这看起来像编译器错误。修正18F25K50.CFGDATA文件不修复它。因此,提交一张支持票到Microchip。编辑& gt;见下文。&编辑/gt;
以上来自于百度翻译 以下为原文 The ID locations in the PIC18 architecture are 8-bits wide, not 4 bits. |
|
|
|
嗨,编译器将允许设备组推荐的任何内容,允许下半字节进行编程。就我所能记得的,情况就是这样。如果您确实想对额外的位进行编程并且您的设备支持它,那么您将需要编辑xxxx.cfgdata文件(dat目录)中的掩码值,例如:F:in:CWORD:200000:F:FF:IDLOC0可以更改为:FF:我用v1.38尝试过,并且禁止警告,并且编程了一个完整的字节。FF。
以上来自于百度翻译 以下为原文 Hi, The compiler will allow whatever is recommended by the device group, which is to allow the lower nibble to be programmed. This has been the case for as long as I can remember. If you do want to program additional bits and your device supports it, you will need to edit the mask value in the xxxx.cfgdata file (dat directory), e.g. the :F: in: CWORD:200000:F:FF:IDLOC0 could be changed to :FF: I tried this with v1.38 and the warning was suppressed and a full byte programmed. Jeff. |
|
|
|
我在发布以前的文章后尝试过了,但它没有用。我在v1.38中修改了.cfgdata文件,但是忘记将编译器驱动程序改回v1.38,因为我正在用v1.37测试其他东西。(编辑这个文件就行了!
以上来自于百度翻译 以下为原文 |
|
|
|
我想知道是否可以添加一个附加信息来通知用户这是一个选项?
以上来自于百度翻译 以下为原文 I wonder if an additional message can be added to inform the user that this is an option? |
|
|
|
根据闪存编程规范:5.1用户ID位置,用户可以在200000h:200007h映射的八个ID位置中存储标识信息(ID)。这样做,如果用户代码无意中从ID空间执行triesto,ID数据将执行NOP。如何从ID空间执行代码?PCLX和ToSX寄存器限于1FFFFFH。
以上来自于百度翻译 以下为原文 From the Flash Memory Programming Specification: 5.1 User ID Locations A user may store identification information (ID) in eight ID locations mapped in 200000h:200007h. It is recommended that the Most Significant nibble of each ID be Fh. In doing so, if the user code inadvertently tries to execute from the ID space, the ID data will execute as a NOP. How does one execute code from the ID space?? The PCLx and TOSx registers are limited to 1FFFFFh. |
|
|
|
当我查看十六进制输出时,实际上较高的4位是0,低比特在那里。建议每个ID中最重要的字节是FH。编译器似乎没有完全遵从建议。
以上来自于百度翻译 以下为原文 When I look into the hex output, indeed the higher 4 bits are 0, lower bits are there. It is recommended that the Most Significant nibble of each ID be Fh. It seems that the compiler is not following the recommendations fully. |
|
|
|
这个建议毫无意义。将ID数据限制为4位是没有意义的。
以上来自于百度翻译 以下为原文 That recommendation makes no sense. Limiting ID data to 4 bits makes no sense. |
|
|
|
|
|
|
|
杰夫,我做到了。事实上,我不在代码中使用IDoC——我直接找到它,擦除它,给它写,从它读。我可以读取“FF”后,我擦掉0x20 000…但是如果我把“12”写进去,我只会读“01”。我直接写在内存中(不使用IDOLC!)下面:0x200000=0x120x200001=0x340x200002=0x560x200003=0x780x200004=0x9A0x200005=0xBC0x200006=0xDE0x200007=0xEFI读回所有位置,并得到:0x010x020x030x030x050x060x08Lol...。真的。这告诉我它是4位或是摆动…这是在PIC18F26K80上。同样的行为也在PIC18F45 K80上。当然,这也意味着它只写8位,只读取4位。算一算。我认为这个内存区域值得,MCP提供了整个3000页的章节,而不是用1(是的,我数过了,1!)模棱两可的段落“哦,嘿,这个作品像Flash…看段落吧,玩得开心!”可惜,它不像闪光灯那样工作。
以上来自于百度翻译 以下为原文 Jeff, I did that. In fact, I don't use IDLOC's in my code-- I go right to the locate, erase it, write to it, read from it. I can read "FF" after I erase 0x200000... but if I write "12" into it, I only read back "01". I wrote directly to the memory (not using IDLOC!) the following: 0x200000 = 0x12 0x200001 = 0x34 0x200002 = 0x56 0x200003 = 0x78 0x200004 = 0x9A 0x200005 = 0xBC 0x200006 = 0xDE 0x200007 = 0xEF I read all locations back-- and got: 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 Lol.... wow. That tells me it's either 4-bits or wigged out... This is on a PIC18F26K80. Same behavior on the PIC18F45K80 as well. Of course this could also mean it's writing 8-bits but only reading 4-bits. Go figure. I think this area of memory deserves and entire 3,000 page chapter to itself from MCP instead of blowing it off with 1 (yes, I counted, 1!) ambiguously written paragraph "Oh, hey, this works like Flash... see section blah blah, have fun!" Well, it doesn't work like flash, sadly. |
|
|
|
只有小组成员才能发言,加入小组>>
5184 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3179 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2229 浏览 5 评论
739浏览 1评论
626浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
511浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 07:07 , Processed in 1.434744 second(s), Total 93, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号