Shop OBEX P1 Docs P2 Docs Learn Events
puzzling over using boot epprom — Parallax Forums

puzzling over using boot epprom

SawmillerSawmiller Posts: 276
edited 2006-06-07 17:36 in Propeller 1
hi all,
i was just wondering if there is a simple way to write some variables to the boot epprom, for storage purposes... and then be able to access them reliably on next boot up....
for example
using a varible name for a memory location... write 2 longs to the boot epprom
then on next boot since the whole epprom is loaded into props memory, you variables are right there with the latest and greatest values...
i think it should work.. just at work right now so i cant try it.
dan
confused.gif·

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-06-07 14:59
    Yes you just need to figure out the correct address in the EEPROM to write it to. Fortunately its pretty simple, the address in the propeller is the same as in the EEPROM. Just use I2C routines already released in this forum to write to it. Now; variables in the propeller are initalized to 0, if you look at the memory map in the Propeller Tool you'll see this (its the yellow block). If I were doing this I would actually·use a constant, since it is expected to have a value when loaded from EEPROM, and make copious notes in the code explaining what is going on and how its value may/will change each time the propeller is booted.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life is one giant teacup ride.

    Post Edited (Paul Baker) : 6/7/2006 3:02:29 PM GMT
  • SawmillerSawmiller Posts: 276
    edited 2006-06-07 17:30
    using a constant, good idea...

    hmm the address would be· @constant, to the ic2 routine...

    thanks

    dan
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-06-07 17:36
    Im nearly certain, you can check the compiled memory map in the Tool by filling it with something easily identifiable (say $12345678) noting it's address and comparing it with the value obtained by @constant.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life is one giant teacup ride.
Sign In or Register to comment.