Shop OBEX P1 Docs P2 Docs Learn Events
Upgrading from a BS2 to a BS2E…. how to use the banked memory? — Parallax Forums

Upgrading from a BS2 to a BS2E…. how to use the banked memory?

MikeyMustangMikeyMustang Posts: 22
edited 2008-11-07 06:00 in BASIC Stamp
Hey Guys.

I have out grown my BS2 and need more memory space. So I figured I would upgrade to a BS2E but I found that the BS2e used banked memory and I would have to rewrite my code to take advantage of that. Can someone point me in the correct direction on how to do that with my program? I have included a copy of my program.

Thanks

Mike WA3O

Comments

  • GICU812GICU812 Posts: 289
    edited 2008-11-06 23:50
    I dont know what T=0 does, but can it be put at the end of the SendMessage sub? Seems like you T=0 after every time you run that routine

    As for using the multiple slots, the commands is Run X

    The trick is everytime you enter a slot, it starts from the top and runs down, just like you rebooted the stamp, so you need to put in some conditional pointers at the top.

    Example, use a varaible

    X var byte

    Finder:
    Select x
    case 0
    goto main
    case 2
    goto othersub
    end select

    Main:
    yadda yadda
    x=2
    run 1

    Othersub:
    do more stuff
    pause 500
    goto Main


    (Slot2)
    do some stuff
    run 0
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-06 23:52
    There's a Nuts and Volts Column on the use of multiple "slots". I don't have the link handy, but go through the index and you'll find it.
  • GICU812GICU812 Posts: 289
    edited 2008-11-06 23:52
    So what you need to do is store all your data in another slot, then instead of looking up the data, set a variable and go to the other slot, use the variable to lookup the data you need and put it back in the variable, then return to your main slot and process with the variable

    Just glancing over your code, I think you could debug in the DTMF varaible, then run slot 1, then place all the lookup code in slot 1, then since all those subs appear to "goto main" at the end, just dump it back into slot 0.

    If you needed to skip all the initilization stuff the second time around, set a bit variable and "if bit = 1 goto main" above all the initilization, and "bit = 1" at the end of the initilization.

    Also keep in mind, the variables are the same in all slots, so you have to decalre them in the same order in every slot or you will screw them up. I just copy and paste my varaible decs into all slots used to avoid problems.

    Post Edited (GICU812) : 11/7/2008 12:01:22 AM GMT
  • MikeyMustangMikeyMustang Posts: 22
    edited 2008-11-07 00:07
    The T=0 is a tone count... if my tone count is 4 send a period if tone count is 8 send a k ending the string so to enter 14.200 i key in 014X200X where X is ANY key except a,b,c,d,*,#

    I am still a little confused about the bank to bank programming but when I get the BS2E I will play with some small programs first.

    On another note I have had some weird stuff happen to this BS2 ...it will work perfectly then out of the blue it will start adding digits. I reprogram it and it still happens?.....then I will reprogram it with a VERY old program and it is well for a little while...is there a BS2 program to "clear" it?....do I have something programed bad and its keeping somthing in the pointers or memory?

    Thanks for the help

    Mike WA3O
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2008-11-07 00:24
    As requested previously in another thread, we have posted that particular Nuts & Volts column to the BS2e Product Page.

    -Stephanie Lindsay

    Editor, Parallax Inc.
  • ercoerco Posts: 20,256
    edited 2008-11-07 06:00
    See http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol2/col/nv71.pdf·and http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol3/col/nv87.pdf

    Best,

    erco

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.