Shop OBEX P1 Docs P2 Docs Learn Events
Out of memory — Parallax Forums

Out of memory

dazedandconfuseddazedandconfused Posts: 4
edited 2008-08-20 21:14 in BASIC Stamp
I suppose you folks have heard this one too many times, but I'm fairly new to the Stamp world, and would appreciate any suggestions....
I have spent several·weeks completing the hardware for a new project, only to find the software won't fit in my BS2.· I can try to streamline the code, but I'll need to make major reductions in features if it's going to fit.· Ideally I need about 450 lines of code or 18K memory.··If I switch to another processor I'll need to un-do some of my hardware work.· Can I add (program) memory to the BS2?· Any ideas would be appreciated.

Comments

  • ercoerco Posts: 20,259
    edited 2008-08-19 03:00
    BS-2E chips are widely available on eBay for as little as $20-25 since Parallax blew them out last January. It's a drop-in replacement for your BS-2, and you'll have eight times the memory. You'll have to divide your code up a bit differently to fit into the 8 program banks.

    Actually I don't see any BS2Es on eBay right now, but if you're in a bind for one, send me a PM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • SRLMSRLM Posts: 5,045
    edited 2008-08-19 03:51
    I was fairly disapointed at the limited memory space of the BS2 when I first got it, although the slot system does provide a workaround. In my BOE-BOT project, I replaced the standard module with a BS2e, then used the slots as big methods, that I could call from a master slot with the expectation that control would pass back to the calling point. This involved some juggling of SCRAM variables, but it worked. See the thread in the Completed Projects forum entitled "Swiftsure BS2e Robot". Take a look at the code and you'll see what I mean.
  • dazedandconfuseddazedandconfused Posts: 4
    edited 2008-08-19 22:01
    Thanks for the ideas, everyone. I just learned that the BS2pe is pin-compatible and has eight times the memory. I ordered one of those.
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2008-08-20 21:14
    Yes, even those who write educational materials with the BS2 do run into this.· For future reference, we have a book that shows how to squeeze a lot into a BS2 with some thoughtful programming techniques.· Check out Applied Robotics with the SumoBot, it's a free download.· Though it is application-specific, the book introduces techinques for multi-use variables, using a single byte as a bit-flag register for sensor arrays, and state-machine organization, all useful for autonomous robotics navigation.

    -Stephanie Lindsay
    Editor, Parallax Inc.
Sign In or Register to comment.