It's been discussed many times. There are several objects in the Propeller Object Exchange that will do the I2C I/O to the EEPROM. The simplest to use is the Basic_I2C_Driver, but there are also easy-to-use routines in the BS2 Compatibility Library.
Basically, everything from the end of your program (as shown by the Propeller Tool memory map) to the end of the EEPROM is available. If you download a new program to the EEPROM, the first 32K (or the entire 32K) of the EEPROM will be erased, so keep that in mind. There are other fancier schemes, but I suggest that you use the last few bytes of the EEPROM if 32K or the first few bytes of the 2nd 32K if you have a 64K EEPROM (like on the Protoboard).
Thanks Mike I should have looked there first. I was thinking the very end of the EEPROM too. I thought the EEPROM would be erased when programmed but a simple test byte will help with that.
Fred, Absolutely. The Hydra has a 128K byte EEPROM as the on-board EEPROM and, when you plug in an expansion card, you have two of them. The newer AT24C1024B allows you to have 4 on a pair of I/O pins for a total of 512K bytes.
I want to use a 64k eeprom in a project, is there a way to write either the top or bottom half with spin ? I am pretty new to the propeller and spin code,
I have attached an archive which is an old program I posted before showing how to update an EEPROM location and read the value at startup. In this example when the code is downloaded a value is sent to the PST and then the value is updated and written back to the EEPROM location. Each time the reset button is pressed this happens, so what you see on the screen is a value that increments every press of the reset button.
While simplistic, it shows just how to store a value at program time that can be read and modified at run time so that it is updated each boot.
Comments
Basically, everything from the end of your program (as shown by the Propeller Tool memory map) to the end of the EEPROM is available. If you download a new program to the EEPROM, the first 32K (or the entire 32K) of the EEPROM will be erased, so keep that in mind. There are other fancier schemes, but I suggest that you use the last few bytes of the EEPROM if 32K or the first few bytes of the 2nd 32K if you have a 64K EEPROM (like on the Protoboard).
X
While simplistic, it shows just how to store a value at program time that can be read and modified at run time so that it is updated each boot.