-2

I am having a very hard time figuring out how I can use:

EEDATA = 0xFF, 0x00, 0xFF, 0x00, 0x01, 0x03 ; 

and turn that into C code. From what I can understand, it's a way of allocating memory in BASIC, but I really do not know. If anyone out there could help I would much appreciate it.

It was programmed using PROTON. I believe it's got to do with EEPROM used for PIC hardware.

4

1 回答 1

1

I am not really sure what you want to do. But I guess you want to preload your EEPROM with the XC8 compiler. Use the following code:

__EEPROM_DATA(0xFF, 0x00, 0xFF, 0x00, 0x01, 0x03, 0x00, 0x00);

Be sure to always use a block by 8 values.

To write and read the EEPROM you can easily use the library functions:

include xc.h


void eeprom_write(unsigned char addr, unsigned char value);
unsigned char eeprom_read(unsigned char addr);
于 2018-10-29T12:49:43.170 回答