Shop OBEX P1 Docs P2 Docs Learn Events
Just to confirm - can't save a variable to memory to recall after power reset — Parallax Forums

Just to confirm - can't save a variable to memory to recall after power reset

Timothy D. SwieterTimothy D. Swieter Posts: 1,613
edited 2007-07-13 14:48 in General Discussion
I was working through what I hope to be my first application (read: still learning the SX and SX/B)·with the SX and I ran into a stumbling block.· There are a few settings in my application that need to be remembered after a reset or power loss.· From what I have read so far I need to add external memory, right?· I think there could be 30 bytes max I need to remember.· I wish the program could read bytes from the data table and then save back those bytes that changed.· This is not able to be done, right?
·
So, I saw the other posts about FRAM.· That sounds like the type of memory I need.· Any other suggestions?· The parameters written to the external memory could be updated frequently·and the·data must be remembered on power lost.· No battery backup in this application.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark is all it takes for an idea to explode

Comments

  • BeanBean Posts: 8,129
    edited 2007-07-01 11:23
    Yes that is correct. The SX has no run-time non-volitile memory.
    FRAM would be a good choice if the values change often.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    “The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • Alex41Alex41 Posts: 112
    edited 2007-07-07 02:30
    I've found that I need to do the same thing. Store a value until the chip is powered up again.
    Where can I find this FRAM and info on how to use it for the SX?

    Thanks,
    Alex
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-07 03:08
    FRAM stands for ferroelectric random access memory. Ramtron makes it (www.ramtron.com) in a variety of forms. There's serial memory in both I2C and SPI protocols and some parallel memory. The I2C memory is interchangable with standard I2C EEPROM without the write time or multiple write limits.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-07-07 04:33
    I ordered samples from Ramtron for a product prototype. I am located in HK though and the website says the distributor will be in contact with me to meet and give me the samples. I have not heard back from them yet so I may need to figure out how to purchase a few.

    I am planning on using the SPI version. It can be wired with three or four IO lines. I read through the datasheet and it looks rather easy to attached electronically and the software should be no problem as well. I am looking forward to testing the chip our. Admittedly I had not heard of FRAM until I searched through the forums. It looks like a great storage solution, data retention is long and the read/write has no delay (as Mike said).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • Alex41Alex41 Posts: 112
    edited 2007-07-12 20:44
    I need to store one value (maybe two - but the point is very little data) in this FRAM memory during times the SX chip is shut off.

    Where can I find the documentation on what sort of communication to use with the FRAM chip to the SX? Would Parallax have this info or would this come with the FRAM chip? Which goes back to making sure I buy the correct FRAM chip that is compatible with the SX. Or are these standard serial communications protocols?

    I'd really like to stay with SX/B, hope I can do it with this. I guess SERIN, SEROUT, and/or SHIFTIN, SHIFTOUT would do this?

    Or an I making this more complicated than it needs to be?

    Thanks for the always excellent help,
    Alex
  • BeanBean Posts: 8,129
    edited 2007-07-12 21:33
    If you are not writting data alot, you can use a simple EEPROM.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-07-13 00:38
    You can find more information about FRAM at a company called Ramtron (http://www.ramtron.com). They manufacturer RAM that can talk parallel or Serial (2-wire or SPI). The datasheet for the FRAM is detailed and describes the protocol well.

    I am awaiting samples (starting to think I need to purchase them because it has been over a week since I requested them and I have heard nothing) to do some testing with my product design. I have not written any code so at the moment I can't offer any advice other than I thought it looks simple to do with the commands that are available in SX/B or even ASM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • Alex41Alex41 Posts: 112
    edited 2007-07-13 01:26
    Bean,

    Thanks for the info on the EEPROM. I'm planning on using the SX to generate a frequency with an adjustable output based on a value that is tuned initially. This value will need to be stored when the device is turned off. I'd like to use 2 pushbuttons to increase or decrease the value. This would keep me from using the RCTIME command to read a potentiometer. I'm afraid the RCTIME command would take too long to read the pot, disrupting the frequency being produced. I'll have to experiment with that to be sure.

    How is the EEPROM used in an application like this? Any info to point me in the right direction?

    Alex
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-13 01:44
    For small amounts of data, you can also use 1-Wire EEPROM devices. Dallas Semiconductor makes a line of devices that use a single line for data and power (along with a ground connection) and some of these contain small amounts of EEPROM. There are probably routines for the SX to handle this protocol since the Stamps have built-in statements for the 1-wire protocol.
  • BeanBean Posts: 8,129
    edited 2007-07-13 02:20
    An I2C eeprom is easy to use. There is an example in the help file.

    Mike, yes SX/B does have 1-wire commands too.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • JonnyMacJonnyMac Posts: 9,215
    edited 2007-07-13 14:48
    In my opinion I2C is the easier of the two formats to deal with; I'll happily give up an extra pin for the ease of interface.
Sign In or Register to comment.