+ Reply to Thread
Results 1 to 7 of 7

Thread: Program memory / storage memory with SX chip

  1. #1

    Default Program memory / storage memory with SX chip

    Im moving from basic stamp 2sx to the SX/B , im not sure of how the memory is organized on the SX , does it work in· a similar fashion to the basic stamp 2sx program slots?

    or are there different steps to be taken if i require more program storage space?

    thanks again.
    ·
    Last edited by ForumTools; 09-30-2010 at 08:55 PM. Reason: Forum Migration

  2. #2

    Default

    sorry my confusion is from reading the specs for the SX chip

    it says it has·2048 x 12· EEPROM , im very unclear how the RAM and EEPROM are allocated on this chip ..

    does the basic stamp 2sx have an additional eeprom ?·

    slightly confused..

    ·
    Last edited by ForumTools; 09-30-2010 at 08:55 PM. Reason: Forum Migration

  3. #3

    Default

    sorry another addition to my question :

    one thing im perplexed about ..

    If the Basic stamp2sx uses the SX chip as does the SX/B system ..········· how does the basic stmp 2sx have 8 x 2k slots of Program memory ?······ when it appears the SX only has 2k?

    i must be missing something very basic here .. so im sorry for that ..

    since im used to the basic stamp 2sx , does the memory work in a similar way on the Sx/b? system ...... im currently filling up almost all the available program slots on my bs2sx after opptimizing everything nicely
    so im going to need the program storage

    currently im switching between program slots .. is a similar approach possible on the SX/b?····· and is a similar scratch pad memory able to be done with the Sx/b


    thanks..
    ·
    Last edited by ForumTools; 09-30-2010 at 08:55 PM. Reason: Forum Migration

  4. #4

    Bean's Avatar
    Location
    Near Harrisburg PA
    Posts
    7,623
    Blog Entries
    4

    Default

    The BS2sx contains an external EEPROM that stores the program and non-volatile data. The SX has FLASH memory to store the program (cannot store runtime non-volatile data unless an external EEPROM is connected).
    If you have the program memory full in a BS2sx, I don't think you are going to get that program to fit into an SX.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out· the "SX-Video Display Module"

    www.sxvm.com

    "A problem well defined, is a problem·half solved."
    ·
    Last edited by ForumTools; 09-30-2010 at 08:55 PM. Reason: Forum Migration

  5. #5

    Default

    Duffling, if your code is occupying 16K of tokenized PBASIC, I just dont see how your going to fit that on a single SX. The SX28 has 2K like you mentioned, and the SX48/52 is 4K. Are you truely using 16K of program space or do you have alot of data your storing in there as well, if the latter is the case you can incorperate an external eeprom to store your data in to offload it to make room for the true code. The program space of an SX cannot be expanded, in the past we have talked about workarounds to this but it basically means tokenizing, which is what the Stamp does (though my tokenized forth interpreter runs faster than PBASIC does, I haven't done precise benchmarks, and the difference in languages makes it difficult to compare) but your best bet is to subroutine the heck out of your program.

    An optimized PBASIC program is not the same as an optimized assembly program, with PBASIC creating a loop construct (a for(i=0;i<n;i++) in C) is the same if you count up, count down or count by 3's. In SX assembler there is a command called decsz which decrements a variable and skips the next instruction if the result is zero (there is also an incsz) which means your most efficient method of contructing a loop in assembler is so that it ends on the variable being zero and changes by one for each iteration. Also optimization for speed and optimization for space are entirely different beasts.

    There is something vaguely akin to program slot in the SX but it is quite different, the entire space can be reached within a program unlike a BS slot, but there are restrictions such as you cannot execute a call to an address that has·the 9th bit of its address set, but·there·is a·simple workaround to this.

    Post Edited (Paul Baker) : 3/21/2005 2:59:08 PM GMT
    Last edited by ForumTools; 09-30-2010 at 08:55 PM. Reason: Forum Migration

  6. #6

    Default

    ok understood.. but im curious .. how does the basic stamp 2sx manage to allow programs to be stored in slots

    to clarify ..

    i CAN add an eeprom to my SX to store data...... ( i am storing many strings and such in the bs2sx )


    from your experience you have managed to write very serious code within the limits of the SX 2k limit ?

    am i correct in assuming that .. done correctly you can fit quite a complicated program even with SX/B code into the sx memory?

    i also assume that assembly mixed in there will allow even more code to be put inside ..


    ·
    Last edited by ForumTools; 09-30-2010 at 08:55 PM. Reason: Forum Migration

  7. #7

    Default

    duffling said...
    ok understood.. but im curious .. how does the basic stamp 2sx manage to allow programs to be stored in slots

    to clarify ..

    i CAN add an eeprom to my SX to store data...... ( i am storing many strings and such in the bs2sx )

    Yes, Serial EEPROMs can provide you with vast amounts of space for little money (128Kx8 ~$10-$20), a·few I/O pins at speeds that still runs circles around a stamp.


    from your experience you have managed to write very serious code within the limits of the SX 2k limit ?

    Yes, I have not seen anyone complain about lack of program space in an SX in the forums by experienced programmers since I became·active in the forums last July. Though I believe I read a while back·someone migrated to an SX52 for more code space when they found the·SX28 didn't have enough.·

    am i correct in assuming that .. done correctly you can fit quite a complicated program even with SX/B code into the sx memory?

    Yes, look out for the contest submissions that should be posted very soon, or check out Bean's SX-video display module.·

    i also assume that assembly mixed in there will allow even more code to be put inside ..

    Yes, SX/B is an unoptimized basic compiler


    Last edited by ForumTools; 09-30-2010 at 08:55 PM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts