Shop OBEX P1 Docs P2 Docs Learn Events
Looking for an easy way to "write" — Parallax Forums

Looking for an easy way to "write"

KeithKKeithK Posts: 5
edited 2006-12-01 01:56 in Propeller 1
I just got my propeller kit with a manual and I didn't see anything in the book that covered the "write" function found in the bs2p. Am I missing something? I am working on using the propeller to replace a bs2p project that I built several years ago. I need to be able to use a menu to select several values and then have them saved to the eeprom for later use. It's·being used to control a bleed valve that needs to maintain the same setting between power ups. It will also need to be able to save values that are created while the program is being ran.

Let me try to explain it a little better with a description of the application. An lcd with buttons is used to set a pressure value in psi. There is an analog pressure sensor that gives feedback as to what the actual pressure is. There is a valve that is adjusted with a servo that will open or close as needed to hit the pressure target. Once the pressure target is hit and maintained, the value that was sent to the servo is saved to set the baseline for the next time the application is started. It will then start over with adjusting as needed to maintain the desired pressure.

If I don't record the value that is sent to the servo, it will have to relearn where it needs to be every time.

Any ideas on how I can get it to write to the eeprom in a simple manner?

Thanks,

Keith

Post Edited (KeithK) : 11/25/2006 4:29:34 AM GMT

Comments

  • lairdtlairdt Posts: 36
    edited 2006-11-25 02:57
    Check out the I2C EEPROM example, it has what you're after.

    You do have a second EEPROM to write your data out to, right?
  • KeithKKeithK Posts: 5
    edited 2006-11-25 03:05
    I have another eeprom but I was hoping to use the one that is used for the program.
  • KeithKKeithK Posts: 5
    edited 2006-11-25 04:05
    If a second eeprom is my only option then a 2nd eeprom it will be. Where is the i2c eeprom example posted?
  • KeithKKeithK Posts: 5
    edited 2006-11-25 04:37
    Found it, thanks
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2006-11-26 03:55
    Keith, There is no need to use an extra eeprom. You can write to the program eeprom, but you do need the i2c routines in order to do that. You can write directly into the image of your program as it is stored in eeprom, so that your stored parameter will be loaded along with the program at bootup. Alternatively, substitute an eeprom larger than 32k, say 64k or 128k, and that allows you a lot of extra storage apart from the program space. You can structure it in any way you want for your application, at no increase in chip count.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • KeithKKeithK Posts: 5
    edited 2006-12-01 01:56
    Thanks Tracy. I figured there would be a way to do it. I'll play with the i2c routines to see what I come up with.
Sign In or Register to comment.