Shop OBEX P1 Docs P2 Docs Learn Events
From BS2 to PIC — Parallax Forums

From BS2 to PIC

vaclav_salvaclav_sal Posts: 451
edited 2006-09-10 09:12 in BASIC Stamp
Can anyone direct me to / recomend·an article covering moving the assembly code form BS2 to standalone PIC processor?
I am going to Google for such thing· but would like to get some opinions also.
Thanks

·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-09 21:24
    Check out <www.melabs.com>. I've used their PicBasic Pro Compiler before. I prefer to use the Stamp, but sometimes the PIC has just the right hardware or speed (because you can mix assembly and PicBasic).
  • vaclav_salvaclav_sal Posts: 451
    edited 2006-09-09 21:56
    Thanks Mike.
    nice but somewhat backwards.
    I already have a debuged code written in Parallax BASIC and " burned into" BS2 PIC in an assembly. All of these tools ( I checked others ) require to rewrite the code either in their BASIC version or an assembly.
    I just want to "burn" my code into another PIC.
    It should not be that complicated. I'll do some more research
  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-09 22:14
    The BS2 PIC only contains the PBasic interpreter. Your debugged PBasic interpretive (not PIC assembly) code is in an EEPROM on the BS2 substrate. You cannot run this code without another Parallax PIC containing the PBasic interpreter. Parallax does sell their PIC separately (see their website under OEM Stamps) and you would need this plus an EEPROM with your program in it plus a resonator or crystal for the PIC.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-09-09 22:21
    vaclav_sal -

    Just to expand on what Mike said, there is NO assembly or machine language for PBASIC, the language used for the Parallax Stamp. The only thing which is executable is a set of tokens, and those tolens (representitive of your program) are INTERPRETED and run by the PBASIC run time engine.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • vaclav_salvaclav_sal Posts: 451
    edited 2006-09-09 23:04
    Thanks guys, just came to same conclusion. Feel pretty stupid that I did not think about it before I posted this.
    I guess my PBASIC needs to be rewritten in PIC BASIC using other development tools.
    I'll keep googling and searching!
    Maybe the OEM is the way to go - or buy another BS2 on e-bay!
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-09-10 00:18
    If you're looking for an alternative to the BS2, and you want to stick with Basic, you might want to check out the Parallax SX chip. It can be programmed in assembly or SX/B Basic.

    Note that SX/B Basic is NOT the same as PBasic, although there are similarities. It is compiled vs. interpreted, and like the other Parallax developed tools, it is freely downloadable.
  • vaclav_salvaclav_sal Posts: 451
    edited 2006-09-10 07:46
    Kevin - where did you find this info about programing SX in an assembly on Parallax site??
    So if it is compiled do they refer to 4000 lines of assembly code or PBASIC in their documentation?
    I am not trying to split hair but in my case I really need full 2K of PBASIC tokens to make one of my applications (DDS ocillator with LCD display) work.
    Thanks for your help
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-09-10 07:58
    vaclav_sal -

    If that's your only problem, switch to the BS-2SX or any of the larger Stamps which have 8 x 2K of programming space. You then just need to know how to structure your program to use this banked memory, as it's not contiguous.

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 9/10/2006 11:42:25 AM GMT
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-09-10 09:12
    Okay, there may be some miscommunication here.

    If you look at the comparison sheet that Parallax has on their site for the Stamp modules, you'll notice that they are built using 4 different microcontrollers:

    1. Microchip PIC16C56a - used on the Rev. Dx / BS1-IC
    2. Microchip PIC16C57c - used on the BS2-IC
    3. Ubicom SX28AC - used on the BS2e-IC and BS2sx-IC
    4. Ubicom SX48AC - used on the BS2p24-IC, BS2p40-IC, BS2pe-IC, BS2px-IC, and Javelin Stamp

    On all of these stamp modules, the microcontroller itself is pre-loaded with a language interpreter. The Basic Stamps have the PBasic interpreter, the Javelin Stamp has a Java virtual machine. These pre-loaded chips are configured in such a way that you can't reprogram them, so although identical to their unprogrammed counterparts, they are specialized units.

    If you wanted to use a PBasic interpreter chip in your own hardware design, you can purchase them pre-programmed from Parallax. As mentioned, that's all it will/can ever be. If however, you wanted to use a raw, unprogrammed, reprogrammable PIC16C56a, PIC16C57c, SX28AC, or SX48AC in your design, you would purchase them from a supplier of your choice.

    Since your original question pertained to porting from PBasic to a PIC chip, such as perhaps a PIC16C57c, I suggested the Parallax SX microcontroller, which you may have confused with the BS2sx Stamp Module.

    The BS2sx Stamp Module can only be programmed in PBasic. In the comparison document, the 8x2k ~4000 inst. means that the module has 8 memory banks of 2k that can hold a total of ~4000 PBasic instructions. The original BS2 has 1 bank of 2k for ~500 instructions. So if you are using the original BS2, want to continue using PBasic, and need more program space, you can use any of the following: BS2e, BS2sx, BS2p24, BS2p40, BS2pe, BS2px.

    If you want or need more performance than PBasic can provide, and are considering moving to a Microchip PIC, then you should also take a look at the Parallax SX microcontrollers, which are very similar to some Microchip PICs. It's this line of products that can be programmed in assembly, as well as compiled Basic. These are the same as the Ubicom chips mentioned above; Parallax took over the product line.

    Here is the link to the SX line of products: www.parallax.com/sx/index.asp
    Here is the link to the SX/B compiler: www.parallax.com/sx/sxb.asp
Sign In or Register to comment.