Shop OBEX P1 Docs P2 Docs Learn Events
Program BS2 in C — Parallax Forums

Program BS2 in C

Martin_vLMartin_vL Posts: 18
edited 2007-10-03 19:15 in Learn with BlocklyProp
Hello,
·
I have a Basic Stamp 2 with the Board of Education. Now is my question if it is possible to program my Basic Stamp·in·C?
·
I think it is possible because there is a PIC uC on the BS2. But how can I program it?

Martin


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-03 16:10
    You can't program the Basic Stamp in C. The only language you can use is Parallax's Stamp Basic.

    The compiler takes your Parallax Basic program and converts it into a series of byte codes which are downloaded to an EEPROM on the Stamp. There's an interpreter pre-programmed into the PIC that reads this compiled program from the EEPROM and executes the byte codes.

    There are no provisions for re-programming the PIC. It can be done at Parallax, but not by the end-user. Part of what you're paying for when you buy the Stamp is the Basic interpreter.

    Post Edited (Mike Green) : 10/3/2007 4:19:04 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-10-03 18:28
    +1 to Mike.

    In theory, it would be possible to write a "not-quite-C" compiler (as has been done for the original Mindstorms package) which would output PBasic 'tokens'.

    In practice, this would be so tedious that it's simpler to use the Parallax IDE and PBasic directly.

    And yes, the BS2 PIC is a 16C57, so you CAN'T re-program the eeprom in it, and the in-PIC eeprom holds the Parallax PBasic run-time engine, so you don't really WANT to re-program that. Note that the BS2 holds its tokens in an on-module, but off-PIC, eeprom on the BS2 module.
  • pwillardpwillard Posts: 321
    edited 2007-10-03 19:15
    +2 Look at it this way... the PIC is already programmed with the equivalent of a Basic Interpreter. When you are talking to the Stamp, you are just interfacing with the Basic Token program permanently programmed on the chip that runs pre-written routines and not writing native uC code.

    Maybe you should look at the Arduino. It works similar to the Stamp but uses a C-LIKE language.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
Sign In or Register to comment.