BS2pe : cannot use all the program slots
Hi, I am using a BS2pe stamp and am trying to write a software program which uses all 16 program slots of 2k eeprom memory space each. The following code allows me to link the different programs slots to make a single program (for want of a better expression):
' {$STAMP BS2PE,STORE1.BPE,STORE2.BPE,STORE3.BPE,STORE4.BPE,STORE5.BPE,STORE6.BPE,STORE7.BPE}
However, this appears to be the maximum allowed, if I try to continue and link program slots 8 to 15 then I get the error message "Can not specify more than 7 additional project files." As this amount is not enough for my application, can anybody tell me how I can include all the program slots into a single program?
thanks in advance
John.
' {$STAMP BS2PE,STORE1.BPE,STORE2.BPE,STORE3.BPE,STORE4.BPE,STORE5.BPE,STORE6.BPE,STORE7.BPE}
However, this appears to be the maximum allowed, if I try to continue and link program slots 8 to 15 then I get the error message "Can not specify more than 7 additional project files." As this amount is not enough for my application, can anybody tell me how I can include all the program slots into a single program?
thanks in advance
John.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I have read what the Stamp manual sayes but am still at a loss. I want to have my program run in slots 0,1,2 and my data stored in 3 thru 15. I want to find a way to fill the slots 3 - 15 with my data. I did write a "Data Loading" program which writes the data into each slot one at a time but this doesn't work as the data needs a DATA directive in front of it in order to be read, which to my knowledge can only be achieved in a program slot. Can somebody tell me the right way to fill my program slots 3-15 with data,
thanks
John.
If your data is already in DATA statements, you can load each block into slot 7, say, with a program to READ the data from slot 7 and reWRITE it to a slot in the 8-15 range. This will take several iterations to accomplish, but once it's there, it will stay there until rewritten.
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 12/7/2008 9:41:30 PM GMT
your solution is the same as what I did earlier, I used a program in slot 0 to read a data byte in the same slot and write it to slots 3-15, I would complete one slot at a time, reading and writing one byte at a time until moving on to the next slot. My lcd display showed me the progression thru the programslots and later I would load in my main program which uses the data in slots 3-15, however it was not able to read the data. Obviously I'm doing something wrong, just trying hard to fiqure out what it is, thks for your help.
John.
the program I use to load in all my data has the following to write data to other program slots, the variable PGMSLOT is incremented until slots 3-15 are all written to, this is just a part of my code, of course. The data lines are part of slot 0 program, they are 19bytes in length for each DATA directive:
START2:
FOR B = 0 TO 18
STORE 0
READ X, A
STORE PGMSLOT
WRITE X, A
X = X + 1
NEXT
IF X = 1634 THEN GOTO START3
GOTO START2
I do set X to zero as I move on to the next pgmslot. After this data loading program is complete I run my main program, the one which uses slots 0-2 for program and 3-15 for data. Strange thing is that the program is able to read data from slots 3-5 perfectly but nothing from 6-15. It had occured to me that this may be a hardware problem but hopefully not.
This will provide a cursory exercise of the address lines and you can do it in a very small program with 2 for loops. You might possibly realize something you were doing wrong.
If it still doesn't work, then update the program to write incrementing values to each location in slots 1-15. Then go back and read from each location, check that the data read = the address modulo 256 and then write back to that address the inverted value of the address. If you ever read back a memory location that does not equal the address of that location, then you have a hardware problem in the memory.
This will provide a pretty good exercise every address and data line in the memory.
One question I have is when you say that you "can't read anything from slots 6-15"...what do you mean? Do you always read zeros? Does the processor hang??
Also, I'm curious what you are making that has so much hard coded data in it?!?
As I recall, the BS-2e ONLY has 8x2K banks of memory. I'd imagine that's the problem. The BS-2pe has 16x2K banks of memory.
As a general rule, interpreters won't "choke" on an error like this. It's really more a task of a rather sophisticated syntax checker and parser. There really isn't a reason to have one in PBASIC, as "we" are supposed to know the hardware limitations at the outset.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.
From the quote above though you seem to indicate differently...that you're populating the remaining banks from the data in slot 0.· You did refer to multiple DATA statements, each 19 bytes in length, however your program seems to only copy the first 19 bytes of slot 0 EEPROM repeatedly.· Is this what you were trying to do?· Currently you will copy the first 19 bytes of slot 0 86 times into the bank specified by PGMSLOT.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
The locations are copied in groups of 19 bytes, but the address (X) continually increments through 1633. Perhaps there's a problem in the code that he's not shown us.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
There must be something wrong with the code. The STORE/READ/WRITE method should work just fine.
FWIW
The native programming algorithm in the BS2pe does recognize slots 8 to 15 when it receives those numbers embedded in the object file. I have a special version of a Stache that I use for programming DATA into slots 8 to 15 of the BS2pe. In the Stamp IDE I make the DATA files as a separate project directed to slots 0 to 7 and load them into the special version of the Stache. Subsequently it adds 8 to each slot number as it programs the BS2pe, so the DATA ends up in slots 8 to 15, without disturbing slots 0 to 7.
When Jeff posted the object file format a couple of weeks ago, I went in and hacked the slot numbers in an object file, but ran up against the checksum error when trying to run StampLoader.EXE. Just possibly, it might work with recomputation of the checksum, but . I haven't had inclination to pursue it. It still might not work if the Stamploader does a strong range check of slot numbers.
The main point is that the stumbling block for loading data into slots 8 to 15 does not lie with the BS2pe itself -- It can accept that data correctly -- The stumbling block is the limitation to slots 0 to 7 in the IDE/downloader.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
IF (47 < CHAR < 51) AND PGMSLOT > 5 THEN ..............
When changed to the following, the problem went away;
IF CHAR > 47 AND CHAR < 51 AND PGMSLOT > 5 THEN ...............