Shop OBEX P1 Docs P2 Docs Learn Events
BS2p24... full already! — Parallax Forums

BS2p24... full already!

Steve2381Steve2381 Posts: 94
edited 2005-05-28 22:56 in BASIC Stamp
Hello

Is there any way of adding addition eeprom space to the stamp modules for programming?
My first ever application I have written already exceeds the memory available.rolleyes.gif
I have trimmed it down to bare essentials, but as it is running an LCD screen, the data commands for the text are fairly hefty in using available memory.
Whats the next step up from stamps with regards to available programming space?

thanks

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-05-28 21:40
    The next step is finding out how to use multiple program segments and the "Run" command.

    I believe the BS2p24 has multiple 2K segments you can use -- but you have to use them in 2K 'chunks'. It's not hard, but it's not trivial either.

    Oh, and it is certainly possible to use an external SPI eeprom to store LCD screen data, and use the scratch-pad RAM to transfer the data to the LCD.
  • NewzedNewzed Posts: 2,503
    edited 2005-05-28 22:22
    As Allan said, there are eight 2K slots on the BS2p24.· If slot 0 is full and you need more programming space, creat a new program - we'll call it prog2.bsp.· Make uour declarations for BS2p and Pbasic 2.5, then copy and paste ALL of the I/o assignments, contants and variables in slot 0 to the new program.· Remember, it is critical that variables appear in EXACTLY the same order in both programs.· Variables are found by location, not name, so if you get them out of order you can get weird results.· Save the program.· Now go back to slot 0, and at the top of the program where is says {$STAMP BS2p}, change it to say:

    {$STAMP BS2p, prog2.bsp}

    Save the program, exit the editor, then call it up again.· At the top of slot 0 you should see the two programs.

    Not go to prog2 and write your additional stuff.· In slot 0, if you want to jump to slot 1, just write

    RUN 1

    In prog2, when you want to go back to slot 0, just insert RUN 0.

    You can actually jump between slots, going to any point you want by using flags.· Flags are almost a GOTO.· Suppose in slot 0 you want to jump to a routine called "scan" in slot 1.· In slot 0, write

    com = 1

    RUN 1

    At the very beginning of the slot 1 program write

    if com = 1 then scan

    When you have finished "scan" you can write RUN 0, or if you want to go to a certain spot, say "cont0", in slot 0, then at the end of your "scan" routine you write

    com = 1

    RUN 0

    At the very beginning of the slot 0 program, write

    if com = 1 then gosomeplace.

    Set com to a byte in your variables declaration - this will give you 255 flags for each slot.

    Is everything clear?





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Need a bezel for your LCD?

    Newzed@aol.com
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-28 22:56
    One of the great features about the BS2p is that the STORE command allows you to use READ and WRITE across program banks.· Based on your statement about lengthy text, I would move the text into another bank and craft a subroutine that calls them.· A cool upside of this technique is that it's easier to adapt your application to another language if that ever becomes a requirement.
    Steve2381 said...

    Hello

    Is there any way of adding addition eeprom space to the stamp modules for programming?
    My first ever application I have written already exceeds the memory available.rolleyes.gif
    I have trimmed it down to bare essentials, but as it is running an LCD screen, the data commands for the text are fairly hefty in using available memory.
    Whats the next step up from stamps with regards to available programming space?

    thanks
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.