-1

I am following this tutorial which shows you how to write to data to Internal EEPROM. The only thing that is different in this tut is that they are using p18f4520 and I am using PIC18F87J11. When I try to build the code I get the following errors, may I know why?

113:Error [1105] symbol 'EEADR' has not been defined
113:Error [1101] lvalue required
114:Error [1105] symbol 'EEDATA' has not been defined
114:Error [1101] lvalue required
116:Error [1205] unknown member 'EEPGD' in '__tag_222'
116:Error [1131] type mismatch in assignment
117:Error [1205] unknown member 'CFGS' in '__tag_222'
117:Error [1131] type mismatch in assignment
131:Error [1205] unknown member 'EEIF' in '__tag_215'
131:Error [1128] compatible scalar operands required for comparison
133:Error [1118] scalar type expected in 'while' statement
137:Error [1205] unknown member 'EEIF' in '__tag_215'
137:Error [1131] type mismatch in assignment
144:Error [1105] symbol 'EEADR' has not been defined
144:Error [1101] lvalue required
145:Error [1205] unknown member 'EEPGD' in '__tag_222'
145:Error [1131] type mismatch in assignment
146:Error [1205] unknown member 'CFGS' in '__tag_222'
146:Error [1131] type mismatch in assignment
147:Error [1205] unknown member 'RD' in '__tag_222'
147:Error [1131] type mismatch in assignment
148:Error [1105] symbol 'EEDATA' has not been defined
Ammar
  • 1,203
  • 5
  • 27
  • 64
  • It seems like you are not using the same toolchain that the example came from, as you seem to be missing some macro definitions. – jxh May 21 '13 at 20:21
  • So the toolchain different for every device? and what's the fix? – Ammar May 21 '13 at 20:46
  • If I had a fix for you, I would have posted one. Sorry. – jxh May 21 '13 at 20:53
  • Which header file are you using for your PIC18F87J11? It seems like some of the symbol defined in `p184520.h` are not defined in the header file you are using for your PIC18F87J11. You should compare the two headers and see what is missing. – Étienne May 21 '13 at 21:14
  • I am just following the tut but I removed the header file they included since I am using different device. I removed this **#include **, so which one do I use for my device? – Ammar May 21 '13 at 21:51

1 Answers1

2

Sorry, but there is no internal EEPROM in PIC18F87J11 MCPU! Your example is intended for MCPUs with internal EEPROM.

GJ.
  • 10,810
  • 2
  • 45
  • 62
  • But using the **DEE Emulation 8-bit v1.1.2** works fine on my device. I downloaded this project from Microchip and it worked fine. Here is [link](http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en538000) – Ammar May 21 '13 at 21:54
  • 1
    @Ammar: sure emulation works fine because is made for all FIC18 family, but your micro do not have an EEPROM memory at all. Choose another one MCPU with EEPROM! Check the datasheet first! – GJ. May 21 '13 at 22:02
  • So what are my other options with the current device? Just write to flash memory? – Ammar May 21 '13 at 22:50
  • @Ammar: Yes The Flash cells for program memory are rated to last up to 10,000 erase/write cycles. Data retention without refresh is conservatively estimated to be greater than 20 years. The Flash program memory is readable and writable during normal program operation. – GJ. May 22 '13 at 05:50
  • May I ask if you have or know any tut out there that walk you through this process? I know the DEE Emulation should work fine, but it is conflicting with something in my project. And I must write to flash memory some other way, but I can't find a good tutorial in C. – Ammar May 22 '13 at 13:32
  • @Ammar: Check the PIC18F87J11 datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/39778e.pdf section 7 FLASH PROGRAM MEMORY. There are rutines read, write, erase FLASH single line and explanation how it works. – GJ. May 22 '13 at 13:43
  • I know they do explain it in the datasheet but just in assembly and I am using C compiler. I didn't find those examples helpful, I wish they had a C version. – Ammar May 22 '13 at 14:33
  • @Ammar: This exsamples works fine so just translate it to c. The PIC mnemonic is easy ot learn. If you will experience any problems open new qusetion on SO. – GJ. May 22 '13 at 14:53
  • I opened up one [here](http://stackoverflow.com/questions/16696535/translate-assembly-to-c-writing-to-memory-with-pic18) – Ammar May 22 '13 at 18:57