Shop OBEX P1 Docs P2 Docs Learn Events
Writing to the EEPROM for storage — Parallax Forums

Writing to the EEPROM for storage

Sniper KingSniper King Posts: 221
edited 2008-07-24 17:38 in Propeller 1
Can we write to the eeprom for data storage.· maybe I am missing something.· Coming from the Basic Stamp side, I could PUT and GET.· Is there something we have as propeller people?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



Michael King
Application Engineer
R&D
Digital Technology Group

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-24 17:05
    Yes, you can write to the EEPROM for data storage. The Propeller Tool overwrites the entire 32K, so you can't keep data there through a download. If you have more than 32K (like on a Protoboard or Hydra), everything beyond the first 32K is completely untouched by the Propeller Tool.

    There are several objects in the Propeller Object Exchange that provide routines to read / write EEPROM. The "i2cObject" is the most general set of routines for a variety of I2C devices. The "Basic I2C Driver" is mostly for use with EEPROMs.
  • Sniper KingSniper King Posts: 221
    edited 2008-07-24 17:32
    I have the Basic I2C Driver. Can you give me an example of how to write a LONG and then READ it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-24 17:38
    There's an example already included in the comments. Remember to include the routine to wait for the write to finish as shown.

    There are also ReadLong and WriteLong methods that call ReadPage and WritePage. You can also use those. Take a look at them, they're really simple interfaces to ReadPage and WritePage. Since pretty much any EEPROM will finish writing in about 5ms, you could just wait that long after an EEPROM write before you try to do anything else with the EEPROM.

    Post Edited (Mike Green) : 7/24/2008 5:45:42 PM GMT
Sign In or Register to comment.