Reburn STAMP BASIC

Hi, I was gifted a stamp professional development board, the problem is I HATE basic, Is there a way to reburn the bootloader with arduino optiboot?? Thanks!

BASIC Stamp is a Microchip PIC microcontroller with a BASIC interpretive runtime on it. There is no Arduino environment for PICs - what you are asking for is not possible because the Arduino software outputs machine code for certain Atmel AVRs (or certain Atmel ARM chips in later versions), not for PICs. While I think you are right about BASIC Stamps not being particularly interesting, PICs themselves are great chips, they just use a different toolchain (IDE, programmer, etc.) If you want to use the Arduino IDE and Arduino's built-in programmer which is right on the board, you should get an Arduino, or a cheap clone if you want to spend the least possible amount of money, though I recommend the real deal from Amazon which is not all that expensive:

If you want to reuse the PIC itself that you already own and compile programs for it in C or C++, you want to download the free version of Microchip's compiler (MPLab X) for it and then you will need a programmer. You actually can use an Arduino as a PIC programmer. But that would be a more advanced project for later. The programmer most people use is called PICKit3 and they are around $45. Some clones on Ebay are less.

Hi, thank you so much for responding! Is arduino programming language (C++) exactly how c++ syntax is? I.E I go to MPLABX and do the following

void setup()
{
  pinMode(ledPin, OUTPUT);      
}

would it work? Thank you!! :slight_smile:

ilovearduinosomuch:
Hi, thank you so much for responding! Is arduino programming language (C++) exactly how c++ syntax is? I.E I go to MPLABX and do the following

void setup()

{
 pinMode(ledPin, OUTPUT);      
}



would it work? Thank you!! :)

Yes that's the way you set up a pin to be an output, instead of using MPLAB you use Arduino IDE, it's similar to java and c++. Buy an Arduino and sell your basic stamp, it's not worth IMO (gotta hate basic too xD). (It was 10 year ago, this is the Arduino era).

ilovearduinosomuch:
Hi, thank you so much for responding! Is arduino programming language (C++) exactly how c++ syntax is?

Yes.

(But using std::vector/std::string/etc. isn't a good idea when you only have 2K of RAM....)

ilovearduinosomuch:
I.E I go to MPLABX and do the following

void setup()

{
  pinMode(ledPin, OUTPUT);     
}



would it work? Thank you!! :)

Yes, but why don't you use the Arduino IDE?

ilovearduinosomuch:
Hi, thank you so much for responding! Is arduino programming language (C++) exactly how c++ syntax is? I.E I go to MPLABX and do the following

void setup()

{
 pinMode(ledPin, OUTPUT);      
}



would it work? Thank you!! :)

The responses above are not correct. I think some signals are getting crossed. pinMode is not available in MPLABX.

If you are programming a PIC in MPLABX then the code you gave in your post, which is correct for Arduino, would not work for MPLABX. pinMode is an Arduino function and is not part of MPLABX at all. Unfortunately, though both the Arduino IDE and MPLABX both use C/C++, the functions that deal with device specific calls like setting up the digital pins and ADC are totally different. You can't take Arduino function calls and expect them to work in MPLABX - they aren't there. Only the ANSI C/C++ stuff like variable deceleration, control structures, etc. exist in both environments. If you want to take that PIC and program it in MPLABX, it is a completely different programming environment. But it isn't that complex. It only took me a couple of days to figure out the high-level differences between Microchip and Atmel processors and I can program both so I am assuming you can too. But, to get the advantage of the Arduino environment (the major advantage is simplicity), you really need an Arduino.

ilovearduinosomuch:
Hi, I was gifted a stamp professional development board, the problem is I HATE basic, Is there a way to reburn the bootloader with Arduino optiboot?

Hey, look, you have a STAMP kit. Use it to learn everything about the PIC, using the PIC toolkit. That's what it is for.

Don't get yourself confused between different MCUs. So-called "STAMP BASIC" is not actually original BASIC, but a simplified "higher" level language which happens to use the BASIC keyword structure. You don't "hate" it, just practice with it, see what you can do with it.

Your presence here tells us you have also been experimenting with Arduinos already, so just continue to use Arduinos, and also with PICs. Each will do what it will do, it is to your benefit to learn a few different languages.

lol, guys I have three arduino uno r3's, two redboards, and one mega. I have a lot of arduinos, they just gave it to me as a gift and it is a nice development board (I have found none similar to the professional development board for basic stamp for arduino). And I figured it would be nice to use and develop with. I would just prefer to use c++ not basic programming.

ilovearduinosomuch:
lol, guys I have three arduino uno r3's, two redboards, and one mega. I have a lot of arduinos, they just gave it to me as a gift and it is a nice development board (I have found none similar to the professional development board for basic stamp for arduino). And I figured it would be nice to use and develop with. I would just prefer to use c++ not basic programming.

Why don't you just program it with PIC C compiler (CCS compiler). It works with C libraries.

Is it c, C#, C++? I am pretty sure it's c++ right????

ilovearduinosomuch:
Is it c, C#, C++? I am pretty sure it's c++ right????

Microchip does not support C#. Apparently C++ is only supported on PIC32 devices. C is the default. More info here. It's free to download so I don't see any reason why you wouldn't:

I was gifted a stamp professional development board

There's not enough information there to tell exactly which stamp variation you actually have (there are a bunch.) Many of the Basic Stamps are based on one-time-programmable chips that you won't be able to re-program even given a current PIC development device. Even if you have a board with a flash-based chip, none of the Stamp boards are designed for using as a general purpose development board - there is no connector for uploading microcontroller code, nor any debugging port access. (just the loader for the tokenized basic-like language used by the stamps, which is stored in EEPROM external to the microcontroller.)

And that's not how you should use it anyway. Keep in mind that the Basic Stamps are essentially the "prior generation" of "easy-to-use" microcontrollers (compared to Arduino.) They're interesting and relatively powerful devices in their own right, and significantly and interestingly different from an Arduino. Since interpreting bytecodes loaded from serial eeprom is inherently rather slow (a BS2 executes about 4000 statements/second, compared to ~1M for an arduino), the stamp moves a lot of the "heavy lifting" into well thought-out "statement" definitions (some of which have been copied into arduino (shiftout comes to mind, and BS has a bunch of useful statements that are not present in arduino.) You should give it a try even if you dislike basic; since code tends to be statement-selection (library call) intensive, the language doesn't really bare much more resemblance to traditional basics than, say, a bash shell script.

If you really would rather program bare PICs (in assembler or C), you'd be better off trading your stamp for one of the Microchip starter kits. Or get a Chipkit (PIC32, arduino sorta-compatible) and use that. (a lot of people would urge you to skip the 8bit PICs entirely; the 16 and 32bit PICs are a lot more modern-programmer-friendly.)

westfw:

I was gifted a stamp professional development board

There's not enough information there to tell exactly which stamp variation you actually have (there are a bunch.)

I think he is talking about this:

http://www.parallax.com/product/32111

Nice board - I'd keep it. Nothing from stopping you from plugging in any DIP microcontroller. In fact, you can plug in Atmel chips like the ATMEGA328P and use everything here except the Stamp with the Arduino environment, you just have to use "Arduino As An ISP" (search on that) or buy one of Atmel's very reasonable and inexpensive programmers. Or you can buy a PIC programmer and use it with PICs or even reprogram the Stamp <- I see this statement may not be accurate now. I didn't know that Basic Stamps were based on OTP memory.. You could also easily adapt an SOP microcontroller for this board with a cheap adapter.

Anyway, nice board. The board is a lot better than the Stamp. I'd just use one of my Arduinos as an ISP and program the chip on the board. This thread claims an Arduino can be used to program PICs too. So you could pic up a few PICs cheap and program them that way after compiling applications in MPLABX.

http://forum.arduino.cc/index.php?topic=92929.0

http://www.parallax.com/product/32111

Note that while this board would work pretty well as a general purpose prototype board, it's designed for using the Propeller chip, which isn't even a Basic Stamp...

westfw:

http://www.parallax.com/product/32111

Note that while this board would work pretty well as a general purpose prototype board, it's designed for using the Propeller chip, which isn't even a Basic Stamp...

Maybe I posted the wrong one. This one is their "professional development" board for the Stamp. But, I can't find a product page for it, just this documentation.

The board itself and all the peripherals is similar, but not identical, to the one I posted earlier. Yeah, a little confusing.

ilovearduinosomuch:
Hi, I was gifted a stamp professional development board, the problem is I HATE basic, Is there a way to reburn the bootloader with arduino optiboot?? Thanks!

send a photo or a link to the board.

I thought the mini was pin comparable with the BS2 ?

if that is the case, your solution may be a $2.99 purchase on e-bay and a free download.

if the board is not pin compatible, then create an interface.

the beauty is that the baord is designed to work with the same signals.