Shop OBEX P1 Docs P2 Docs Learn Events
Converting from BS2 to BS2sx — Parallax Forums

Converting from BS2 to BS2sx

Chicago MikeChicago Mike Posts: 88
edited 2006-03-18 21:26 in BASIC Stamp
So one of my projects has grown too big for my original BS2, so I went and bought a BS2sx, because I needed more programming space. I was at the limit, literally with code length. I changed the compiler directive, and according to the memory map after rerunning, I have no more room? I added a few lines of code and I'm still out of room? What am I doing wrong here?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-03-18 20:21
    All of the Parallax Stamp processors use a bank structure for expanding the program space. You don't just get the ability to have a bigger monolithic program. You actually have to partition your program into separate programs, each with no more than 2K. The separate programs can have common information in that they share the variables and scratch RAM in the "bigger" processors, but subroutines have to be duplicated in each "bank" where they are used, so it's not simple. You compile the "banks" as separate pieces of a project and the Stamp Editor will load them all or individually into your BS2sx. Look at the RUN command for details and examples.
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-03-18 21:26
    There's a few gotcha's you should be aware of, like the variable map.

    You only have one set of variables, but you'll need to define them in all the programs, and this must be done so that they end up in the same place, too.
    I suggest that you read Nuts&Volts column 87: Multibank programming

    Edit: I forgot that the BS2sx had scratchpad RAM, and that is of course the recommended way of passing variables.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...

    Post Edited (Gadgetman) : 3/18/2006 9:34:10 PM GMT
Sign In or Register to comment.