Shop OBEX P1 Docs P2 Docs Learn Events
BasicStamp 2 vs 2sx memory size — Parallax Forums

BasicStamp 2 vs 2sx memory size

RoboangstRoboangst Posts: 1
edited 2013-09-26 08:58 in BASIC Stamp
So, while working with the Basic Stamp 2 I have found myself bumping up against the 500 instruction memory limit. I have now aquired a BS 2sx and I am still being informed that the EEPROM is full after only 500 lines of code. Am I misinterpreting something or doing something wrong? I expected to be able to write a program 8 times as long using the BS 2sx. Any help would be appreciated.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-09-26 08:48
    Welcome to the forums! All the other BASIC Stamp 2 models have 8 banks of memory @2K each. You cannot use the entire 8K as one contiguous block for code since the internal addressing only handles 2K at a time, however you can chain your programs so that you can have different functionality in different blocks allowing you to have more effective program space. If you declare I/O, constants and variables the same in each block they will be preserved when switching.

    There is a Nuts & Volts article on multi-bank programming at the following link. I hope this helps.

    http://www.parallax.com/downloads/nuts-and-volts-basic-stamps-volume-3
  • Mike GreenMike Green Posts: 23,101
    edited 2013-09-26 08:58
    Also, it's very common for people to run up against the 2K limit and find that, with a little attention to efficiency, their program fits in the 2K. Most commonly, they leave DEBUG statements in their code and they use long involved strings in their code for SEROUT messages and repeat them in different places, often with the same string content. Another common finding is that people repeat code, sometimes several times with little or no changes when a single copy used as a subroutine would work.
Sign In or Register to comment.