[Add to or Correct This Page]
Microcontrollers
If you truely want to get physical, chances are you are probably going to have to get down and dirty with circuits and Microcontrollers. For your trouble you will be rewarded with and expanded view of what computers can do and where they can do it and ultimately of what computing is. Microcontrollers are tiny cheap computers that have great capababilities for sensing and controlling the events in the physical world. They are useful for cheaply embedding a little memory, a rule, a communication channel or anything that computing offers into almost any object no matter how small, inexpensive or mobile. They are also used as the to add limbs to regular old multimedia computers which tend to have a an interface into the physical world that is limited to keyboards, mice and monitors.
This page will help you pick a microcontroller. After that you will have to:
- Go [shopping] to equip your electronics laboratory.
- [Start up] your microcontroller.
- Connect up a few components into a [circuit]
- Write a short [program]
Level
--As with software development you can work at a higher level where things are easier, more abstracted into human language, or you can work at a lower level where things are more difficult because they are more in a computer language. The tradeoffs are similar. At a higher level you spend more time on concept and less time on technology. Your development time is less (unless you are doing endless work arounds), but you can't always extract everything out of the technology and mass production and distribution is difficult. At a lower level, your development time is much slower, but you can take the machine to its limits, and things might be cheaper to mass produce.
- High Level (eg.Making Things’s Teleo system, Infusion Systems’s I- Cubed, Electrovoce’s MIDITools, Ezio) You can buy boxes that can do the most popular capabilites like digital and analog i/o but hide most of the wires and electrical components from you. You get a couple of screw terminal that to which you attatch switches or potentiometers. They cost a couple of hundred bucks but will save you a lot of time if you are pretty clear about having very simple needs. The truth is that as long as you are going through the trouble to do any wiring at all you you might just as well use the mid level chips which cost a lot less and give you more flexiblility.
- Middle Level (eg Basic Stamp, BX, Basic Atom). This is recommended for most beginners. Basically these mid level modules are training wheels for the lower level chips they contain. You have to program but in a friendly language like basic, using a single piece of software that gives you feedback very quickly. They are a little slower to execute than the lower level chips can cost much more, at least $30 per module. The supporting circuitry for the lower level chip is mostly included in the module. You still have to build your own programming cable and power supply but that is worth know how to do anyway. You can avoid making the power and programming connection by purchasing accessories like "demo boards" make these modules feel like higher level solution with the same advantages and drawbacks. We suggest that you just buy the chip itself, download the manual and the programming software for free, and connect cables for programming and power directly into a breadboard.
- Low Level (eg. PIC chips, SX chips, AVR) These are getting easier and easier to work with but you still want to stay away from them if you are a beginner without much support. You have to do a little more circuitry yourself in terms of adding a voltage regulator and a timing crystal but not too bad. Now they make compilers in frendly languages like C and Basic so you don't have to go all the way down to assembly. You can by reprogramable "Flash" chips so you don't have to screw around with erasers or emulators. The problem with these chips is that getting the program from the editor into a chip running in the circuit usually involves a couple of pieces of software and hardware. You might edit in one program, compile in another ($299), download to the chip in another. This is all compared to the single key stroke typical of the mid level solutions. You usually need a piece of hardware called programmer($49) to put the program into the chip. You then either need a cable to run from the programmer into your circuit ($29) or you have to physically transfer the chip from the programmer to your circuit. You can put a special "boot loading" program into your chip to avoid this whole hardware set up but many people find them unreliable. The great thing about this level is cost of mass production, as little as $1 per chip, and the speed of execution, and they are incredably fast to execute. The downside that the cost of a development environment if rather high, a couple of hundred dollars and your development cycle will be slow. As far as low level chips have come in ease of use they still have might make sense in a school or a club where the costs of the development environment are shared and their is a support system to help people through the tricker bits. Working with PICs is the equivalent of using C or Java in software development.
Criteria for Choosing a Microcontroller
- Programming Environment --what type of machine with what kind of ports do you need to program it, in what language eg Basic, Assembly, Java, C. Are their multiple pieces of hardware. Do you need programming hardware. How much does it cost.
- Price of the Chip, of the initial development chip and then how much to reproduce the design a million times.
- Digital I/0 --number of lines of digitial input and output
- Analog In --number of lines of Analog to Digital converters, speed and resolution of the measurement. The Basic stamp has no analog inputs but you can fake it for some analog sensors.
- Analog Out --ability to provide analog outputs. are their dedicated analog outputs that maitain the output while the microncontroller does other things.
- Speed of Execution -- Is it interpreted (slow) or compiled (fast).
- Amount of Memory --how big can your program be, how many variable you can use, how much data can you store
- Supporting Knowledge Base -- are their books, news groups, web pages, friends to help you figure things out.
- Compatable Product Line --can you add on boards to do things like control stepper motors or telephone lines. Often these boards are expensive but they just snap into place without you making any special circutry. If your time is worth anything then these boards are a good buy.
- Physical Size -- how tiny is it.
- Power --can they run on batteries and for how long.
- EPROM -- ability to keep a program in memory after power has been removed </UL>
- Basic Stamp http://www.parallax.com This is the orginal mid level module, and probably has the biggest user base. We used it as the basis for our physical computing classes for years. It’s simple to learn, reliable, and there are tons of examples available online. However, it has some limitations. Until recently, the basic stamp they had an annoying if statement in their basic but that has been fixed. Parallax also offers a chip programmed using Java. The Basic Stamp uses an interpreter means that the text of your program is actually stored on the chip, and the chip interprets the program line-by-line as it’s run. This makes it easier to use but the slowest in execution speed than the other modules. For most physical computing projects this is not a problem, but occasionally, in complex projects, we’ve hit the speed limit on the BS-2. Finally, the BS-2 has no analog-to-digital converters on the module. Analog in must be done using a resistor-capacitor circuit, and measuring the time the capacitor takes to discharge (RCTIME command). This is slower than an ADC, and limits you to sensors that can produce output that works with the RC circuit. The Stamp programming environment is probably the simplest. There’s very little to it, and you’ll be up and running with it in about a minute. The BS-2 is notable for being the only one that has a Macintosh-based programming environment. Though Parallax’ development environment is Windows-based, a user in England has written a Mac compiler.
- BX24 http://www.netmedia.com Around 1998 or 1999, NetMedia introduced a competitor to the BS-2, the BX-24. This module was based on a more modern mocrocontroller from Atmel, and the programming environment produced compiled programs that ran without interpretation. As a result, it’s faster in execution speed than the BS-2. In addition, the BX-24 has some useful features, such as 8 analog-to-digital converters onboard, and more EEPROM memory than the BS-2. The programming language, based on Microsoft’s Visual Basic, is harder for beginners to programming to learn. However, for advanced users, it allows for some powerful techniques, such as passing parameters from one subroutine to another, floating point math, and multitasking. There’s a good knowledge base for the BX-24 online, but it hasn’t been on the market long enough to establish as big a base as the BS-2
- Basic Atom Basic Micro http://www.basicmicro.com This is the newcomer on the block, having been around less time than either NetMedia or Parallax. Their Basic Atomm Pro24 offers advantages from both of its competitors. For example, code is compiled, making it reasonably fast in execution speed. The programming language, mBasic, is almost identical to that of the Basic Stamp and PicBasic Pro meaning that examples for those platforms can be converted very easily. On the downside there are only 4 analog-to-digital converters onboard, compared to the BX24’s eight. And as the newcomer, it’s got a relatively small user base to compare notes with. Though it’s not on the market as of this writing, Basic Micro promises a Macintosh and a Linux development environment Real Soon Now.
- PIC http://www.microchip.com http://www.melabs.comFor those who feel they’re ready to go to a lower level than the mid-level microcontrollers, we recommend the Microchip’s PIC family of microcontrollers. They make a wide range of controllers, some tiny ones with very few pins, some with large numbers of pins. They include a number of useful functions on the various PICs, such as multiple analog-to-digital converters, hardware PWM outputs, specialized synchronous serial control, and more. We recommend the 16F819, 18F252 or the 18F452. They’re relatively cheap, once you’ve paid the development costs, and there’s a decent amount of code and knowledge about them available on the web, in a number of programming languages. http://www.microengineeringlabs.com sells a lot of programming accesorries for these chips.
- Amtel AVR feel free to chime in.
- SX These are very fast. You can buy development tools for them from parallax.
[Add to or Correct This Page]|[Yes, this is a Wiki]