How to Choose a MicroController
Introduction: How to Choose a MicroController
It used to be that the number of different microcontroller chips available to the hobbyist was pretty limited. You got to use whatever you could manage to buy from the mail order chip dealer, and that narrowed down the choice to a small number of chips.
But times have changed. Digikey lists over 16000 different line items under a ‘microcontroller’ search. Which one should a hobbyist with no particular prior experience choose?
Here are some hints. These are particularly aimed at someone trying to pick a microcontroller to use for the first time at least partially as a learning experience, rather than someone who wants to accomplish a particular task.
Update 2009 01 28: This Instructable was recently mentioned in some popular blogs, and is getting a bunch of new readers. The part that actually performs logic and mathMemory. Where the computer stores data and instructionsInput and Output or I/O. How the computer moves data between its other components and the real world.
A microprocessor uses microelectronic fabrication techniques to shrink the CPU to a very small size; usually a single “chip.”
A microcontroller uses the same techniques to shrink the entire computer to a single chip (or very small module.) CPU, Memory, and I/O all in a little package as small as a grain of rice. Just connect up power and it starts doing its thing; computing and talking to the world. There are also micros that can be used with external memory (adds complexity and expense), UV erasable micros (usually quite expensive due to the special packaging), one time programmable chips (potentially usable after you have a working design, but losing their price advantage anyway), and mask programmed chips (essentially useless.)If you want your microcontroller to have built in Ethernet, CAN, USB, or even multiple serial ports, many common choices are going to be eliminated. Some peripherals can be handy to have: UARTs, SPI or I2C controllers, PWM controllers, and EEPROM data memory are good examples, even though similar functionality can frequently be implemnented in software or external parts. That 256 ball BGA coldfire CPU may be sweet, but it’s effectively unusable by mere mortals. Microcontrollers available in 0.1in DIP packages are much easier to deal with. Some micros have as few as 256 innstructions and 16 bytes of RAM. You can do a lot in that sort of space (believe it or not), but not everything. Moreover, while you can frequently upgrade to a “bigger chip”, some chip families have relatively small memory limits imposed by their architecture, so even the biggest chip you can get will have only 8k instructions (for example.) RAM (data memory) is usually scarce in microcontrollers; some algorithms require substantial RAM to be implemented in a straightforward manner, and it may be worthwhile looking for a micro with a lot of RAM (or external RAM expansion capabilities) if that’s the sort of thing you had in mind. (For instance, implementing TCP/IP networking protocols in a micro whose total RAM space is less than used by a typical ethernet packet is likely to be . interesting.)Step 3: Thoughts About Architectures
The “architecture” of a microcontroller refers to the philosophy of the internal implementation, sort of. It includes details like how many “registers” there are, and how “general purpose” those registers are, whether code can execute out of data memory, whether the peripherals are treated like memory, registers, or yet something else, whether there is a stack and how it works, and so on.
You will hear people talk about how some architectures are better than others. I suppose this is true. But I’m going to claim that it is largely irrelevant for the typical hobbyist. If you wish to avoid the architectural quirks of a particular family of microcontrollers, you can use a high level language. If you’re willing to program in assembler, you’re at a level of interest where learning and overcoming the quirks is party of the stuff you should be learning. Besides, we’re not talking here about evaluating some new architecture that some company is proposing. All of the chips I mention in this instructable have been around long enough that they’ve proven that their architectures are good enough for MANY real applications.