View Full Version : picbasic and stamp

09-20-2008, 09:45 PM
I hear you can use picbasic with the stamp is that true and if so is there a way to change pbasic to picbasic

Mike Green
09-20-2008, 10:17 PM
No. You can only use Parallax's Stamp Basic. You heard wrong or the other person didn't understand the difference.

09-21-2008, 05:18 AM
This is what it said at picbasic site BASIC Stamp II compatible, Direct access to any pin or register, automatic page boundary handling past 2K, Real If..Then..Else..Endif, Built-in LCD support, I2C instructions to access more external devices including serial EEPROMs.

09-21-2008, 05:44 AM
I believe what they mean is the source code languages are similar enough to be fed into the compiler, not that it will produce an output that can run on a BS2. You can download the manuals from the website. I suggest you read section 10 of the PBC pro manual where it goes into detail on the differences in the languages and how they execute.

Mike Green
09-21-2008, 06:27 AM
This has come up several times recently.

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

09-21-2008, 06:44 AM
So, yes, if you bought PicBasic, and bought an off-the-shelf PIC (16F876 is nice) and bought an off-the-shelf board to put it in, and bought an off-the-shelf programmer for it (they're not expensive) then you could build a board that ran PBasic-ish code in your own PIC.

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.

09-21-2008, 11:03 AM
I'm not looking for a stamp replacement. What I'm asking is if any of you have used picbasic pro to write programs for the stamp 2 picmicro on there website said it works with the basic stamp2. Before i pay 299.00 for it just for pic I would like to no? I like the easiness of using pbasic with the stamp and picbasic is like it so if it works it would be a good buy for me

Mike Green
09-21-2008, 11:19 AM
It does not work with the Basic Stamp. You cannot use PICbasic to write programs for the Basic Stamp.
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

09-21-2008, 11:24 AM
Ok I read picbasic pro It's pbasic like but its only for pic it has code like but not the same. I will let you use your basicstamp2 pbasic code by adding your stamp variables

Post Edited (be80be) : 9/21/2008 4:43:57 AM GMT

09-22-2008, 02:22 AM
+1 Mike Green. No, you absolutely can not write a program using PICBASIC, and download the result to the BS2.

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.