View Full Version : Very general question regarding microcontrollers
04-18-2007, 02:37 AM
I know the Basic STAMP is based upon a PIC microcontroller, and includes supporting circuitry including EEPROM, RAM, the clock, etc.
I've not been able to find a statement (that's clear enough to penetrate my thick skull) that explains where the Basic _interpreter_ comes from.
Is the PIC in a Basic STAMP a _custom_ version of a PIC, with ROM added to the DIP--ROM which includes the interpreter?
And similarly for competing products, based on other microcontrollers, that use other high-level languages?
As a follow-up to that...if something like the Basic STAMP is used in a prototype for a commercial product, then for the Production version, would one typically switch from the Basic STAMP to a "plain" microcontoller (which does not include a language interpreter) to reduce cost of goods?
Thanks much for any info/opinions!
04-18-2007, 02:47 AM
The Basic Stamp Interpreter in stored in the program memory of the PIC. The Basic Stamp Program (The one YOU write) is stored in the EEprom.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
04-18-2007, 02:50 AM
For all intents, you've got it figured out. I expect someone else will be able to jump in with some finer details.
As for production units, there are stamps available (I believe) as "kit of parts" to reduce costs or to use your own board. Many folks also use the SX and propellor in both hobbiest and commercial units.
I stick to the stamp modules even in production units due to ease of changing things in the field and the ease of moving up the range ( BS2 to a BS2sx to a BS2px) if more horsepower is required. Same socket, same programming tool, much the same code.
In terms of other similar products, you'll never get a better Forum for support than this one.
04-18-2007, 11:31 AM
The only thing you have to buy from Parallax is the interpreter chip (http://www.parallax.com/detail.asp?product_id=PBASIC2C/P). Every other part needed can be sourced from wherever you want.
You could use the BS-2 OEM board (for example) to load a program into the eeprom then transfer that eeprom to another circuit with a different BS-2 interpreter chip and it would work.
There is more info on this page (http://www.parallax.com/html_pages/products/basicstamps/basic_stamps_oem.asp).
04-18-2007, 12:14 PM
Thanks, all, for the information. The responses sort of re-crystallize my initial question, so I feel compelled to double check:
If I buy a Parallax intepreter chip (of course I already _have_ done that; I've had a great time experimenting with it and will continue to do so), is it not the case that I'm buying a PIC microcontroller PLUS some extra ROM containing a Basic interpreter, all in a single DIP?
For example, if I buy a PIC from a supplier such as http://www.chipcatalog.com/Cat/793.htm or http://www.futurlec.com/ICMicrochip_PIC16.shtml , I'm not getting a chip which includes a Basic interpreter--I'm getting a microcontroller with a 30-odd instruction set. Or am I incorrect?
I guess what this boils down to is: Parallax is adding Basic to a PIC, correct? And in the same way (I assume) other companies might add other high-level languages such as C--but a "plain old" PIC does not include a high-level language interpreter, right?
I should emphasize that I'm not "comparison shopping" or trying to build a Basic STAMP "from scratch" or anything--I'm just trying to complete my understandiing of this cool little piece of hardware.
04-18-2007, 12:37 PM
A "plain old" PIC as it comes from the chip foundry usually has an electrically erasable flash memory on the chip that's erased except for areas that Microchip may use for testing. The PIC used in the BS1 and BS2 Stamps is an older type that can either be programmed once by the buyer (Parallax in this case) or comes with masked ROM which is programmed permanently at the chip foundry. The later model Stamps use a microcontroller made by Scenix which has an electrically erasable flash memory.
Parallax adds a Basic interpreter to the PIC (or SX ... Scenix) processor one way or another. If you don't buy a pre-programmed processor from Parallax or its dealers, you get a plain PIC without the Basic interpreter or any "high-level" language. Now PICs can be programmed in Basic using a compiler that translates the Basic into PIC instructions, but these compilers tend to produce relatively inefficient code. It's faster than using an interpreter (like Parallax's Basic), but slower than hand-coded assembly language.
04-18-2007, 12:49 PM
Thanks for the detailed answer, Mike, and thanks again to everyone who helped me understand this!