Main EEPROM question
TC
Posts: 1,019
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;
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
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
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.
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.
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:
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.
You are right, it is a 64KBytes (512KBits) 24LC512
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.
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.
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.
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.
I have to ask the boss(wife) if I have been good enough to get it.
I have a couple uSD adapters, I could do that.