BS2pe Data Storage
Newzed
Posts: 2,503
I have the Propeller receiving temperature data from a remote Stamp.· The Propeller then sends this data to a BS2pe for data storage in Bank 8, which is supposed to be 2047 bytes.· I just had the Propeller read back the data stored in the BS2pe.· The Prop VGA displays the data stored at addresses 0 to 234 in 9 byte increments.· 234 x 9 = 2106 bytes, which is 59 bytes more than the stated capacity of Bank 8.· I continued storing data.· At address 252 - 2268 bytes - the data was still good.· The next entry rolled over and garbled the data at address 0.· Can anyone explain the discrepancy between the apparent 2268 bytes stored and the stated size of Bank 8.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
Comments
Actually the bank is 2048 bytes (address 0 – 2047). I don’t see how you could store data to addresses which don’t exist. My guess is if you calculate the wrapping point you will find that data above 2047 matches data at the beginning of the EEPROM up to where your data went wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
Have you compared the readings that exceed 2047 with the ones starting at 0 after the logging was completed? Also, are you storing 9 bytes per event?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
If there are 8 bytes of data, why do you increment by 9? If you increment by 8 each event will be logged on an even boundary giving you exactly 256 events within that 2K block of EEPROM. There is a trick posted by Tracy Allen which allows you to seamlessly write to contiguous slots during logging in case you use more than 2K.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I have no problem jumping from Bank 8 to Bank 9 - I just haven't had a need to do that yet.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
I would recommend going to 8-byte blocks…Unless your application is unique and you’re logging data from multiple sources at the same time you could just tag the block once and waste one section (first packet/8 bytes) with the location. Also, I don’t know what data you’re logging, but if you are sampling at a fixed interval, it is not necessary to store date/time information for every sample.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
That is quite puzzling. Either you have the Midas touch with the BS2pe memory banks, or there is some subtle point you have overlooked in how your data is being stored and read out. Post code, the write and read rouitine at least, if you'd like us to take a look at it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Here is the write and read rotuines for the data:
datastore:
DEBUG "Writing to EEPROM", cr
SERIN si, baud, [noparse][[/noparse]DEC3 dat]
DEBUG DEC ? dat,cr
GOSUB getclk
STORE 15
READ 0, word addr
DEBUG DEC ? addr, cr
STORE 8
WRITE· addr, word dat
WRITE addr + 2, hrs,mins,secs
WRITE addr + 5, month,date,year
addr = addr + 9
STORE 15
WRITE 0, addr
GOTO start
readeep:
DEBUG "reading EEPROM", cr
SEROUT so, baud, 30, [noparse][[/noparse]"··················· Shop Temperature Log",13,13]
addr = 0
readeep1:
STORE 8
READ addr, word dat, hrs, mins, secs,month,date,year
IF dat = 0 OR dat >1000 THEN
SEROUT so, baud, [noparse][[/noparse]10]
GOTO start
ENDIF
IF addr<10 THEN
L = 10
ENDIF
IF addr>9 THEN
L = 9
ENDIF
IF addr>99 THEN
L = 8
ENDIF
SEROUT so, baud, 20,[noparse][[/noparse]"··· ",DEC addr, REP 32\L,DEC dat/10,".",DEC1 dat, "····· ", HEX2 hrs, ":",HEX2 mins,
":",HEX2 secs, "····· ",HEX2 month,"/",HEX2 date,"/", "20",HEX2 year,13]
addr = addr + 9
DEBUG DEC ? addr, cr
GOTO readeep
The value of L has nothing to do with the data - this is a value sent to the Propeller for formatting the VGA display.· Has to do with columnar spacing.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
When you write the address back to bank 15, you are writing a byte. It should be a word.
There is an RTC? Why not store the address in battery backed RAM instead of banging location zero in bank 15?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
The RTC is a piggyback DS1302 running from the Stamp Vdd.· It was just easier to store the address in Bank 15 than it was to store it in the clock RAM.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
An easy example of how to write to the DS1302 RAM and read from it is listed in the Demo Code in the Projects Forum. It’s really only a couple of lines and would save wearing out the EEPROM location from repeated writes. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
No, SRAM doesn’t really have a write cycle life…It’s downfall is it is volatile. But, on the DS1302 you can back it with the same battery that backs the clock, so it offsets it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The 'eeprom' storage you're accessing on the BS2p is eeprom. Each location can only be written to a million times or so. For program storage, that's not a problem. If you're updating it every second, it will wear out.
Thanks anyway.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·