Shop OBEX P1 Docs P2 Docs Learn Events
storing data on the EEPROM — Parallax Forums

storing data on the EEPROM

xsmokerxsmoker Posts: 9
edited 2009-01-22 16:48 in Propeller 1
Is it possible to record/read just a few bytes to the eeprom so my code can have a starting point on powerup? Has this been discussed?

Thanks,

X

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-22 05:44
    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).
  • xsmokerxsmoker Posts: 9
    edited 2009-01-22 12:25
    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.



    X
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2009-01-22 15:12
    Can the propeller use the 1025k bit (128k byte) version of this eeprom? (24lc1025)
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-22 15:27
    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.
  • PavelPavel Posts: 43
    edited 2009-01-22 16:48
    Make sure you tie A2 on 24LC1025 high (as instructed by the datasheet). I use 24LC1025 with Propeller all the time.
  • 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,
  • Best to ask only on one thread and best not to post to a very old thread that has been long since answered. Forum etiquette.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    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.
Sign In or Register to comment.