picbasic and stamp
be80be
Posts: 56
I hear you can use picbasic with the stamp is that true and if so is there a way to change pbasic to picbasic
Comments
The Parallax Stamps are hybrid modules that include either a PIC microcontroller or an SX microcontroller pre-programmed with an interpreter for Parallax Basic. They also have EEPROM for storing the user's program (and possibly some data). The module also has a regulator, hardware for interfacing to a PC for programming, and sometimes a brownout voltage detector. The interpreter occupies the flash ROM in the microcontroller. It cannot be read from the microcontroller and it cannot be easily replaced with another PIC or SX program. If you do end up replacing the interpreter, the module is no longer a Basic Stamp, can no longer run Parallax Stamp Basic programs, and the original interpreter cannot be restored except by Parallax.
Compilers like PICbasic take a source program for a language similar to Stamp Basic and mostly compatible with it, and compile it into instructions for the PIC microcontroller. These have to be downloaded into the flash ROM in the microcontroller and replace anything already there (like the PBasic interpreter). The downloading process is completely different from that used by Parallax, requires different hardware and different downloading software. I'm not certain, but I believe the brown-out detector used in the BS2 (and others) even prevents the PIC from going into programming mode.
Post Edited (Mike Green) : 9/20/2008 11:37:30 PM GMT
Your first prototype (and buying the compiler) could cost around $500. But every board after that would use a $5.00 PIC instead of a $50 BS2. That's what using the BS2 buys you -- an absolutely reliable, easy to interface processor for $50.
You use it to write programs for Microchip's PIC microcontrollers. This is not the same as the Basic Stamp.
PICbasic's programming language looks very much like Parallax's Basic. It's very similar, but it's not identical.
You can take some programs written for Parallax's Basic Stamp, compile them with PICbasic and download the
result (using a PIC downloader) to a PIC microcontroller. It will likely operate the same, but is not guaranteed
to do so. You may have to make some changes to the program to make it work on a PIC microcontroller. Some
programs written for a Basic Stamp won't work when compiled with PICbasic for a PIC microcontroller without
major changes.
I have a copy of PICbasic. I've used it for some small projects. It works fairly well, but it's not the same as
Parallax's Basic. It's certainly not as easy to use. On the other hand, PICbasic has some features that are not
in Parallax Basic and, with it, you can use some special features of some of the PIC microcontrollers. For example,
Microchip includes independent UART units in many of their PICs. These have buffers and avoid the problem in
Parallax Basic where characters are missed because the Stamp is doing something else and not waiting for an
input character. PICbasic can use these UARTs for the SERIN and SEROUT statements. Some PICs have a lot
more memory, both program and data, than the Basic Stamp. PICbasic can make use of this extra memory.
Post Edited (Mike Green) : 9/21/2008 4:27:59 AM GMT
Post Edited (be80be) : 9/21/2008 4:43:57 AM GMT
The BS2 has been carefully engineered to be a very reliable pic-based module. But the only way to program it is with the BS2 PBasic IDE from Parallax. The resulting code is converted into "tokens", which are downloaded into the BS2 eeprom by the IDE. The BS2 run-time (burned into the on-BS2 PIC16C57) then executes those tokens.