Shop OBEX P1 Docs P2 Docs Learn Events
.bs2 to .hex or bs2 to asm — Parallax Forums

.bs2 to .hex or bs2 to asm

DemoncleanerDemoncleaner Posts: 17
edited 2006-03-31 02:02 in BASIC Stamp
Does anybody know a good compiler from bs2 to asm or hex??
Because i couldn't find any hex or asm file with the Basic Stamp...
I also tried CD-Lite but the "serout" command doesn't wrork properly.

Comments

  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-03-30 13:47
    Demoncleaner said...
    Does anybody know a good compiler from bs2 to asm or hex??
    Because i couldn't find any hex or asm file with the Basic Stamp...
    I also tried CD-Lite but the "serout" command doesn't wrork properly.

    Have you looked at PicBasic Pro?
  • DemoncleanerDemoncleaner Posts: 17
    edited 2006-03-30 15:31
    yes , i've allready try the pbp compiler but i couldn't make bs2 to asm or hex
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-03-30 15:49
    Well, the BS2 doesn't USE asm or hex, the PBasic compiler compiles your PBasic source code into PBasic 'tokens' (basically, an integer for each PBasic keyword). These tokens are then downloaded into the BS2 eeprom.

    Then, when you reset your BS2, the run-time environment programmed into the PIC 16C57 reads the tokens from the eeprom, and runs library routines in the run-time environment to implement the actions necessary to do the keywords.

    This allows you the best of many worlds. The Parallax proprietary run-time environment is safe from prying eyes. The 'tokenized' version of the program is MUCH smaller than an equivalent compiled version. You get a very fast recompile/redownload/rerun cycle. You get a device that runs at 2,000 PBasic instructions per second, which is fast enough for most purposes. You get very high reliability, because the run-time library takes care of lots of nitty-gritty detail which would bite a 'C' or assembler programmer. You get very low power use, with on-module brown-out protection, clock generation, and memory support.

    The main drawback of this approach is that a compiled version would run much faster, and you must use the PBasic language to implement your code. And with the PIC-57 you only get 26 bytes of RAM.

    However, there's LOTS of off-the-shelf PIC compilers (at a higher price). There's only a few PIC-based modules like the BS2. And nobody has the level of support provided by Parallax.

    Now, Parallax HAS supplied their tokenizer in DLL form -- perhaps you could write your own PBP compiler to feed their tokenizer PBasic source.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-03-30 17:12
    Demoncleaner -

    The PBASIC Stamp IDE can and will produce "object code", if so instructed to do so. This "object code" can be loaded in the field by a user, and is NOT human readable, nor easily "hackable".

    This is NOT object or hex code in the classical sense (the native, machine language output of a compiler or assembler), as it can ONLY be processed by the PBASIC Stamp system, or by third party tools which adhere to the PBASIC Stamp system protocals. The "object code" is also platform dependent, meaning you can not generate "object code" specified for a PBASIC Stamp BS-2 and have it operate properly on a BS-2SX.

    The option for doing this can be found as follows. Fire up the PBASIC Stamp Editor/IDE, then use the following sequence:

    FILE ==> Generate Object code

    Although I didn't actually check it, I suspect the PBASIC Stamp Editor/IDE HELP function may provide additional information on this feature.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • DemoncleanerDemoncleaner Posts: 17
    edited 2006-03-31 00:49
    I·tried it and the object· code file i produced isn't correct. I've load it on epicwin (because i'm using the pic17f84) and i had no results.I think its better to load a hex file thats why i need the compiler.

    Did anyone try the serout command with hyper terminal? Because when i try it i dont get nothing.

    Please send me at least a bs2 code that sends correct some letters in hyper terminal. (The samples from the basicstamp does not match with· CD-Lite)

    I·actually didn't know anything about tokens. Maybe i could compile them into hex. If there is a way please inform me.
  • ForrestForrest Posts: 1,341
    edited 2006-03-31 01:30
    The Parallax Basic Stamp IDE produces compiles a Basic program into tokens and sends them to a Basic Stamp. The tokens are executed by the Basic Stamp Interpreter. Note a Basic Stamp programs will only run on a Basic Stamp such as these www.parallax.com/html_pages/products/basicstamps/basic_stamps.asp or a booad of your own design that incorporates a Basic Stamp Interpreter, the correct clock crystal and a specific I2C EEPROM - all of which are available here www.parallax.com/html_pages/products/basicstamps/oem_components.asp

    Parallax Basic does not run a Microchip PIC chip or any other processor.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-03-31 02:02
    Yes, Demoncleaner, as we keep trying to tell you, the PBasic environment is NOT a general purpose PIC environment. You can only load PBasic code on a BS2, or an "OEM" design using a Parallax Interpreter chip.

    However, it's still a pretty good, very reliable, and simple platform.
Sign In or Register to comment.