|
Microcontrollers
In anything and everything...
Microcontrollers
or MCUs are self-contained single-chip computers containing CPU and memory
for the software and data, as well as many types of peripherals. MCUs come
in packages from 6 pins up to more than 100 depending on what kind of
functionality is provided. Increasingly high-end MCUs get
DSP
functionality to accelerate math and signal processing. In many cases individual pins share different
functionality controlled by software, including serial communication (UART),
I2C, digital input with possible
pull-up or pull-down resistors, digital outputs with possible high current
drivers, pulse width modulation outputs, analog-to-digital inputs (8 to
12 bits) and digital-to-analog outputs. MCUs also have 1 or more timers for timed
events, as well as interrupts for quick reaction to events.
There are many brands of MCUs. Almost all mobile phones use MCUs or CPUs
based on the
ARM architecture. For device automation it's more
differentiated.
Consider that seemingly simple things like coffee machines, washing machines,
dish washers, electronic locks, remote controls, oscilloscopes, multi-meters,
motor vehicles, stereos, robots, weather stations, etc all use MCUs. The cost can be quite low, down to sub-$.
The trend is clearly moving from 8-bit architectures to 16-bit and 32-bit, but
8-bit MCUs are still very popular and arguably dominating.
Emitt Solutions provides a
report about the MCU market, and the sample report from 2008 lists the following market
shares for different MCU architectures:
| Manufacturer |
Architecture |
% |
| Intel |
(8051) 8051 |
19 |
| Renesas |
740, H8/S, M32R |
17 |
| Freescale |
68XX |
15 |
| PIC |
PIC |
12 |
| ARM |
ARM |
10 |
| NEC |
V850, 78K0, K3/K4 |
9 |
| ST |
Proprietary 8-bit |
6 |
| Atmel |
AVR |
3 |
| Infineon |
C16X |
3 |
| Others |
Others |
6 |
Microchip's PIC MCUs are very popular for hobby projects, as there are easy-to-use modules available for a low cost from most electronics stores.
The PICAXE platform provides a complete development environment for PIC MCUs
using a simple version of Basic. Code is interpreted in the MCU.
Arduino
Arduino is an MCU-based platform that's
quickly become very popular among hobbyists, and is also used for
semi-professional and small volume commercial solutions. There are clear
benefits with Arduino for hobbyists, including:
- Open source design, so anyone can make derivative solutions based
on the base schematics
- Piggy-back "shield" boards that add functionality to Arduino boards
- Using Atmel 8-bit MCU chips (so far ATmega168, ATmega328, ATmega1280) that
have a scalable architecture suited for high-level languages
- Atmel 8-bit MCUs are generally low-priced and fast (~20 MIPS at 20 MHz;
considerably faster than corresponding PIC MCUs)
- Boards available in many different form factors, including
very small
- Can be programmed in
almost any language, as code is compiled to
machine code, but normally Processing (read: C/C++; languages you need to
know anyway, if you want to get a job in embedded programming) is used
- Due to the machine code, programs are very fast, much faster than e.g.
PICAXE Basic based code
- A complete IDE is provided; I would though have preferred that it was
Eclipse or NetBeans based, and the setup/loop program structure is
simply silly and redundant
- There are Atmel chips with the Arduino bootloader pre-installed for a
slightly higher price, making it very easy to upload software via USB/serial
Projects
I have developed a MIDI controller using a third-party design based on Arduino
called Miduino, that adds a
MIDI interface, but sadly lacks
USB. As the MIDI
interface is inherently very simple, it could also easily have been added to a
vanilla Arduino board, but this saved me some development time. There are several articles
about MIDI and this project in my blog, amongst others:
|