完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我已经用PIC18F26K80开始了一个新的项目,它是PIC18F66K80系列的一部分。使用XC8 V1.38最新版本的MPLAX。编译器不识别eeprom变量eeprom无符号char eeprom_chans[MAX_CHANS]的声明;它也不喜欢应该有用的功能能够访问eeprom内存.unsigned char EEPROM_READ(unsigned int badd);无效EEPROM_WRITE(unsigned int badd, unsigned char bdat);我已经追溯到pic18.h文件,以下部分//MACROS for EEPROM Access//EEPROM相关功能不再支持。如果可用//或MPLAB X MCC.#if_EEPROMSIZE>_0&&0&_&定义(_PLIB)(_PLIB)_NO PLIB_SUPPORT(Read_b_eep(Read_读取_b_eep)未签名的char Read_读取_未符号char Read_读取_b_eep)未签名char Read_Read_读取_b_eep_eep(未签名的int坏坏);_NO_PLIB_PLIB_SUPP_SUPPORN_SUPPORT(Busy_SUPPORT(Busy_BU_BBBBBBBBBBBBBBBBBBBBB_b_eep(无符号)#定义EEPROM_READ(addr)Read_读取(addr)读取_读取(addr)#定义EEPRO_Read_读取_读取(添加器(添加器(加器(addr)\#定义EEPROM_W符号,未签名的未签名的字符字符字符字符字符的字符b b b b b bdat);\#定义EEPROM_RE有符号的未签名的符号符号符号符号的字符b b b b bdat)符号符号符号,未符号符号符号符号符号符号符号的字符b b b bdat)\\28282828符号符号符号符号符号符号符号符号符号符号符号符号_READ(addr)0//仅添加f或者,代码可移植性#define eeprom_read(addr)0#define EEPROM_WRITE(addr,value)//Ad.,仅用于代码可移植性#define eeprom_write(addr,value)#endif我们不能包括_PLIB,因为它似乎在V1.38中被弃用了,并且EEPROM的大小可能在部分文件中没有定义。PLIB的安装和安装?或者…有更聪明的解决方案吗?谢谢你的任何建议。东北人
以上来自于百度翻译 以下为原文 Hi, I have started a new project using PIC18F26K80 which is part of the PIC18F66K80 family. Using XC8 V1.38 latest version of MPLABX. The compiler does not recognize the declaration of eeprom variables eeprom unsigned char eeprom_chans[MAX_CHANS]; It also does not like the functions that should be available to access eeprom memory. unsigned char EEPROM_READ(unsigned int badd); void EEPROM_WRITE(unsigned int badd, unsigned char bdat); I have traced back to the pic18.h file the following section // MACROS for EEPROM Access // EEPROM related functions no longer supported. Use the peripheral library implementation if available // or the MPLAB X MCC. #if _EEPROMSIZE > 0 && defined(_PLIB) _NO_PLIB_SUPPORT(Read_b_eep) unsigned char Read_b_eep(unsigned int badd); _NO_PLIB_SUPPORT(Busy_eep) void Busy_eep(void); _NO_PLIB_SUPPORT(Write_b_eep) void Write_b_eep(unsigned int badd, unsigned char bdat); #define EEPROM_READ(addr) Read_b_eep(addr) #define eeprom_read(addr) Read_b_eep(addr) #define EEPROM_WRITE(addr, value) (Busy_eep(), Write_b_eep(addr,value)) #define eeprom_write(addr, value) (Busy_eep(), Write_b_eep(addr,value)) #else #define EEPROM_READ(addr) 0 // Added only for code portability #define eeprom_read(addr) 0 #define EEPROM_WRITE(addr, value) // Added only for code portability #define eeprom_write(addr, value) #endif We cannot include __PLIB as it appears to have been deprecated in V1.38 and EEPROM size may not be defined in the part file. Should we locate an archive of plib and install it? or... is there a smarter solution? Thanks in advance for any suggestions. Northeastman |
|
相关推荐
3个回答
|
|
EEPROM限定符从未为PIC18工作过。而且不太可能很快得到支持——显然需要太多的不同的访问例程,未来应该是MCC。除了从头开始编写自己的EEPROM例程之外,最好的选择是安装传统的PLIB,测试所需的功能,然后移动在项目中为它们提供源文件,并禁用PLIB,这样您需要的例程就由您维护并在版本控制系统之下。
以上来自于百度翻译 以下为原文 The eeprom qualifier has never worked for PIC18. and is unlikely to be supported any time soon - apparently there are too many differing access routines needed and the future is supposed to be MCC. The best option short of writing your own EEPROM routines from scratch, is to install the legacy PLIB, test the functionality you need then move the source files for them into your project and disable PLIB, so that the routines you need are being maintained by you and are under your version control system. |
|
|
|
我的AyEnPosiLoad数据宏为我工作。
以上来自于百度翻译 以下为原文 the __EEPROM_DATA macro works for me. #include #include "constdef.h" #include "calibration.h" #include __EEPROM_DATA ( 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ); // 0-7 __EEPROM_DATA ( 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ); // 8-15 complements of 0-7 __EEPROM_DATA ( 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ); // 0-7 __EEPROM_DATA ( 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ); // 8-15 complements of 0-7 |
|
|
|
18F25K80Ay包含和“PIC18.H.G.;”包括“校准h”α包含;lt;xc.h & gt;γ-EEPROMYORD数据(0xFF,0xF00,0x00,0x00,0x00,0x00,0x00,0x00);//0- 7y- EEPROMPEX数据(0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);//8-15补充0-7这在PICE上起作用
以上来自于百度翻译 以下为原文 This works on the PIC18F25K80 #include #include "constdef.h" #include "calibration.h" #include __EEPROM_DATA ( 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ); // 0-7 __EEPROM_DATA ( 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ); // 8-15 complements of 0-7 |
|
|
|
只有小组成员才能发言,加入小组>>
5317 浏览 9 评论
2072 浏览 8 评论
1977 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3248 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2285 浏览 5 评论
830浏览 1评论
723浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
669浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
722浏览 0评论
618浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-31 11:22 , Processed in 0.897837 second(s), Total 48, Slave 43 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号