Deeper question - sorry - let me explain..

The external EEPROM is working.. I am storing and retrieving data. So yes, I know the lines are working, etc. I have pull-ups, etc.

However, I am trying to KEEP data alive even after power down, and this does not seem to be working 100%. Some survives, some does not!!

24LC512s - I am using two of them. The software can tell them apart, and know them as 'Chip1', and 'Chip2'. When I write data to the Chips, then retrieve it, I get valid data, even if I fill up both chips. It works fine at a gross level.

The issue is deeper than if the EEPROM is recording or not - it has to do with saving specific BYTES in EEPROM between power cycles..

My program writes logging data to the EEPROM in Page Mode. My data is 36 bytes long, so I actually read 3 times into an array of a size of 108 (which works on the 18F2525). That way each page has 108 of the 128 bytes used.

1. I ALSO want to store some variables that I need BETWEEN power cycles in EEPROM.
A. the last used memory location, so when I start up again I know where I ws.
B. the user selected 'baud rate' for download
C. the 'passthru flag' - tells the code if it should just record to memory only, or also send that data to the serial port.

SO - I write my LOGGING data in memory positions

128-64000 - in chip 1 -> saving address 0-127
0-64000 in chip 2

I WANT to use the first 'page' on chip one as a place to keep persistent variables. SO I write to the address range 0-127 for these variables.

The memory locations are defined as:

Symbol ADR_loc = 10 ' next usable address
Symbol CHP_loc = 12 ' the chip we are on
Symbol D_baud_loc = 14 ' the download baud value
Symbol pass_loc = 20 ' the flag for passthru
Symbol wpt_loc = 30 ' the flag for waypoints
Symbol W_baud_loc = 40 ' waypoint baud rate


Then, I collect data from the user or from the program, and I2CWRITE the data into the memory locations as per above. The PROBLEM seems to be that when I write for example a '1' into "pass_loc", when I I2CREAD that same memory location later DURING the same power cycle, it is fine - it reads back what I'd expect. The PROBLEM is that if I power cycle, the data gets smashed...

HOWEVER, the data I write in PAGE MODE appears to survive a power cycle....

Any ideas why?? Can you not save persistent data to EEPROM?