8 and 16 Bit Microcontrollers
Rumors of the death of 8 and 16 bit processors are greatly
exaggerated. Published in ESD April 2003.
||For novel ideas about building embedded systems (both hardware and firmware), join the 25,000+ engineers who subscribe to The Embedded Muse, a free biweekly newsletter. The Muse has no hype, no vendor PR. It takes just a few seconds (just enter your email, which is shared with absolutely no one) to subscribe.
60% of all CPUs and MPUs are 8 bits; 16 bitters account for
15% of the market, with the much ballyhooed 32 bit machines bringing up the rear
of the market at a paltry 9%. According to a 2001 survey, our 43% of our readers
use PICmicro parts, 55% use 8051/52/251/AVR, 36% go for Motorola's 68XX family
and Zilog's Z8/Z80/Z180 devices account for about 15%. These numbers total
more than 100% as some folks used more than one processor in that year. In the
16 bit world 41% use 8086/186/96/196 devices and 21% employ the 68HC12/16.
Most interesting is that all of these architectures, with
the possible exception of the 68HC12/16, are 25 years old. New designs have a
hard time competing, probably due to the wealth of support for the older CPUs,
and a large pool of developers who are well versed at applying the parts.
Though 8 and 16 bit processors were once the universal
computing engine found in all smart products, today they are used in the realm
of deeply embedded applications, ones that typically have a lot of I/O.
Peripherals are important, as evidenced by the astonishing number of variants
for some devices. Some 200 different 8051s offer practically any mix of I/O
Though timers, parallel bits, serial I/O and other
traditional functions remain the staple of peripherals, today many devices offer
sophisticated special-purpose functions like LCD drivers and fast A/D
Communications is key to many even simple devices. On-chip
I2C, not found on 32 bitters, is common in the 8/16 bit world. CAN,
still very popular especially in Europe, is available. Even USB controllers exist on-chip, as in
Internet support exists in the form of on-board MACs (Media
Access Controllers) on a few parts, notably Zilog's eZ80F91. Third party
vendors (e.g., CMX) provide protocol stacks to connect even the smallest
processors to the 'net.
Most intriguing is the move to "virtual" peripherals.
Triscend's E5 is an 8031 surrounded by an FPGA; the designer configures
peripherals using their tools. Need four timers and 3 serial ports? Customize
the peripheral mix to exactly your requirements.
Cypress's 8 bit PSoC (Programmable System-on-Chip) is similar, but allows the
designer to redefine the peripheral mix as the program runs. Rather like a
shapeshifter the device conforms to changing requirements dynamically. Analog
blocks let you configure devices that are traditionally off-chip in external
circuitry, like programmable gain amplifiers and filters.
Memory requirements are skyrocketing in all computing
applications. Tiny parts with mere hundreds of bytes of ROM are still common and
quite useful for simple applications. More complex ones are being served by the
growing capability of new CPUs. Zilog's eZ80, for instance, is an 8 bitter
that addresses up to 16 Mb.
Microcontrollers are finally moving from OTP (One Time
Programmable - an EPROM with no erasure window) to Flash. Though Flash remains
a more expensive technology, being able to program a device after it's
soldered onto the circuit board reduces manufacturing costs. As program sizes
grow so do bugs; updating code without disassembling a product is a powerful
argument for Flash.
Even the venerable Z8, the heart of most TV remote
controls, is available with 64k of on-chip Flash and another 4K of RAM.
When the word "security" is used we immediately think
of a new Federal department, or of network vulnerabilities. Yet in the embedded
world many of us must protect our intellectual property, the millions spent
creating a product's code base. Some CPUs are addressing this need by making
it impossible, or at least extremely expensive, to read out the code stored in
the CPU's Flash. An example is Dallas's DS2252, an 8051-compatible device
that stores program code encrypted with a 64 bit key. The SDI pin, short for
Self Destruct Input (no kidding!), will, if asserted, delete the key. A circuit
that detects tampering can drive SDI, leaving the product brain-dead but
Squeezing Size and Power
I remember seeing a Motorola 68HC05 running off of two
lemons wired in series 20 years ago. Since then batteries haven't improved
much, but the need for portable computing has exploded. Most processors now
offer low power modes. Our February issue contains a nice article (Software
Matters for Power Consumption) about using these modes effectively.
5 volt parts are still very common, but don't lend
themselves well to devices running from a pair of AA cells. CPUs today run from
a wide range of voltages: 3, 3.3, 3.5, 2.4 and even 1.8. Lower voltage reduces
power (measured in amp-hours) sucked from the battery.
A plethora of low-power modes are available. In sleep mode
Epson's S1C88 family uses 0.3 microamps (typical). Awake, it needs only 14 ma
at 32 KHz, and 2 ma at 4 MHz. 8 bit H8 devices use a barely measurable 0.1 ma
when sleeping, and just over one microamp at 32 KHz.
Tiny power needs are part of building small systems. It's
hard to believe that a few decades ago a small computer weighed tons; today's
SMT technology put processors and microcontrollers into packages whose pins
appear as fine as spiderwebs.
Infineon's C163-L 16 bit microcontroller, as is typical
of small form-factor devices, comes in a 100 pin TQFP (Thin Quad Flat Pack)
configuration, measuring just 14 mm on a side, with 0.5 mm lead pitch (leads too
small to see if you wear bifocals). At 1.4 mm thick it's useable in super-slim
applications like PCMCIA cards. Rabitt Semiconductor's Rabbit 3000 comes in a
variety of packages, including a 10 mm square TFBGA
(Thin Fine Pitch Ball Grid Array) just 1.2 mm thick.
Analog will never go away, but designers seem intent on
pushing the digital part of a circuit as close to a sensor as possible. This is
partly possible because we can create digital filters in software, a task that
burns enormous amounts of processing power.
TI pioneered DSP microprocessors. Their TMS3201x are 16 bit
DSP devices used in a huge range of products.
But, in a twist,
now Microchip is making DSCs (Digital Signal Controllers). This is a family of
16 bit DSP microcontrollers. All come with on-chip Flash, RAM, A/Ds, PWM, and
even EEPROM. They range from tiny (16k of Flash) to almost 200k.
Other devices, like TI's MSP430, are hermaphrodites,
traditional CSIC CPUs with the addition of the DSP's MAC (Multiply and
Accumulate) instruction. MAC is an instruction that performs both a
multiplication and an addition in a single instruction cycle, which greatly
speeds many signal processing algorithms.
The vast proliferation of processors makes it likely one
exactly suited for your application is available. And if not - well, take
advantage of the technologies that let you design your own peripheral mix.
Figure on low costs - tens of cents for some small
devices in high volumes, a few bucks for the higher-end processors.
The 8 and 16 bit world has never been healthier.