嗨,我已经用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 declara
tion 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
0