Shop OBEX P1 Docs P2 Docs Learn Events
Modifying data in the internal SX EEPROM — Parallax Forums

Modifying data in the internal SX EEPROM

tdoddstdodds Posts: 12
edited 2007-12-15 16:59 in General Discussion
I need to be able to occasionally modify a couple of·constants in the internal SX EEPROM without reloading software. The Basic Stamp has a WRITE command for this, and I have used it several times to modify operating data.

Is there a way to do this on the SX chip??

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-12-12 17:25
    No, the SX chips have no internal eeprom.

    regards peter
  • tdoddstdodds Posts: 12
    edited 2007-12-12 17:58
    OK, maybe I called it the wrong thing. There is 2k words of non-volatile program memory. I want to change a couple of values there.
  • JonnyMacJonnyMac Posts: 9,217
    edited 2007-12-12 18:29
    You cannot modify SX memory at run time -- you will need to add an external memory (e.g., I2C) if you need to have non-volatile values.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2007-12-12 18:54
    When you are using the WRITE command on the BASIC Stamp you are actually storing the values in the external EEPROM chip. That is also where the tokenized BASIC program goes that is run by the built-in Interpreter on the preprogrammed BASIC Stamp processor.

    If you want a small SX48 based module with external EEPROM you might be interested in a kit I made up for the SX48 a while back:

    http://forums.parallax.com/forums/default.aspx?f=7&m=194701

    It will fit easily on a breadboard and comes with an external EEPROM chip. They are handy little modules.

    Best Regards,

    Robert
  • ZootZoot Posts: 2,227
    edited 2007-12-12 21:31
    Somebody said...
    You cannot modify SX memory at run time -- you will need to add an external memory (e.g., I2C) if you need to have non-volatile values.

    The actual controller on the Stamp uses "flash" memory just like the SX -- and it can not be modified -- it's a different process altogether from writing values to EEPROMs. Part of what makes the Stamp so dang handy and elegantly cool is all the "conveniences" that you may take for granted -- read/writeable EEPROM, high-level commands, on-board voltage regulation, PC serial connection, etc.

    Basically if you take an SX, add a regulator, EEPROM, crystal, RS-232 level shifter, and 2k of what must be *highly* efficient assembly code that reads additional commands off the EEPROM and runs them -- you've just invented a Basic Stamp smile.gif. Robert's (RobotWorkshop) little module are kind of like that -- ready to go but without the Stamp interpreter.

    If you need non-volatile memory on your SX you have a few ways to go depending on your needs:

    - use I2C commands to access a traditional EEPROM if you need to read and/or write many values that don't change very often, and speed is not a huge issue. Dirt cheap.

    - use I2C or serial on a chip like the DS130x real time clocks -- they contain about 40 non-volatile RAM registers. The advantage here is speed of reading/writing to the registers and the bonus of a having a real time clock source. The disadvantage here is the need for a backup super-cap or battery for the device.

    - FRAM. Operates kind of like a traditional EEPROM but with much greater speed and without the write/read/rewrite life-expectancy problems of EEPROMs. Not as cheap, though, I don't think.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • tdoddstdodds Posts: 12
    edited 2007-12-13 03:58
    Thanks all of you for the enlightenment.

    I will look into adding an external EEPROM on my next product. Unfortunately the current design is too far along so my customer will be disappointed (that's what he gets for asking for this feature so late in the game).
  • NetHogNetHog Posts: 104
    edited 2007-12-15 16:59
    If it's ok to lose the constant occasionally, another option is to look at the sleep (power-down) mode of the SX. If running on power-down with 3V 'backup' battery, you can potentially store values for many months.
Sign In or Register to comment.