Shop OBEX P1 Docs P2 Docs Learn Events
BS2e vs. BS2 eprom/program size? — Parallax Forums

BS2e vs. BS2 eprom/program size?

JimDJimD Posts: 4
edited 2006-12-11 04:48 in General Discussion
Just received my new BS2e and was saddened to find that I cannot just load my existing BS2 code into it and start adding all the code I couldn't find room for on my existing BS2.
Now that I look at the memory / eeprom map for both stamps, I see almost no difference between them.
I also wonder why my program, at maybe 100 lines, crowds the BS2 such that if I want to add a wee few lines of code, I have to delete (or comment OUT) other code to make room for it to prevent the dreaded "EEPROM FULL" error.
I get the exact same errors when I mark the code as BS2e and try to add any more commands.
Is there some secret to accessing the "increased memory and program size"in the BS2e as compared to the BS2??
Jim W5AOX

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-04 22:57
    Yes, you have to split your program into "slots" and load them accordingly.· This will get you started:

    http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv87.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-04-04 22:57
    That's because the Stamps with extra program space do not add it in a linear adress model. This means that the extra program space is organized into banks of 2K space (8 of the for the BS2e). This means, as you have found out, you can't just keep adding to the program space of a program already flirting with the 2K barrier. You have to break up the program. The first step is to locate any data stored in the program; tables, strings and other large groups of constants located within your program, then move it to it's own bank. When after doing that you find yourself still looking for more program space. You can do one of two things (or both), coallesce similar sections of code into subroutines, or find a way to break up the code into "slots" and switch the execution from one slot to another when nessesary.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    6+6=10 (Long live the duodecimal system)
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-04-05 08:41
    That's a BS2e, so moving chunks of DATA to another slot won't work, as it doesn't support READ/WRITE to other slots. (The BS2p/pe/px does, though)

    That PDF is a definitive read.
    You'll probably have to redesign the whole program, but what you'll end up with is a very modular design which can easily be updated with new functions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • JimDJimD Posts: 4
    edited 2006-04-05 13:33
    Thanks for the advice and links, got it up and reading....
    Been suspecting if I solve the BS2e problem it may allow more cmds in my BS2!!
    And reading......
    Jim W5AOX
  • JimDJimD Posts: 4
    edited 2006-04-16 03:35
    OK, I'm ready to try program blocks.· NOTHING I've found has shown HOW to load more than one program block into my bs2e.·

    HELP--

    Jim
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-16 03:43
    Did you miss the part about adding your other slot programs to the $STAMP directive?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • JimDJimD Posts: 4
    edited 2006-12-11 04:48
    HMMMmmm, looks like I've been derelict.· I did indeed re read more carefully, found the $stamp directives, and the blocks work.· Thanks again...

    Jim
Sign In or Register to comment.