Select a Microcontroller

From HBRC WIki

Jump to: navigation, search

There are many many microcontrollers to choose from. In the Home Brew Robotics Club, the three most common are currently the Parallax Basic Stamp, Microchip PIC, and the Atmel AVR. It should be mentioned, that programming microcontrollers is not for everybody -- other people get along just fine using the controllers provided with their robot kits (e.g. the Lego RCX, the Vex Controller, etc.) This page is primarily directed at people who have already decided that they want to take the plunge and get into the fun and joy of integrating microcontrollers into there robotic creations.

Contents

Basic Stamp 2

The Basic Stamp 2 from Parallax is microcontroller that is programmed in the Basic programming language. It comes with extensive documentation, and a full IDE (Integrated Development Environment) that runs on various versions of the Microsoft Windows operating system.

Its drawbacks are that it is relatively expensive ($40-$50) and is pretty slow.

Microchip PIC

PIC stands for Peripheral Interface Controller.

The Microchip corporation makes a huge selection of 8-bit Microcontrollers. The PIC16 and PIC18 are the dominant versions of the 8-bit family. The PIC16 is older and has up to 8K words of program memory and 512 bytes of RAM, and the PIC18 has significantly more addressable program memory and up to xxK of RAM.

Microchip provides the MPLab IDE (Integrated Development Environment) that runs on various versions of the Microsoft Windows Operating system. MPLab comes with a free assembler, it is possible to purchase after market C and Basic compilers. In addition, it is necessary to have programmer to program the chips. Lastly, it is desirable to have some sort of in circuit emulator to help debug programs. The Microchip ICD2 (aka "the hockey puck") is the entry level tool that can be used to both program and debug microchip programs.

One nice feature of the PIC microcontrollers is that so many of them are available in 14-pin, 18-pin, 28-pin, and 40-pin DIP packages that can be plugged directly into a standard prototyping board. The individual microcontrollers are quite inexpensive, ranging from $1 to $9 in many cases.

Probably the biggest drawback of the Microchip microcontroller is the amount of money required to get started with tools. A reasonable compiler will cost ~$200, and reasonable debugging tool and programmer will cost ~$150.

Atmel AVR

The Atmel AVR is an 8-bit micrcontroller family from Atmel Corporation.

The huge advantage of the AVR family is that there is a free compiler called GCC that can compile C and C++ code (C++ code has restrictions.) There is also a complete IDE tool suite available for both the Windows and Mac/*nix operating systems. This include the GDB debugger which can be used to debug your code.

The AVR-Dragon from Atmel costs approximately $50 and can both program and debug many of the AVR chips.

A drawback of the AVR family is that there is not as many microcontrollers to choose from as the in the Microchip PIC family.

Making the Choice

As expected, the choice really depends upon your current skill set. If you more of a programmer and less of an electrical engineer, it would probably be prudent to start with the Basic Stamp 2. The amount of documentation available is quite extensive.

If you are reasonably comfortable working with individual electronic chips and components, either the PIC or AVR is the way to go. For most entry level people, the AVR tool set is sufficiently compelling to make it the obvious choice over the Microchip one. Unless you really want to use some of the special features of the PIC Microcontroller family, the AVR family is probably the place to start.

Lastly, while 8-microcontollers are neat, the 32-microcontrollers that are starting become available are worth looking at.

Personal tools