reading data stored onto a BS2
agentile
Posts: 101
Hello,
· I am trying to use a pair of·BS2's to send and receive data transmitted across phone lines.· In order to find out if the data has been sent, I need to read the memory map of the receiving BS2.· It seems that in order to read the memory map, I have to first put a program onto the stamp.· And if I do this, I will over-write the EEPROM, where the data is stored.· Is there a way to read from a stamp without loading a program onto it?
thanks
Andrew
· I am trying to use a pair of·BS2's to send and receive data transmitted across phone lines.· In order to find out if the data has been sent, I need to read the memory map of the receiving BS2.· It seems that in order to read the memory map, I have to first put a program onto the stamp.· And if I do this, I will over-write the EEPROM, where the data is stored.· Is there a way to read from a stamp without loading a program onto it?
thanks
Andrew
Comments
The program is located from the top of the EEPROM (0xFF) down and data are stored bottom up. So as your program and data grow they come more and more together. Finally your data overwrites part of the program. But then you have a considerably large program or a huge amount of data .
Normally it should be not a real problem.
Regards,
Klaus
·This is very similar to a (or several) project(s) I am working on.· Okay, so you have the stamp set up in some remote (away from the PC) location.· The stamp is sampling data for a few minutes, and it stores the data in eeproms 0 through 50.··Now I want to go put the stamp on the computer and read what is stored at those eeprom locations.· If I use a data dump section of my program, I am still away from my computer, and so I would have to reset the program to have it run while hooked up to the computer.· And, in resetting the program, I would overwrite my stored data.· How do I get my data off of the stamp without reprogramming the stamp?· Or, does it matter if I reprogram?
thanks,
agentile
So, you put your BS2 in the field, with this pin wired high. You log some data.
You now take your BS2 to your PC. You wire the pin low, start up your PC, then start up your BS2. It sends the logged data to your PC.
Your EEPROM is only erased when the PC *programs* the stamp. Not when it is 'reset'. So if you have a little:
· MyEprom VAR BYTE
· MyAddr VAR BYTE
· EpromLast CON 50
· MyAddr = 0
· WHILE MyAddr < EpromLast
··· READ MyAddr, MyEprom
··· SEROUT 16, 16384, DEC MyEprom
····MyAddr = MyAddr + 1
· WEND
then this will 'dump' the EEPROM data from 0 to 50 to your PC.
gremlin's solution is certainly the best, but you can use the DATA statement to reserve EEPROM addresses without writing to them during download. For instance,
*************************
'Datalogger program:
DATA 0 (100) 'clears first 100 bytes of EEPROM memory on download (not powerup!)
'Other data statements, etc...
Main: 'Datalogger program follows...
*************************
'Datadumper program:
DATA (100) 'skips first 100 bytes of EEPROM memory on download, thus preserving any data already there
'Other data statements, etc...
Main: 'Datadumper program follows...
*************************
Check the Programmer's Ref Manual DATA statement for more info.