Shop OBEX P1 Docs P2 Docs Learn Events
PBasic on BS2px vs. SX/B on SX48/52 — Parallax Forums

PBasic on BS2px vs. SX/B on SX48/52

Kevin WoodKevin Wood Posts: 1,266
edited 2005-10-11 17:29 in General Discussion
I was wondering how PBasic for the BS2px compares feature-wise to SX/B on the SX48/52 chips, say for the protoboard? Without reverting to assembly on the SX, how much of the capacity of the SX chip can be readily accessed with each version of basic in the respective IDEs?

Another question, has there been any brainstorming on a hybrid stamp that would allow you to bypass the PBasic interpreter and program directly in assembly, perhaps with conditional compilation?

Thanks.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-10 18:14
    Kevin,

    ·· The commands for the BS2px allow the most control of the SX specific features, however you must bear in mind that the BASIC Stamp's PBASIC is still an interpreted language and cannot include assembly.· The SX/B is not being interpreted...It's straight assembly in the end.· You also get access to the interrupts, even in SX/B, and you can include in-line assembly in the SX/B as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-10-10 19:37
    Kevin Wood said...
    Another question, has there been any brainstorming on a hybrid stamp that would allow you to bypass the PBasic interpreter and program directly in assembly, perhaps with conditional compilation?
    This isn't possible because the programs you download to the stamp are stored in an external eeprom, this means it can only be interpreted because the microcontrollers Parallax uses are Harvard architecture (separate program and data space), the microcontrollers cannot execute commands external to the chip (only code stored in the onboard flash). And that is where the interpreter resides, and if you write into that space you will erase over the interpretor, permanently disabling the Stamp from acting like a Stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2005-10-10 20:03
    Thanks for the replies.

    Chris,

    I started wondering after looking at the BS2px datasheet; it seemed that the BS2px gives alot of the features of the SX48, without the need to revert to assembly.

    Paul,

    Initially I was thinking that the PBasic interpreter was on the external eeprom, and could be bypassed. But given that the interpreter is internal to the SX chip on the stamp, would it be possible to store assembly object code in the eeprom, and have the stamp recognize it as assembly, and run it directly, bypassing the interpreter?

    I'm not trying to reinvent the wheel here, it just seemed like a neat idea. As I stated, originally I thought the interpreter was seperate, so I figured why not have two eeproms on the stamp, one for PBasic, the other for assembly, and using the appropriate one based on the code.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-10-10 20:14
    <replacement post> the only way you can execute assembly language from an external source is by interpreting it (read the code then jump to a duplicate instruction already stored in the SX), this would take all if not more than the total amount of program space in the SX, leaving no space left for the PBASIC interpreter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-11 00:10
    Kevin,

    ·· You are correct to an extent...The px gives you access to many SX features, but some things like the timers and the ISR are unavailable and/or used by the interpreter.· And then there's the sheer speed of running 75 million instructions per second.· On the other hand the BS2px is our fastest BASIC Stamp and I have found it useful in a few places where a BASIC Stamp was preferred but may have been passed over due to being slightly slower.· The BS2px can often take up the slack and increase development time, although I'm sure a colleague of mine (Jon Williams) will say the SX/B is quickly taking up slack in that department too!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-11 17:29
    SX/B is a great tool and getting better, but as Chris points out if you would rather trade cost for quick development time, the BASIC Stamp family is still king of the castle. As engineers we are always faced with these decisions -- whatever you decide to do we will be there to assist.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.