Shop OBEX P1 Docs P2 Docs Learn Events
Main EEPROM question — Parallax Forums

Main EEPROM question

TCTC Posts: 1,019
edited 2014-02-24 07:38 in Propeller 1
Hello All,

This will be an easy question.

I have a 512K EEPROM as my main. I want to use it for storage data, excluding the 32K needed for the prop. But I want to confirm a couple things before I try to write to it, and possibly screw up the area for the prop.

The prop stores its required data from locations $0000 to $7FFF, is that correct?

And I could safely write from location $8000 to $77FFF, without fear of changing the programing for the prop?

Also, what would be your recommendations to efficiency store this;

header 16bytes
there are 6 longs of data, and 300 data points. 6*300=1800longs or 7200bytes per segment
there are 1000 segments.

This is for data logging, and I would also like to find a way to store info on what segment the prop is on, in case of loss of power, the prop can continue where it left off.

Hope this makes sense.

Thanks
TC

Comments

  • TCTC Posts: 1,019
    edited 2014-02-23 13:51
    I should clarify a little better.

    First, store the 16 byte header. then, every second the prop reads 6 longs of data and stores it, and it does that for 5 minutes (300 seconds). We will consider that one cycle.

    There are going to be 1000 cycles.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-02-23 14:23
    TC wrote: »

    The prop stores its required data from locations $0000 to $7FFF, is that correct?

    And I could safely write from location $8000 to $77FFF, without fear of changing the programing for the prop?

    Almost right. The safe locations are from $8000 to $FFFF.

    Your EEPROM is not 512KBytes, it's (almost certainly) 512kbits or 64KBytes.

    It sure would be cool to have a 512KByte EEPROM but because of the addressing scheme it probably couldn't be used on boot up. There are 128KByte EEPROM that use an address bit to designate the upper 64K area.

    If you know the data isn't going to be some value like zero or $7FFF (largest positive number) you could fill the EEPROM with this invalid data before writing and then check to see where the writing has left off between power cycles. Otherwise, you need to keep writing the final location to some variable in EEPROM which would increase how soon the EEPROM could fail.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-02-23 14:48
    As has been pointed out, the upper 32K of a 64K EEPROM is addressed from $8000 to $FFFF. The EFX-TEK EZ-8+ uses the upper 32K of a 64K EEPROM for sequence storage. I wrote the attached object for the EEPROM -- makes things easy.
    This is for data logging, and I would also like to find a way to store info on what segment the prop is on, in case of loss of power, the prop can continue where it left off.

    If you save the value of a variable to its own address in the EEPROM, it will auto-load with the last value on the next reset/power-up.

    For example, if you had a program variable (long) that holds your EEPROM address, you could save it to (lower) EEPROM like this:
    ee.wr_long(@eeaddr, eeaddr)
    


    The object, ee, is my jm_24xx512. The first parameter is the address to write, the second is the value. By writing the value of a variable to its RAM address (which is the same as its EEPROM address), it will auto-load. I use this trick quite frequently.
  • TCTC Posts: 1,019
    edited 2014-02-23 15:12
    Duane Degn wrote: »
    Almost right. The safe locations are from $8000 to $FFFF.

    Your EEPROM is not 512KBytes, it's (almost certainly) 512kbits or 64KBytes.

    You are right, it is a 64KBytes (512KBits) 24LC512
    If you know the data isn't going to be some value like zero or $7FFF (largest positive number) you could fill the EEPROM with this invalid data before writing and then check to see where the writing has left off between power cycles. Otherwise, you need to keep writing the final location to some variable in EEPROM which would increase how soon the EEPROM could fail.

    Good point. The value could be 0, but I know it will never be $7FFF

    Just to make sure I am understanding you; I first start at address $8000, load $7FFF into every byte, then run my program.
    My program stores the header + a start byte(something the header will never have), then stores the data.

    If power loss, the program will look for the first $7FFF, then go back to the first start byte of the header, (the header will have the parameters), and re-run and continue that loop.

    These loops are for my reflow oven, I want to get a better idea of what the oven does with different Pgains, Igains, & Dgains. Then after it is done, dump the EEPROM and show the values on PST so I can copy them to excel.
    JonnyMac wrote: »
    As has been pointed out, the upper 32K of a 64K EEPROM is addressed from $8000 to $FFFF. The EFX-TEK EZ-8+ uses the upper 32K of a 64K EEPROM for sequence storage. I wrote the attached object for the EEPROM -- makes things easy.

    I am very sorry, I could not find where you discussed the address range. I am using your object though, it is a lot easier to understand.
  • TCTC Posts: 1,019
    edited 2014-02-24 04:10
    I really thank both Duane Degn and JonnyMac for your help and advice. But I have ran out of EEPROM space. I might take an old 2GB SD card, solder wires to the pins, and go that way. I might even have a 4GB microSD card somewhere that I could use.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-02-24 06:41
    SD cards are a great way to add memory storage to the Propeller. They're surprisingly easy to use thanks to the great drivers available.

    There are a lot of cheap SD card sockets on ebay. You'd probably be okay buying the card from ebay as well since you don't need it to be high speed.

    Parallax's Propeller Memory Card has a microSD socket plus some memory chips to experiment with. IMO, it's a fun addition to one's part collection.

    I think it was Prof Braino who just soldered some wires to a uSD adapter and used it as his uSD card reader. Lots of uSD cards come with an adapter so it's not an added cost.
  • TCTC Posts: 1,019
    edited 2014-02-24 07:38
    Duane Degn wrote: »
    There are a lot of cheap SD card sockets on ebay. You'd probably be okay buying the card from ebay as well since you don't need it to be high speed.

    WOW!!! that is real cheap. I was going to build my own later on, but at that price I would be spending more on parts.
    Parallax's Propeller Memory Card has a microSD socket plus some memory chips to experiment with. IMO, it's a fun addition to one's part collection.

    I have to ask the boss(wife) if I have been good enough to get it.
    I think it was Prof Braino who just soldered some wires to a uSD adapter and used it as his uSD card reader. Lots of uSD cards come with an adapter so it's not an added cost.

    I have a couple uSD adapters, I could do that.
Sign In or Register to comment.