question about eeprom
zerox
Posts: 9
Hi, can i save a value of a var in execution time?, but i need the value remain in memory after a lost off energy, i mean, when the battery is off, i want the value still to be in the memory rom, so when i turn the battery on, the value will be the same then before, is this posible?, thanks for everything.
Jack.-
Jack.-
Post Edited (zerox) : 8/13/2008 11:44:28 PM GMTJack said...
I just take a look to this post, http://forums.parallax.com/forums/default.aspx?f=5&m=276495&g=276577#m276577 and i understand some of the code, but i still have some questions about the using the write command, when i give him the memory sector to write into the EPROM, i have to give a HEX value? or a simple DEC willl be enough?, like this:
WRITE 0, stuff
OR
WRITE 4B0, stuff
and other, the 0 or 4B0, are like pointers to memory?, thanks for all.-
Jack
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
WRITE 0, stuff
OR
WRITE 4B0, stuff
and other, the 0 or 4B0, are like pointers to memory?, thanks for all.-
Jack
The <address> is the address in EEPROM of the byte (or first byte) to be written. It can be any numeric expression.
In PBasic, you write hexadecimal numbers with "$" in front, so you'd write $4B0 or the same in decimal (1200).
http://www.parallax.com/tabid/440/Default.aspx
The big yellow book is a useful tool to have on hand (in print) when programming. Mine has the spot of honor just to the left of the monitor...
FOR EE_PTR=0 TO 8
WRITE EE_PTR, memory(i)
i = i + 1
NEXT
i = 1
FOR EE_PTR=0 TO 8
READ EE_PTR, memory2(i)
i = i + 1
NEXT
the value of the eeprom, will be saved in the memory2 VAR or i am wrong?, thanks
Jack.-
I used the same array buffer for both reading and writing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
Reserving space means that the Stamp editor will not "accidentally" overwrite existing data (or try to fill that space with code) when a program is downloaded.
For example, I might download a program that just writes my data (I run this app one time):
Now, if I download this program, the 16 "reserved" bytes will NOT be overwritten, and the new program can read back the data
You can also used read/write for a startup toggle (each time you reset the Stamp, it knows it's been reset...
Each time you hit reset, you'll switch back and forth between the two frequencies of beeps.
Last but not least, addresses on the Stamp go from $000 to $7FF (2k). Multislot Stamps have more memory, but the STORE command is used to choose the slot, then memory is addressed from $000 to $7FF within that slot.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 8/14/2008 1:23:36 AM GMT