eeprom full
bigfresh
Posts: 16
I've programmed my bs2 to control 5 record players, with most lines of the main subroutine code indicating an on/off state for all 5 of the players. Other lines signify a duration of time for how long an on/off state will perform. Very straightforward. See attached file...
A problem though. I've reached a point where when i send my program to the stamp I get an "eeprom full" error, which would mean my now 8k program has reached stamp capacity. I'd love to be able to make the program a bit longer, and i dont really see how i could make it more efficient--the code is essentially a non-repetitive musical score that cant be condensed into loops. I could make my variables physically shorter, but If i want to double or triple the size of my program, thats not going free up enough space.
So I'm very much a beginner at this--can anyone think of some relatively simple solutions to give me more space? Are there other databanks that i can access? Can the stamp run compresed code and if so, how can i compress it? It's probably possible to attach an SD card to the stamp but i honestly dont need that much room and its probably not terribly easy...any other suggestions? 8k really isnt very much room!
Thanks for your help
-brian
A problem though. I've reached a point where when i send my program to the stamp I get an "eeprom full" error, which would mean my now 8k program has reached stamp capacity. I'd love to be able to make the program a bit longer, and i dont really see how i could make it more efficient--the code is essentially a non-repetitive musical score that cant be condensed into loops. I could make my variables physically shorter, but If i want to double or triple the size of my program, thats not going free up enough space.
So I'm very much a beginner at this--can anyone think of some relatively simple solutions to give me more space? Are there other databanks that i can access? Can the stamp run compresed code and if so, how can i compress it? It's probably possible to attach an SD card to the stamp but i honestly dont need that much room and its probably not terribly easy...any other suggestions? 8k really isnt very much room!
Thanks for your help
-brian
Comments
The PBASIC Stamp BS-2 only has 2K of memory onboard. There is no way that you could be using up 8K as you suspect you are doing. What you probably have done is used up the 2K of onboard memory. The way to determine how much memory you have used is to look at the Memory Map (a button in the PBASIC Stamp IDE).
The only choice you have now is to use a PBASIC Stamp with a larger memory. This is accomplished by using any larger Stamp in the BS-2 family. The next step up would be the BS-2SX, but many folks opt for the BS-2p instead. The BS-2p has a slightly larger instruction set and scratchpad ram which is easier to use than that found on the BS-2SX.
On these larger Stamps the memory is NOT configured in a linear fashion. It is comprised of 8 X 2K BANKs of memory. Thus, you use 2K eight times (so to speak).
If you decide to use a larger Stamp, let us know and we'll point you in the right direction for using this banked memory.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON
If instead of the STAMP is purchased from Parralax, a user goes the OEM route from Parralax. The user buys the individual components. Instead of buying the stock memory, can the user couple a larger memory component?
If you're asking if this is an arbitrarary limitation, the answer is no. The underlying processor chip contains only a finite amount of memory, and that's all there is available. Other processor chips may support directly mapped, external memory. This processor does not.
Most folks don't seem to have a problem with the concept of fixed memory, and some fairly sophisticated programs have been written using the 8 x 2K memory available on the larger Stamps.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON
pj allen-- you attached a bs2 file in one of your posts...you changed the variables to CON and removed the GOSUBs altogether. do you see this saving memory or are you just using preferred conventions?
thanks..
So far as the CONs, if a value is fixed then it should be a CON.· No sense in declaring a bunch of values as VARs and burning a lot of I/O RAM for their being fixed values.
Don't know what you mean by "stuck", Bruce Bates mentioned an option and I did, too.
Post Edit -- error, error· See robots42's posts.
Post Edited (PJ Allen) : 3/29/2008 5:37:52 PM GMT
I have just rewritten your program to use DATA and READ. There is now nearly enough room for four times the amount of DATA.
see Brian.BS2
I have also rewritten bigfresh.bs2 so it works.
There is nearly enough room for twice the DATA
see bigfresh2.bs2
David
I don't know why I wrote re bigfresh2.bs2
"There is nearly enough room for twice the DATA"
Actually there is just enough room for a bit more program.
see bigfresh2.bs2
Using DATA is a powerfull way of storing information.
I will upload one at a time.
David
David
You are super-right!· (What's the use of "Line ="?)
Did you mean why Line =command.LOWBYTE in
IF command.HIGHBYTE=%10000000 THEN 'if the top bit is set then it is a Line comand
Line =command.LOWBYTE
OUTL = ~Line
it was just to strip off the highbyte but is entirely unnecessary!
OUTL will strip it off anyway.
David
bigfresh -- go robots42's way
·
just noticed an editing error in bigfresh2.bs2, should only be one ~ not ~~
MAIN:
Time = supershort
OUTL = ~~%10000 : PAUSE Time
should be
MAIN:
Time = supershort
OUTL = ~%10000 : PAUSE Time
oops
David
By using TimeCommand codes instead of Values the DATA value code for Time can fit in a byte.
And by setting the top bit for Line DATA then we can test whether the DATA byte is a Line entry or a TimeCommand Code entry.
So I got rid of all the Word entries in DATA.
Now there is room for seven times as much DATA as you have.
Program Brian2.bs2
David
much appreciated,
brian
DATA 128 + %xxxxx '%xxxxx for the five bits of data, the 128 sets the top bit of the byte as before.
it would be just the same size in the Stamp but more readable.
David
I have spent quite a bit of time writing small 4th generation languages for the BS2 where the program resides in DATA statements and is interpreted by the PBasic BS2 program. These have been to control Biped robots, both TecFoot, the precursor to Toddler, and the Ambler range as well as Loki and Hextor. For example this is the program for TecFoot which makes TecFoot walk forward avoiding obstacles using two ultrasonic 'Ping' sensors
D_Do DATA S4,USon,PSoff,D,Dowalk
Dowalk DATA F,D,Dowalk
D_Do is the default Do done on reset,;S4 sets the servo speed to 4; USon enables the Ultrasonic sensors; PSoff disables the user-pot control of speed; D Dowalk transfers control to DoWalk.
DoWalk only has one walking command F, the robot takes a step forward (and turns depending on the result of the ultrasonic information), then transfers control to itself again. Changing the program is easy and doesn't invlove writing more pBasic unless other commands are added to the language.
http://www.davidbuckley.net/DB/TecFootManual/TecFoot.htm
http://www.davidbuckley.net/DB/TecFootManual/TECFOOT.BS2
http://www.davidbuckley.net/DB/Ambler.htm
http://www.davidbuckley.net/DB/Loki.htm
http://www.davidbuckley.net/DB/Hextor.htm
David