完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用的是带有MCC 3.23.2的Bootloader生成器,用于PIC16LF18345。在“pic16f1_bootload.c”文件中,这些行://Register:NVMADRextern易失性uint16_t NVMADR@0x81A;//Register:NVMDATextern易失性uint16_t NVMDAT@0x81C;生成关于重新定义类型的编译错误。ADR@0x891;<--注意正确的地址。//Register:NVMDATextern易失性无符号短NVMDAT@0x893;<--注意正确的地址。除了错误的地址之外,它不喜欢使用uint16_t代替“无符号短”,因为PIC的头文件使用“无符号短”,uint16_t是“无符号短”。无符号int”。
以上来自于百度翻译 以下为原文 I am using the Bootloader Generator that comes with MCC 3.26.2 for a PIC16LF18345. In the "pic16f1_bootload.c" file these lines: // Register: NVMADR extern volatile uint16_t NVMADR @ 0x81A; // Register: NVMDAT extern volatile uint16_t NVMDAT @ 0x81C; generate a compile error about redefining the type. The lines need to be changed to: // Register: NVMADR extern volatile unsigned short NVMADR @ 0x891; <-- Note correct address. // Register: NVMDAT extern volatile unsigned short NVMDAT @ 0x893; <-- Note correct address. Aside from the incorrect address, it doesn't like using uint16_t instead of "unsigned short" since the PIC's header file uses "unsigned short" and uint16_t is an "unsigned int". |
|
相关推荐
8个回答
|
|
有趣的是,“unsigned.”和“unsigned in t”在XC8中都是无符号16位变量,但它不应该使用不同的名称。
以上来自于百度翻译 以下为原文 Interesting. "unsigned short" and "unsigned int" are both unsigned 16 bit variables in XC8, but it shouldn't be using different names. Maybe it's using the wrong stdint.h header. |
|
|
|
问题是,为什么要对它们进行定义,而不只是使用头文件。
以上来自于百度翻译 以下为原文 The Question is why is it defining them at all and not just using the header file. |
|
|
|
是的,我自己也在想同样的事情。正如你所说的,它应该使用设备头文件。如果您注释了这些行,则代码编译,因为它在PIC16LF18345 .h文件中找到这些符号。
以上来自于百度翻译 以下为原文 Yeah, I was kind of wondering the same thing myself. As you said, it should be using the device header file. If you comment out the lines, the code compiles, since it finds those symbols in the pic16lf18345.h file. |
|
|
|
我还认为下一个定义是错误的://这应该在设备.h文件中。外部变量Unt1616t NVMDATA0x81C;该符号不在设备头文件中。设备数据表中唯一提到的NVMDATA是在第11.4.3节,该节讨论如何写入EEPROM。在代码中,当计算编程闪存的校验和时,它被使用。毫无意义。看起来还有一个bug,我必须用这个生成的代码来修复。当然,PIC16LF18345的数据表上写着“初步”,所以它可能还没有为黄金时段做好准备。
以上来自于百度翻译 以下为原文 I also think the next #define is wrong: //this should be in the device .h file. extern volatile uint16_t NVMDATA @0x81C; That symbol is not in the device header file. The only mention of NVMDATA in the device datasheet is in section 11.4.3, which talks about writing to the EEPROM. In the code it's being used when calculating the checksum of the programmed flash. Makes no sense. Looks like another bug I have to fix with this generated code. Of course, the datasheet for the PIC16LF18345 says "Preliminary", so it might not be ready for prime-time. |
|
|
|
嗯,我认为NVMDATA是用来把两个寄存器NVMDATL和NVMDATH表示为单个的16位寄存器,但它们分别位于地址0x893和0x894。
以上来自于百度翻译 以下为原文 Hmmm, I think NVMDATA was meant to represent the two registers NVMDATL and NVMDATH as a single 16 bit register, however they are at addresses 0x893 and 0x894 respectively. There's nothing at 0x81C. |
|
|
|
谢谢。我也猜到了同样的事情。但是,#define NVMDATA,当上面只有一行NVMDAT的define时,是没有意义的。我知道这个Bootloader Generator是旧的8位Bootloader Generator的转换,它是一个独立的工具。然而,这似乎不是一个“走出去”的解决方案。首先,没有可用的PC应用程序。如果你尝试旧的独立工具的应用程序,这将无法工作。我发现这个发电机内置MCC的其他问题。它可以给你大约80%的路,但你还有工作要做。
以上来自于百度翻译 以下为原文 Thanks. I had surmised the same thing. However, it didn't make sense to #define NVMDATA, when there already was a #define for NVMDAT just one line above it. I know that this Bootloader Generator is a transfer of the older 8-bit Bootloader Generator that was a standalone tool. It seems, though, that it's not an "out of the box" solution. For one thing, there's no PC app available that will work with it. If you try the app from the old standalone tool it won't work with this one. I found other issues with this generator that's built into MCC. It can get you about 80% of the way, but you still have work to do. |
|
|
|
谢谢你的提醒。我们来看看。我同意,它应该在头文件中,但经常是不够的:
以上来自于百度翻译 以下为原文 Thanks for the heads up. We'll take a look at it. I concur, it should be in the header file, but frequently enough it's not :-( |
|
|
|
谢谢你的确认。我已经评论了这两行,代码运行良好。虽然还没有弄清楚使用NVMADT的目的,但是我并没有用这个引导加载程序。
以上来自于百度翻译 以下为原文 Thanks for the confirmation. I had commented out the two lines and the code runs fine. Still haven't figured out the purpose of the use of NVMDAT, though, but I haven't gotten that far with this bootloader. |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3214 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2261 浏览 5 评论
779浏览 1评论
673浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
599浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
683浏览 0评论
580浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 21:13 , Processed in 1.890428 second(s), Total 92, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号