0

I am using MPLABX and C8 compiler for the PIC 16f690 microcontroller.

From reading C8 datasheet, it seems that the eeprom_write/read functions are included in the xc.h header. However, MPLAB does not recognize the functions (unable to resolve identifier eeprom_write/read), and it will not compile. Are there other initializations required to use eeprom?

The variables I am trying to store are both unsigned chars that are smaller than 1 byte. Out of context, this is how they are being formatted ("final" being a previously declared char):

eeprom_write(0x00, final);

int x = (int) eeprom_read(0x00);
  • my guess is that you need to add the libraries to the project – kenny Aug 06 '14 at 02:35
  • Thanks for the response. According to the C8 compiler datasheet, those functions are included in the xc.h header file, which I also have included in my project. – user3893595 Aug 06 '14 at 02:40
  • That's not necessarily sufficient to link in the code that implements the function. – Ross Ridge Aug 06 '14 at 03:46
  • Does these warnings appear at build or just in the editor ? I was able to reproduce these warnings in the editor of mplab by starting mplab on a 64bit java (and ubuntu). If i start it on a 32bit java, these "editor warnings" are removed...I guess it is a little bug in 64 bit mode ! After installation of java 32bit, a little script to start mplab : `JAVA_HOME=/..../jre1.7.0_65 PATH=/..../jre1.7.0_65/bin:$PATH /usr/bin/mplab_ide` More : http://elco.crsndoo.com/wordpress/2011/03/how-to-make-mplab-x-work-properly-on-64bit-linux/ – francis Aug 07 '14 at 22:21
  • 1
    @francis - Yes the build would fail. However, I was able to resolve the issue. I was calling eeprom_read () OUTSIDE of the main function because I wanted to assign its value to a global variable. If I initiated the variable globally, but waited until INSIDE main () to call eeprom_read () and assign it to the variable, it compiled successfully. – user3893595 Aug 08 '14 at 22:53

0 Answers0