Shop OBEX P1 Docs P2 Docs Learn Events
Help! How do you address Word size data to Byte size to store in EEPROM? — Parallax Forums

Help! How do you address Word size data to Byte size to store in EEPROM?

Nerd_in_trainingNerd_in_training Posts: 4
edited 2007-04-19 17:07 in Learn with BlocklyProp
We are using the basic stamp and need more storage space for data than is onboard.·· However we need to store our data in word size.· We are using the Xicor X25640 EEPROM that stores data only in Byte size.· How do we store Word Size data in Byte size EEPROM?· Thank you for your much needed Help!!

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-04-19 15:33
    Nerd -

    You will need to store TWO bytes for every word you want to save. They will be in the form of:

    var_name.highbyte and var_name.lowbyte

    Each is 1/2 of the word in a byte sized chunk. To retieve it you just reverse the process.

    Regards,

    Bruce Bates
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-19 17:07
    Hello,

    You can also use the Word formatter to specify a word size variable, but if you’re using an index variable as an offset for multiple writes be sure to increase it by 2 after each write. Here are some examples of using WRITE.
      WRITE 0, 100                          ' single byte
      WRITE 1, Word 1250                    ' single word
      WRITE 3, 45, 90, Word 725             ' multi-value write
    
    

    Notice that the third item is writing at address 3 instead of 2 since the previous write was a word value (2 bytes).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.