Shop OBEX P1 Docs P2 Docs Learn Events
Prop-Mini-Upper-Eeprom access? — Parallax Forums

Prop-Mini-Upper-Eeprom access?

Hi
I'm building a Step Motor controlled actuator.
I would like to be able to save my motor position data to the upper memory locations of
the Prop-Mini eeprom so that if I turn the actuator off and then back on
my positions can be recalled from the eeprom.
I ran into the following message thread concerning pretty much this subject
http://forums.parallax.com/discussion/163367/writing-text-to-eeprom#latest
The message thread had an example spin file and I2c driver "I2C SPIN driver v1.4od" written, I believe by Chris Gadd.

In looking over documentation, It appears that the I2C SPIN driver v1.4od would need pullup resistors mounted to
Pin 28,29 on the prop mini.
Schematic on the PropMini shows only one pullup resistor on pin 29,SDA line.
I purchased my Prop-Mini several months ago so am guessing it has the 64K eeprom.

Is it possible to use this strategy to save my step positions after caliborating the actuator
so that if I power down PropMini and turn it on again, I can get my motor position data back out of the eeprom?

I realize I'm being quite vague here, but I'm not sure how to explain it better for now.
I have never attempted to save and recall from eeprom before.
It is possible using only existing PropMini hardware eeprom, could make this project simpler to implement.

Thanks for any words of wisdom
Garyg

Comments

  • Cluso99Cluso99 Posts: 18,069
    Presuming the PropMini has a 64KB EEROM (most but not all have the 64KB EEPROM)...

    Depending on the driver, a pullup may not be required on the SCL/P28 line. If the driver makes P28 an output and drives the clock high and low (not just turns the DIRA pin as an output when low and off when high) then it will work. It will be easy to test, and if not choose another driver.

    If you only have a 32KB EEPROM then its also possible (providing your program is a little less than 32KB) to save your values in the very top section of the 32KB. When the prop boots this will then be loaded into the top part of hub ram.
    eg have your parameters in say hub $7F00..$7FFF and write these out to eeprom $7F00..$7FFF. When booting, these will be loaded with your program back into hub.
  • I remember there also being a "pp" i2c driver, meaning push pull. This driver doesn't need pull ups.
  • Thanks for your input
    Now that it appears that this strategy will work on my project, I'll try a few things
    based on the "writing to text on eeprom" thread.
    I think that I will have 8 variables that will need to be saved to the eeprom once I have the
    final position counts determined.
    If I understand Cluso99 correctly, I should be able to save to eeprom, my variable values
    in the upper end of the 32k eeprom,

    but if I do that and make minor changes to my spin file
    then reloading the spin file will cause the final position counts to be erased.

    If I save to the upper end of the 64K eeprom memory locations, the position counts will not be erased.

    This could work!

    I'll look for a "pp" i2c driver in the obex in case the I2C SPIN driver v1.4od does not work out for this
    situation.

    I'm very new to the saving to eeprom situation,but I think it will be very valuable in this and future projects.

    I'll now see what exactly I can do with this.

    Thanks
    garyg



  • Check out this EEPROM datalogging thread: http://forums.parallax.com/discussion/97625/pe-kit-lab-applications-–-eeprom-datalogging-and-i2c

    I couldn't find Propeller EEPROM.spin in the OBEX, but it is the object I use to write to upper portions of a 32k EEPROM. I attached my copy here.
  • Cluso99Cluso99 Posts: 18,069
    correct. If you download an updated code, it will overwrite the whole 32KB in eeprom.

    You want the basic_I2C_driver.spin by Michael Green. It drives both pins so it states no pullups are required. I would still expect the SDA pullup should be fitted at least.
  • gis667en11 wrote: »
    I remember there also being a "pp" i2c driver, meaning push pull. This driver doesn't need pull ups.

    Correct. You could use the "I2C SPIN drive v1.4pp.spin" file from the OBEX repo here. I haven't used it in the past since I always use pull-ups. You could bodge on a pull-up from the easy to grab EEPROM SCL pin to the supply at the SDA pull-up. Wouldn't be very pretty, but it'd do the job.
  • Thanks for all your support
    Next on my agenda for this project is to purchase a few things.
    ..
    I decided to relocate for 3 months or so from frozen Wisconsin to warmer not frozen south Texas.
    Problem is that I could not take all my stuff with me.
    ..
    Is there a way to simulate the prop mini coding that I'll be attempting to write?
    ..
    For now, my plan is to order a parallax 2 line serial LCD, breadboard, soldering iron to make the Mini to
    attach to the breadboard.
    I'll need a prop plug also.
    ..
    It appears to be that my usual local one stop shopping situation will not work.

    I know I can do this!

    Thanks for your support
Sign In or Register to comment.