Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesProcessors Proliferate


Se ptember 1994 / Features / Processors Proliferate

Good things in small packages are generating big product opportunities

Rick Grehan

While companies such as DEC, Intel, and Mips have been cranking up the megahertz on their latest 64-bit CPUs, wrapping spacious PCI-bus-based motherboards around them, and strapping on heat sinks the size of waffle irons, other companies, such as Microchip Technology, Motorola, and Zilog, have been happily slipping tiny microprocessors into the nooks and crannies of our lives.

Microprocessors have been used in automobiles for some time, and you've probably guessed that many of the talking and otherwise electrically animated toys that your children now lust after have some sort of microprocessor inside. Cordless and cellular communications equipment are also obvious homes for these chips, but maybe you haven't guessed that one of the biggest markets for microprocessors is the hand-held infrared controller: that thing you use to change channels with every night.

Welcome to the world of the IBP (itty-bitty processor), where bigger and faster take a back seat to--more accurately, barely cling to the rear bumper of--smaller and lower-power. While denizens of the PC motherboard are only now beginning to acclimate themselves to the reduced electronic blood pressure of 3-V power, some IBPs are already running at 2 V and less. While PC CPUs expand their data buses to 32, 64, and even 128 bits, IBPs echo--with some modification--the famous line from The Treasure of the Sierra Madre: to wit, ``Data bus? We don't need no stinking data bus.''

It's true. After all, these are microcontrollers. By definition, as many of their pins as possible are given over to I/O lines, since they are the means by which the CPU communicates with the outside world. All program memory and RAM data reside entirely on the CPU. There are no ex ternal data or address lines. These would require external RAM or ROM, plus traces to connect everything, all of which means more real estate, and that's a definite no-no in the land of the small.

An IBP, however, is a very special microcontroller--one that takes the micro in microcontroller seriously and one that fits entirely in a 20-pin, 18-pin, and sometimes even 16-pin DIP chip. The unbelievably small footprint of these processors makes them hard to take seriously. But don't be fooled. Inside are full-blown CPUs (albeit 8-bit ones) with accumulators, index registers, stacks, and well-rounded instruction sets. They are always adorned with parallel I/O ports; virtually all have one or more timers; many are available in versions with on-chip serial I/O; and some can be outfitted with specialized analog components.

Simply put, they provide electronic intelligence that can be targeted at specialized applications. A single IBP, for example, has the ability to do the job of a pile of discrete elec tronics. Then you can take that same IBP and reprogram it, and it can do the job of a different pile of discrete electronics. Repeat that last sentence over and over to yourself, and you begin to appreciate the versatility of IBPs.

Similarities

Before delving into some individual examples of IBPs, we should first get our bearings. After all, most of us have been living in a larger world; we need to get accustomed to thinking small.

As I mentioned above, the distinguishing characteristic of an IBP is its tiny footprint. If you are at all versed in digital electronics, you know that typically a 20-pin DIP holds, for instance, a collection of eight tristate transceivers, not a whole processor. With an IBP, all the ROM and RAM the processor needs is on-chip. Since there are no external address or data lines to feed, more chip pins can be given over to I/O.

Timers are usually critical in embedded applications; they are used for tasks that can be as simple as making lights blink or as com plex as generating accurate pulse trains. Every IBP that I have been able to find has on-chip timers, including a specialized version referred to as a watchdog timer (at least one processor's data book calls it the COP--computer operating properly--watchdog). Its raison d'tre is keeping the processor from lapsing into a coma due to a program failure or a hardware glitch.

Once the processor is started and the watchdog is armed, the program must reset the timer within a certain time period; otherwise, the watchdog will reset the processor. Developers therefore build into their programs routines that reset the watchdog every so often. If a failure in program flow occurs, the reset routine won't execute, and the watchdog will resuscitate the processor upon time-out.

The Manufacturer's Perspective

While users and developers might view IBPs as atomic, indivisible units of computing, manufacturers see them as a collection of parts rather than as individual, discrete CPUs. I discussed this idea wi th Paul Grimme, Motorola's HC05 operations manager, and James Goodhart, Zilog's Z8 microcontroller channel manager. Both described remarkably similar approaches to product design. Specifically, manufacturers have, over time, built foundries of processor parts. At the heart of these foundries are processor cores to which manufacturers can attach varying amounts of ROM and RAM, as well as I/O ports, timers, and other peripheral components.

In essence, this is object orientation on a microelectronic scale. It's one area where product longevity does not lead to obsolescence; it leads to increased reliability. For example, the Z8 was available as long ago as 1979; to Zilog's Goodhart, that means not only have all the bugs been worked out of the silicon, but it's given Zilog plenty of time to build up a library of useful software algorithms. When a customer approaches Zilog with a new custom microcontroller specification, Zilog can dip into its hardware foundry and software library, quickly lash together the needed components, and, according to Goodhart, ``turn a new design in six to nine months.''

This is precisely what happened when a major TV OEM manufacturer recently knocked on Zilog's door. Zilog was able to quickly build a 2-V custom IC with a Z8 core and specialized timers. The result was the Z86L71, the heart of the TV OEM manufacturer's multibrand infrared remote.

Of course, other manufacturers of IBPs have similar stories. As I mentioned earlier, microchip IBPs are crawling throughout the automotive industry. And have you got a Logitech MouseMan cordless mouse next to your computer? If you had x-ray vision, you would see a 20-pin Motorola 68HCL05J1A inside.

Anatomy I: Motorola's HC05

Motorola's HC05 line has--like those of the other manufacturers in this article--a number of members, thanks to Motorola's voluminous component foundries. HC05 microcontrollers are all proud descendants of the venerable 6800, an 8-bit processor that found its home in such long-gone personal compu ters as Ohio Scientific's Challenger series and computers marketed by Southwest Technical Products.

Of course, as compared to its ancestor, the HC05 is both much expanded and much reduced. For example, if you examine the block diagram of the 68HC05J1A (a 20-pin member of the HC05 family) in the figure ``68HC05 Microcontroller,'' you'll see that the chip has a single 8-bit accumulator and an 8-bit index register. The original 6800 had two 8-bit accumulators, referred to as the A and B accumulators. (Later members of the 6800 family--the 6801, for example--provided instructions that allowed programmers to manipulate the two accumulators as a single, 16-bit accumulator.) In addition, the 6800's index register was 16 bits wide, allowing indexed address operands to span that processor's full 64-KB address range.

It was perfectly reasonable for Motorola to choose a reduced register set for the HC05; that design translates directly to less chip real estate. Furthermore, a 16-bit index register wouldn't provide any advantage on a processor with only 64 bytes of user RAM. All I/O ports (which, by the way, the original 6800 did not possess as on-chip components) and user RAM lie within that processor's first 256 memory locations and are therefore directly addressable by the index register.

The HC05's instruction set also shows modifications to the original 6800 beyond those that you might expect as a result of the reduced memory space and register set. The HC05 repertoire includes bit-set and bit-clear instructions, as well as the bit-test-with-accumulator instruction that was present on the 6800. A rich set of bit-manipulation instructions is a bonus for efficient embedded systems, since the processor spends much of its time either reading from or writing to single I/O pins. Finally, the HC05 has an unsigned 8-bit by 8-bit multiply instruction (the 16-bit result is cut into two halves and placed in the accumulator and index register).

Motorola continues to carry the HC05 to lower and lower leve ls of power and size. In February, a collection of HC05 members were introduced that operated at 1.8 V. One, the 68HCL05K0, is an HC05 processor with 512 bytes of ROM and 32 bytes of RAM--all in a 16-pin package.

Anatomy II: The Zilog Z86xx Series

Members of Zilog's Z86xx family all have beating in their silicon substrates the heart of that company's workhorse microcontroller, the Z8. A block diagram of one representative, the Z86C04, is shown in the figure ``Z86C04 Microcontroller.''

This particular version of the Z86xx is available in an 18-pin package. Cousins to the Z86C04 can run at voltages as low as 2 V and at clock speeds as high as 20 MHz. (There are two branches to the Z86xx tree: the Z86Cxx branch, which can operate down to 3 V, and the Z86Lxx branch, which can operate at 2 V.) The highest clock speed of the low-cost Z86xx processors is 12 MHz.

The original Z8 was Zilog's first one-chip microcomputer. Interestingly, it uses a Harvard architecture (i.e., separate program a nd data memories), which might not mean much if you were to use the Z8 in its most minimal configuration: only on-board ROM and RAM active. However, the Z8 can also be configured so that some of the I/O pins are given over to address and data lines. In that case, you can attach 62 KB of external program memory and 62 KB of external data memory. (This is, of course, not the case with the Z86xx family, whose members are designed to be used only with on-chip data and program memory.)

With only 18 pins to the outside world, a Z86xx processor is basically a Z8 in its minimal configuration. The Harvard architecture might otherwise be an inconvenience, because an embedded application may need constant data from a table burned into ROM--which would be in the code space. Fortunately, the Z8 includes special instructions for reading from the code space into registers.

One powerful attribute that members of the Z86xx family inherit from the Z8 is that processor's unique register structure. Specifically, th e internal RAM of the Z8 is all registers. There is no accumulator or index register (as with the 68HC05); every member of the internal register set (referred to as the register file in the figure) can be addressed with equal ease.

You'll notice that the figure indicates 144 members in the register file. Actually, only 124 of the registers are available for general-purpose use. The others are reserved for specific operations, such as I/O-port control, I/O-port data, timer control, the stack pointer, flags, and so forth.

Although the original Z8 had three on-chip I/O ports, and was thus more a microcontroller than a microcomputer, its instruction set looked more like one designed for a microcomputer. In particular, there were neither bit-manipulation nor branch-on-bit-condition instructions. Furthermore, none were added as the Z8 core was moved into the small form factor of the Z86xx processors (as Motorola had done when it moved the 68xx instruction set down into the HC05). Zilog acknowledges th is deficiency in the processor but points out that the weakness is offset by the fact that, in the HC05, one has to move data into a register (the accumulator) to do any work, while on the Z8 the data is in a register to begin with.

Zilog has added peripheral components to the Z86xx that make it more attractive for use with embedded applications. There is, for instance, a watchdog timer on all Z86xx processors; some even have an on-chip serial interface. The figure ``Z86C04 Microcontroller'' shows an ``analog comparators'' block; there are two individual analog comparators on the Z86C04.

You can configure the processor so that I/O lines normally given over to one of the ports are devoted to the analog comparators. In such a case, the comparators can be used as building blocks for A/D or D/A converters. Zilog's Goodhart told me that, by using discrete components and clever software, one Z86xx customer built an A/D converter with 12-bit accuracy.

Anatomy III: Microchip's PIC 16C5x

The Microchip Technology PIC 16C5x series is a species of the larger Microchip PIC 16x genus; all share more or less the same core processor architectures. Any differences you find are in physical features, such as available I/O pins and specialized on-chip components (the 16C71, for example, has an on-chip A/D converter). A block diagram of the PIC 16C5x processor is shown in the figure ``PIC 16C5x Microcontroller.''

The PIC processors have features that make them technically more interesting than the Motorola and Zilog components. To start off, the HC05 and Z86xx processors are more or less variations on previous 8-bit-processor themes, while the PIC-series processor is actually--get this--a RISC processor. There are only 33 instructions in the PIC 16C5x processor's repertoire; compare this to the 117 instructions in Motorola's HC05 instruction set and the approximately 75 instructions in the Z8 instruction set.

Understand that this is a RISC processor only in the sense that it has a reduced inst ruction repertoire. RISC processors typically have large register sets, and operations proceed by fetching data into the registers, manipulating the data once it's there, and then returning the results back to memory. There are only 25 8-bit read/write memory locations on the PIC 16C5x processor, and they're all referred to as registers (as they are on the Z8). There is a W register, a kind of half-hearted accumulator that participates in most mathematical operations. If, therefore, this is considered a RISC chip because all operations occur in registers, remember that there's no other place where they can occur.

It's perfectly reasonable to be skeptical of the benefits of a reduced instruction set in such a small processor. In the larger world of 32- and 64-bit processors, the rule of thumb is that a RISC processor requires more machine-code instructions per high-level operation. This is not the case with the PIC 16C5x, however. The trick is that the instruction-bus width on the PIC 16C5x is 12 bits, and--if you consider that to be the processor's word size--all instructions are PIC-word-wide instructions. For example, the instruction to load an 8-bit literal into the W register encodes the operand in the upper 4 bits, and the literal value in the lower 8 bits. (Astute readers are now saying to themselves: ``Fixed instruction length: another RISC attribute.'')

This should be put into perspective, however. The PIC chips achieve the reduced-instruction part of the RISC acronym by eliminating instructions that many programmers may deem downright necessary. For instance, there are no comparison instructions, nor are there any conditional branch instructions. There is an unconditional GOTO instruction (implemented as an absolute, as opposed to a relative, branch), and conditional branching can be built into a PIC program by placing a GOTO immediately following one of the four instructions that include a ``skip if condition'' modifier. Such instructions will skip the next instruction if a particular cond ition is met.

Here's an example: The DECFSZ instruction tells the processor to decrement one of the registers and, if the result is zero, to skip the next instruction. You can see that, if the next instruction happened to be a GOTO, the effect would be a ``decrement register and branch if not zero'' instruction.

There are other remarkable traits lurking in the PIC processors. Their CPUs are actually pipelined, with overlapping fetch and execute cycles. All instructions, except GOTO, execute in a single machine cycle (GOTO takes two cycles). Some members of this processor family enjoy the full range of clock speeds, from 0 MHz all the way up to 20 MHz. All have a power-saving sleep mode.

Perhaps the best example to date of IBP innovation, however, is available thanks to the PIC 16C5x and some imaginative people at Parallax, who developed the Basic Stamp. This is a microcontroller development system that connects to your PC via a parallel port and requires only two ICs. (See the text box `` The Taming Power of the Small'' for details.)

Don't Look Now

In 1993, Motorola published the results of research concerning microcontroller applications. The research focused on home, office, and auto use and included projections to the year 2000. The big winner was the home. Motorola forecast that the typical home in the year 2000 will have over 200 microcontrollers embedded in appliances, telephones, VCRs, stereos, and so on.

Zilog's Goodhart probably wouldn't argue with his competitor's finding. ``The largest consumer electronics usage right now is IR remotes,'' he says. Goodhart envisions the day when that hand-held channel-changer in your living room grows in capabilities (but not in size) until it becomes the input device to all the computer and electronic gear in your home.

Like an incurable infection, the use of IBPs is spreading. While doing research for this article, I found it impossible to identify just one or two market forces driving IBP proliferation. The marketing cu rrents that today push technological development come from all compass points: portable communications, intelligent PC peripherals, autos, consumer electronics, and even toys, for heaven's sake.

While some CPU builders sweat and strain on new designs for bigger caches, bigger data buses, and bigger address buses, it's refreshing to know that other designers are discovering wholly new products and markets for the incredible, shrinking IBP.


Figure: 68HC05 Microcontroller The core of the Motorola 68HC05 microcontroller. Note that the program counter is constrained to 11 bits and the stack pointer is constrained to work in the range of 00C0h to 00FFh. Also, four of the port A pins can be programmed to serve as external interrupt lines.
Figure: Z86C04 Microcontroller A diagram of the Z86C04, an 18-pin, low-end version of the Z8 family. Note that with 14 pins given over to I/O, only four pins remain for the power supply, ground, and oscillator. Although this part can operate at voltages as low as 3 V, its oscillator can run at up to 8 MHz.
Figure: PIC 16C5x Microcontroller A block diagram of the PIC 16C5x series of microcontrollers. Note the on-chip stack RAM (which is two elements deep). The FSR (file-select register) can be used as a general-purpose register, as an indirect address register, or (on some PIC models) as a bank-select register. Also note that smaller PIC models do not have I/O port C; the associated registers are available as general-purpose registers.
Rick Grehan is technical director of the BYTE Lab. He has a B.S. in physics and applied mathematics and an M.S. in mathematics/computer science. He can be reached on the Internet or BIX at rick_g@bix.com .

Up to the Features section contentsGo to previous article: Modem PoolsGo to next article: The Taming Power of the SmallSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network