Shop OBEX P1 Docs P2 Docs Learn Events
Multi bank programming question — Parallax Forums

Multi bank programming question

daveedavee Posts: 35
edited 2004-07-28 01:01 in BASIC Stamp
Is there any way that you can program a single bank on a BS2P without reprogramming the other banks?

I have proprietary code I want to put in one bank but I want to let the users use the other banks. Is this possible?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Evartt

FUSION robotics
What's in YOUR robot?
http://wehali.com

Comments

  • NewzedNewzed Posts: 2,503
    edited 2004-07-27 15:38
    Not really.· The code on Bank 0 call the other banks.· Besides, in your declaration you have to specify the programs in other banks, for example

    '{$STAMP BS2p, newrun12.bse, newrun34.bse, newswit.bse,newsensr.bse}

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    check out our 4-digit serial LED

    http://hometown.aol.com/newzed/index.html
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-27 17:17
    I think you probably can. What I would suggest doing is placing your code in bank 7, which is not likely to get overwritten by user programs. Create a blank program, then make copies with tag numbers: blank0.bsp, blank1, bsp, etc.

    Why? Because the only way you can get your proprietary code into bank 7 is to make it part of a multi-bank project, and when you open one of those the compiler wants to open all of the files. If you try to specify the same file for more than one bank, the compiler will complain that the file is already open.

    In blank0.bsp, do this:

    ' {$STAMP B2P, blank1.bsp, blank2.bsp, blank3.bsp, blank4.bsp, blank5.bsp, blank6.bsp, proprietary.bsp}

    Oh, your "blank" program can't be completely blank -- put the END keyword into it so the compiler has something valid to compile.

    When you send the BASIC Stamp module to your customer you'll have to warn them not to overwrite bank 7, and of course you'll have to tell them how to call the routines that live there.

    If the customer does err and overwrites the bank, you should can use the "Generate Object Code..." option from the file menu to create a loader that protects your source code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office


    Post Edited (Jon Williams) : 7/27/2004 9:16:56 PM GMT
  • daveedavee Posts: 35
    edited 2004-07-27 19:16
    Has anyone actually tried this? I'll try it out at home. It's sounds easy enough

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Evartt

    FUSION robotics
    What's in YOUR robot?
    http://wehali.com
  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-07-27 20:21
    Is the old DOS software still around? Seems like you had to press Alt+5 to program bank 5, etc. with that one. Don't know if that's still around or even if it would be feasible for you to use.

    Al Williams
    AWC
    http://www.awce.com
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2004-07-28 01:01
    Hi Dave,

    Adding on to Jon suggestion, you can set Preferences/EditorOperation to "Current bank". Have your bank 7 code in the front window when you download the code, and the compiler will download to that current bank only. With that setting it will not burn unwanted code into banks 0 to 6.

    That is fine if you are programming the chip yourself, as you can open the editor with your source code visible. But if you want to email or distribute your code without revealling the source, it is a different story. I don't know any way to force the "object code loader" to skip over banks that you do not want to disturb. As far as I know, you have to put something in those other banks. Jon suggested a single END instruction. A single DATA 0 instruction will also work, and one or the other or either or neither might work depending on how you interact with your customer files. I wish it would work with a single DATA (0), but it doesn't!

    If anyone knows how to create an object loader that just does a single higher bank, I would like to hear about it, too.

    As Al pointed out, the DOS software allows you to program individual banks, in fact, it only lets you program one bank at a time with manual intervention, with ALT-7 say, to select bank 7 before you choose ALT-R to run the code. The DOS version is still up on the Parallax downloads section. You do have to have the source code open to use that option, so it is fine for you, but not as a way to distribute your proprietary stuff to your customers.

    A third option is to use a Stache programmer. www.emesystems.com/stache.htm. (plug)
    It is flexible in in the way it allows you to assign code to banks and overlay different versions. The source of code in the Stache stays a secret.

    -- Tracy

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 7/28/2004 3:11:51 AM GMT
Sign In or Register to comment.