Shop OBEX P1 Docs P2 Docs Learn Events
More Program Code Memory? — Parallax Forums

More Program Code Memory?

JSWrightOCJSWrightOC Posts: 49
edited 2007-09-05 02:01 in General Discussion
Greetings,

I'm new to the forums, but I have been using BASIC Stamps for a few years now. My projects are starting to outgrow the Stamp, and I am looking curiously at the SX microcontroller...specifically the SX28...but my main concern is the amount of programming memory available, listed as 2k 12-bit words (opcode instructions). Though I am new to the SX (I don't even have my SX dev kit in yet) this doesn't sound like very much to me. Correct me if I am wrong in thinking this is a limitation.

The second part to this post is, if the program EEPROM is not enough for my needs, is there any way I can execute opcode on an external EEPROM? I'm already planning on putting as much other information as possible (text messages and other data used in the user interface) on an external EEPROM, but even this might not be enough.

I am welcome to any tips or suggestions offered!

Comments

  • BeanBean Posts: 8,129
    edited 2007-09-04 18:32
    Since you are coming from the BASIC stamps, I'll assume you will be using SX/B.
    You need to put instructions that generate alot of code into their own subroutines.
    You can actually get a good bit of code into 2K words.

    If you use the SX48, you'll get 4K words of code space, and alot more array space.

    You can put data on an external EEPROM, but not code. The SX can only execute code located in it's internal flash memory.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The first rule to being successful is "Learn from your mistakes",
    The second rule is "Be willing to make mistakes"
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • JSWrightOCJSWrightOC Posts: 49
    edited 2007-09-04 18:48
    Well, thats sorta what I was thinking, I just wanted to make sure. The SX48 looks tempting, however I don't have the facilities to easily solder SMT parts. I can do it, it's just very tedious work, assembling boards with surface-mount components - so that kind of limits me to the SX28.

    Yes, I will start out using SX/B, but I would like to transition to writing some of my programs in ASM. I have a lot of homework to do!

    When you say to put instructions that generate a lot of code into their own subroutines, what exactly does this accomplish? I'm using GOSUB and looping instructions extensively already, and re-using routines everywhere I can. Is there a rough translation of code space usage between a PBASIC program on a BS2 and SX/B on an SX chip?
  • JonnyMacJonnyMac Posts: 8,957
    edited 2007-09-04 19:31
    One of the many great things about SX/B is that it lets you see the assembly output and then cleanly pop in assembly sections as you need. I've learned a lot by taking the compiler's output, tweaking it, and then putting it back in between ASM and ENDASM.
  • John CoutureJohn Couture Posts: 370
    edited 2007-09-05 02:01
    Also don't forget the SX48 Prototype board! You don't have to do any soldering and it includes the voltage regulator. Just attach a connector to the board and it becomes a daughter board to your larger creation. And at $10 each they are a steal!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
Sign In or Register to comment.