A microcontroller is a microprocessor optimised to be used to control electronic equipment (see embedded system). Microcontrollers represent the vast majority of all computer chips sold, over 50% are "simple" controllers, and another 20% are more specialized DSP's. While you may have one or two general-purpose microprocessors in your house (you're using one to read this), you likely have somewhere between one and two dozen microcontrollers. They can be found in almost any electrical device, washing machines, microwave ovens, telephones etc.

A microcontroller includes CPU, memory for the program (ROM), memory for data (RAM), I/O lines to communicate with peripherals and complementary resources, all this in a closed chip. A microcontroller differs from a standalone CPU, because the first one generally is quite easy to make into a working computer, with a minimum of external support chips. The idea is that the microcontroller will be placed in the device to control, hooked up to power and any information it needs, and that's that.

A traditional microprocessor won't allow you to do this. It expects all of these tasks to be handled by other chips.

For instance, a typical microcontroller will have a built in clock generator and a small amount of RAM and ROM/EPROM/EEPROM, meaning that to make it work, all that is needed is some control software and a timing crystal. Microcontrollers will also usually have a variety of input/output devices, such as AD converters, timers, UARTs and specialised serial interface buses like I²C and CAN. Often these integrated devices can be controlled by specialised processor instructions.

Some modern microcontrollers include a built-in high-level programming language; BASIC is quite common for this.

Microcontrollers trade speed and flexibility for ease-of-use. There's only so much room on the chip to include functionality, so for every I/O device or memory the microcontroller includes, some other circuitry has to be removed. Finally, it must be mentioned that some microcontroller architectures are available from many different vendors in so many varieties that they could rightly belong to a category of their own. Chief among these are the 8051 and Z80 derivatives.

See also: In-circuit emulator (ICE), microbotics

Common microcontrollers