
Although the 8051 has been around forever, it is more alive today than ever before. Due to the tremendous amount of development tools available to support this device, engineers have stuck with the 8051 architecture. While the core 8051 remains the same (except for Dallas Semiconductor's version), vendors continually add memory and peripherals, which allows this processor to meet changing application requirements. Applications for the 8051 vary from keyboard controllers to motor control to mobile phones.
Dallas Semiconductor, designing its own core, was the first to introduce a fast 8031/32 core, the DS80C320. The code-compatible DS80C320 reduces the number of clocks for a basic instruction cycle from 12 to 4a three times speed increase.
The 8051 is both a register- and accumulator-based design. The CPU has four banks of eight 8-bit registers in on-chip RAM. On-chip RAM also holds addressable memory, the stack, and special-function registers that define peripheral operations and configurations.
Living within an 8-bit on-chip data-addressing budget, Intel designers overlapped data address spaces. The lower 128 bytes of RAM hold the registers, a bit-operation area, and RAM. These lower bytes can be addressed directly or indirectly using an 8-bit value. The upper 128 bytes of on-chip data RAM encompass two overlapping address spaces. One is for directly addressed special-feature registers; the other for indirectly addressed RAM or stack.
Register indirection uses an 8-bit register for an on-chip RAM address; an off-chip address needs a 16-bit pointer register (DPTR). The 8051/52 (except for Dallas and Siemens µCs) has only one DPTR, which cannot be indexed. You can, however, increment the 16-bit DPTR.
The 8051 can use on- or off-chip memory for the two 64-kbyte instruction and data spaces. You can combine these spaces by ANDing pins together. The instruction and data spaces share an external bus, which comprises ports 0 and 2. The bus is multiplexed for 16-bit operation and requires a buffer to hold an address stable while moving data.
The 8052 followed the 8051 and has increased RAM and ROM and more peripherals. Later versions added an ADC, programmable counter arrays (smart, general-purpose timer/counters with compare/capture registers), serial channels, a multichip bus, and more external interrupts and I/Os.
The 8051 family performs extensive bit manipulation via instructions such as bit set, bit clear, and complement for a 16-byte area of RAM. It can also AND or OR bits with carry bit.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Intel has licensed the 8051 to several vendors, including AMD, Atmel, Matra, Oki, Philips/Signetics, and Siemens. Both Philips and Siemens have been especially aggressive in extending the 8051 with specialized peripherals and versions. Silicon Systems has a 16-bit implementation that is code compatible with the existing 80C52.
Atmel: dc to 24 MHz, 2.7 to 6V, 2 to 8 kbytes; single-voltage flash, 128- to 256-byte RAM, 32 I/Os, up to three timer/counters, full duplex serial port. $3 to $9. Dallas: 25 to 33 MHz, static four clocks/base cycle (DS80C320), 0 to 16-kbyte EPROM, 256-byte to 1.2-kbyte RAM, two data pointers, two serial USARTs, watchdog timer, real-time clock (DS87530), power monitor with power-fail interrupt or reset, three 16-bit timer/counters, six external interrupts, 1.5 µsec (at 33 MHz) cycle (52 crystal clocks) interrupt latency, adjustable MOVX instruction for slower memory, core available, address and data encryption (DS5002FP). $6 to $14. Intel: 0.5 to 24 MHz, 2.7 to 6V, 0- to 32-kbyte ROM/EPROM, 128- to 256-byte RAM, 24 to 56 I/Os, two to three timer/counters, 4- to 8- channel 8-bit ADC (8xC51GB and 8xC51SL), up to three timer counters, programmable counter array, 3- to 9-cycle interrupt latency (3 to 9 µsec at 12 MHz), watchdog timer, UART, PWM. $3 to $6.30 (for ROM parts).
Matra: dc to 42 MHz, 2.7 to 6V, low-height packaging (1.0- and 1.4-mm QFP) 4- to 32-kbyte ROM, 128- to 256-byte RAM, watchdog timer, two to three 16-bit timers, programmable serial port, UART, 32 I/Os, idle/power-down modes, I Oki: dc to 24 MHz, continuous 2.7 to 5.5V operation, low-height packaging (1.3 mm in 44-pin TQFP) for PCMCIA and disk controllers; 0- to 16-kbyte ROM, 128-/256-byte RAM, two to three timer/counters, UART, 32 I/Os, and a piggyback version (85C154VS) for prototyping and design verification. $4.49.
Philips: 32 kHz to 40 MHz, 1.8 to 6V, I Siemens: 18- to 40-MHz 8052 (3.3V at 12 MHz), 8- to 32-kbyte ROM, 256-byte to 2.2-kbyte RAM, three to four 16-bit timer/counters with capture/compare registers, two watchdog timers (software and oscillator), 17/4 interrupt sources, 16-bit MPY/DIV unit (SAB80C517), 56 I/Os plus 12 in-only, 12 10-bit ADC inputs, two serial ports. $2.45 to $11.50. |
| Support | |
|---|---|
| HARDWARE The 8051/52 family has many hardware debugging tools. Several ICEs are also available. Piggyback and DIP-chip versions are available from Oki, Signetics, and others for debugging and prototyping ROM chips. Siemens has integrated the 8052 with EEPROM on a standard-pinout Macrochip for debugging. | SOFTWARE Numerous software tools exist for the 8051/52 family, including assemblers; C, Pascal, and Modula-2 compilers; Forth interpreters; and real-time OS kernels. For slower tasks, engineers can use Basic. (Public-domain versions of Basic are available from Intel and Signetics, as well as at least two first-rate Basic interpreter/compilers, which minimize the need to know assembly-language details.) |
Originally a CMOS mainframe peripheral controller, the PIC has migrated to embedded controlwith more than 100 million units sold. It is the fastest low-end, 8-bit µC around due to its modified Harvard architecture and RISC-like features, such as a two-stage pipeline that performs fetch and execute. The three PIC families are the baseline PIC16C5x, the midrange PIC16Cxx, and the PIC17Cxx, which has a more robust architecture and more peripherals but lacks multiply and divide instructions.
The PIC16C5x, provides a small set of on-chip peripherals and is commonly found in dedicated applications where a part must react to a single input stimulus, such as a computer keyboard. The PIC16Cxx contains increased EPROM and EEPROM and enhanced peripheral capability; it commonly supports applications where several stimuli must be controlled simultaneously or with asynchronous timing. At the high-end, the PIC17Cxx has additional on-chip peripherals, and its applications include motor-control and data-encryption systems requiring a high computational bandwidth.
The PIC16/17 family's modified Harvard architecture allows the devices to support various instruction word widths. The data paths are eight bits wide; the instruction paths are 12, 14, and 16 bits wide for the PIC16C5x, PIC16Cxx, and PIC17Cxx, respectively. This variable instruction bus width gives the PIC16/17 an advantage over many 8-bit µCs. Instructions are held in a single word, so most require a single instruction fetch and execute in a single pipelined cycle. Branches, as in most RISC processors, take an extra cycle.
The PIC16Cxx has no provisions for external memory. Code must make do with 32 to 192 registers ordered in banks and 512 bytes to 4 kbytes of on-chip program memory. Instructions are available to move data held in program memorytypically constantsto registers for processing. The PIC17C42 has 232 registers and can access external program memory as well as internal EPROM. Additionally, the PIC17Cxx has a multiplexed external bus16-bit address, 8-bit data.
Multiple register sets make for fast context switching, but there are limits on subroutine-call depth. PIC16/17 CPUs have an automatic stack that holds the current PC for subroutine call/returns. The PIC16Cxx stack is only eight deep; the PIC17Cxx stack is 16 deep. Interrupts are handled via polling on the PIC16C5x because it lacks interrupt support; but, the PIC16Cxx and PIC17Cxx devices have 8 and 11 interrupt sources, respectively.
Special table instructions enable code to move constants held in program memory to registers for use. The PIC17C42's external memory can access and store data as well; a holding register buffers data between memory and registers. Compare and skip instructions (17Cxx) save code. The PIC16Cxx has a decrement-and-skip-on-0 instruction.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Microchip is the sole source.
16C5X: dc to 20 MHz
16CXX: dc to 20 MHz
17CXX: dc to 25 MHz |
Notes:
| Support | |
|---|---|
| HARDWARE For debugging, you can run the 17C42 in µP mode with 64-kbyte code address space, bypassing on-chip EPROM. Microchip offers an ICE with pods for both PIC families. EPROM burners are available from Microchip and third-party vendors. Microchip sells an ICE for all three lines. | SOFTWARE Microchip sells a macroassembler/linker/loader. A high-level C compiler is also available from Microchip as well as ByteCraft Ltd (fuzzyTECH-MP supports fuzzy-logic applications). |
Motorola's 68HC05 leads the 8-bit-µC pack in quantity of units shipped. The accumulator-based 68HC05 is a low-end µC with a few registers and a stripped-down 6800 instruction set. Motorola uses the 68HC05 as a base for a range of customer-specified µCs. The µC supports a range of industries, including consumer electronics, communications, industrial control, automotive, and TV products. There are more than 160 68HC05 variations, many of which started out as semicustom designs. Motorola is now challenging 4-bit-µC vendors with its 68HC05K µC series, which is a stripped-down 68HC05 crammed into a 16-pin package that costs less than $1 in large volumes.
The CPU core has an accumulator, index register, stack pointer (SP), 5-bit condition-code register, and program counter (PC).
The standard instruction set is easy to write code for. It features 10 uncomplicated addressing modes, including 8- and 16-bit indexing from the PC. The 16-bit PC accommodates relatively large address spaces, but the available devices have only 32 bytes to 1 kbyte of RAM. The 68HC05 limits the on-chip stack to 32 subroutine calls (or 64 bytes), where each pushes the 16-bit PC onto the stack.
The 68HC05's programs generally run from on-chip memory. The 68HC05EO can also access and execute up to 64 kbytes from external memory. These chips are primarily used for debugging and prototyping code.
The 68HC05 timer/counter is built around a 16-bit free-running counter, which is coupled with a 16-bit capture register and a 16-bit compare register. The capture register captures timer values on some line events; the timer/counter continually compares the compare register with the running timer. When the registers match, an output-compare flag is set and an output pin is driven to a programmed value.
The CPU has stop/wait modes: Wait mode stops CPU processing but leaves the clock, timer, serial-peripheral-interface, and serial- communications-interface systems enabled. Stop mode stops the clock and all internal processing. Both modes maintain RAM and enable intr to wake the CPU. Most special peripherals are programmable and can be selectively turned off to save power.
All versions have external interrupts with typical latency times of 16 cycles (or eight µsec).
The HC05 performs an 11-cycle MUL and a two-cycle ADD (ACC register to memory); it has no DIV instruction. Bit operations are valid for the first 256 bytes of RAM and include bit-set, bit-test, and branch instruction. The CPU can test and branch on an interrupt bit, but branches are Ò127 bytes relative to the PC.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Motorola developed the 68HC05; Harris is a second source; Hitachi and SGS-Thomson also supply 6805 devices. The families not listed below include T=television OSD, SC=SmartCard, M=VFD display, G=power management, V=system chip, and MC=motor control.
68HC05B/X: 54 versions for industrial and automotive control, 4- to 32-kbyte ROM/EPROM, 176- to 528-byte RAM, 256-byte EEPROM
68HC05C/D: 10 versions (general-purpose), some low-voltage (1.8V) and some high-speed versions (C only); 4- to 32-kbyte ROM/EPROM, 176- to 352-byte RAM
68HC05J/K/P: 19 versions, low-cost 20/16/28-pin packages; some low-voltage (1.8V) versions (J only); 0.5- to 4-kbyte ROM/EPROM, 32- to 176-byte RAM, 32- to 128-byte EEPROM(only in three versions); watchdog timer, one 16-bit timer
68HC05L: 11 versions with on-chip LCD drivers, 2- to 16-kbyte ROM/EPROM, 96- to 512-byte RAM; watchdog timer, one to two 16-bit timers |
Notes:
| Support | |
|---|---|
| HARDWARE ICEs for the 68HC05 are available from Motorola and several third-party vendors. Motorola also supplies low-cost hardware-development aids and evaluation boards. | SOFTWARE Motorola and third parties supply a range of development tools for the 68HC05, including real-time kernels, cross-assemblers, and development environments. There are even C compilers for the limited-RAM chip. Code from one compiler, Bytecraft's C68HC05 (Waterloo, ON, Canada), approaches hand-coded assembly code in density. |
| Support | |
|---|---|
| HARDWARE Motorola begins supplying ICEs in fourth quarter of 1994. ICEs and gang programmers will also be available from third-party vendors in 1995. In addition, Motorola will supply an evaluation board and universal serial programmer. | SOFTWAREMotorola and third-party vendors supply software tools, including assemblers, debuggers, real-time kernels, fuzzy kernels, multiple precision math, and C compilers. Several C compilers are available today from ByteCraft, HiWare, and BSO/Tasking. |
The 68HC11 is the flagship of Motorola's 8-bit µCs. Introduced in 1985, the chip is an upgrade of the 6800/6801 and was initially used in automotive applications. Today, the 68HC11 is popular for embedded applications ranging from industrial control to medical electronics. The µC has up to 32 kbytes of ROM/EPROM, up to 1.25 kbytes of RAM, and optional on-chip EEPROM. It was one of the first µCs to incorporate sophisticated peripherals such as free-running timers with input-capture and output-compare capabilities. Motorola introduced 3V versions in 1992. Family variations include multiplexed or nonmultiplexed external buses, math coprocessors, PWM, ADCs, serial communications, and extended memory (address space extends to 1 Mbyte).
The 68HC11 has two 8-bit accumulators, two 16-bit index registers, a 16-bit SP, and a 16-bit PC. The CPU can access index registers as high or low bytes and can address the two accumulators as a single 16-bit accumulator. The instruction set is simple and straightforward. It includes many op codes because instruction names reflect the registers used. Addressing modes are limited. There is no base+register addressing, but addresses can be displacement+index.
Addressing is restricted to a 64-kbyte unified address space. Some versions have a memory-extension unit that expands addressing up to 1 Mbyte. This unit operates a bit like a PC AT's expanded memory. Two memory windows in the 64-kbyte address space map into a 1-Mbyte space. The CPU can directly access memory-mapped I/O.
Motorola pioneered using nonvolatile EEPROM in 8-bit µCs. Most family members feature EEPROM that you can program for embedded IDs, factory-test data, calibration data, special application encodings, chip configurations, or operating modes. In effect, the chip is customer configurable without having to go through the program-ROM cycle. Accessing EEPROM is like accessing program memory; the only difference is that reprogramming EEPROM is easy. An on-chip charge pump enables chip-level voltages to program the part.
68HC11s can run in single-chip mode using only on-chip memory resources or expanded mode using I/O ports to access additional external memory. Both multiplexed- and nonmultiplexed-external-bus versions are available. One option available with some units is programmable chip selects, which helps eliminate glue logic by selecting the proper memory device.
Operations for speeding code include swapping accumulators, exchanging accumulator and an index register, transferring SP+1 to an index register, and setting the SP from an index register. Bit operations test and set or clear bits using a word mask. A wait-for-interrupt instruction increments the PC, puts all registers on the stack, halts, and waits for an interrupt.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Motorola developed and sells the 68HC11; Toshiba is a second source. All versions have pulse accumulator, SPI, SCI General-purpose (HC11A series/11E series/11EA9/11L series/811E2): 0 to 3 MHz; 0 to 20-kbyte ROM/EPROM; 256- to 768-byte RAM; 512- to 2048-byte EEPROM; three to five capture/compare timers; 38 to 46 I/Os; eight-channel, 8-bit ADC. $6 to $12. Low-pin-count, general-purpose (HC11D series/ED0): 0 to 3 MHz; 0 to 4-kbyte ROM/EPROM; 192- to 512-byte RAM; four capture/compare timers; 30 to 32 I/Os. $3.34 to $7.28.
High-integration (HC11KA series/M2/P2): 0 to 4 MHz; 0 to 32-kbyte ROM/EPROM; 768- to 1280-byte RAM; 0 to 640-byte EEPROM; four capture/compare timers; four PWMs
Expanded memory with chip selects (HC11F1/C0/K series): 0 to 3 MHz; 256- to 1024-byte RAM; 0 to 640-byte EEPROM; four capture/compare timers; four PWMs (K4 only); MMU |
Notes:
| Support | |
|---|---|
| HARDWARE The 68HC11 has a variety of hardware toolschoose from a range of ICEs, development and evaluation modules, low-cost single-board computers, logic analyzers, and programmers. Standard device programmers can program 68HC11 EPROM versions. The µC has a self-programming mode as well, which lets you program the chip on the target board. | SOFTWARE The 68HC11 has a large base of development and operating software. Development tools include cross-assemblers, C and Modula-2 compilers, a Forth system, and simulators that run code on host systems. Source and symbolic debuggers are also available. ROM monitors let you debug code from a PC host, and real-time kernels provide multitasking operation. |
National Semiconductor's COP8 8-bit µC combines a minimal architecture with low-cost peripherals and as few as 16 pins to fit applications such as automotive, personal communications, consumer, medical, and industrial. The accumulator-based architecture includes a small set of registers, has no multiply or divide instructions (except for the COP888GW), and has no complex addressing. The controller is a static design and can run at voltages as low as 2.3V. Chips come in packages with as few as 16 pins and cost less than $1 in large volumes. The COP8 also serves as a core for application-specific processors.
The chip has six to eight control and data registers, including the accumulator. All registers are memory-mapped except the accumulator. The COP8 registers include the 8-bit accumulator, two 8-bit address registers, and a 15-bit PC, which the CPU can access as upper and lower 8-bit registers.
The µC executes an add, a shift, or a load in one internal clock cycle (1-µsec period). The instruction set is very compact and relatively simple77% of the operations execute in one clock and take up only one byte. One reason for the compact instructions is that the architecture is memory-mappedeven the peripherals.
The COP8 is a static design, and its clocks can be slowed to minimize power dissipation. Two power modeshalt and idlefurther cut power losses. Idle restricts peripheral operations; halt stops the clock. COP8s can run with external memory for debugging and prototyping code. An 8-bit port serially reads from and writes to external memory and provides emulation control.
COP8s can handle critical tasks: A watchdog timer catches runaway software; a brown-out detector detects power-loss conditions, which threaten safe operation. All software-generated errors, such as illegal ROM addresses or stack overflows, automatically cause a software interrupt or trigger a processor reset. These safeguards ensure that software or hardware errors will not cause indeterminate conditions.
The devices have various interrupt sources that include software, timers, and up to nine external interrupts. Interrupts and subroutine calls push the PC onto the stack and upgrade the stack pointer. Stack resides in RAM, limiting call and interrupt depth.
A special test-and-skip instruction eliminates code. This instruction can test for a condition and, if not true, skip condition processing in the next instruction. The device also performs bit manipulation with bit-set and -reset and bit-test-and-skip instructions.
| VARIATIONS/SPECIAL FEATURES |
|---|
| National Semiconductor developed the COP8 and is the sole source. The COP8 devices divide into a basic family and a feature family.
COP8 basic family
COP8 feature family4: dc to 10 MHz; 2- to 16-kbyte ROM; 128- to 512-byte RAM; watchdog timer; one to three 16-bit timers; idle timer; Microwire/Plus |
Notes:
| Support | |
|---|---|
| HARDWARE OTPs are available for most versions, as are hybrids with built-in EPROM for debugging. Metalink supplies development tools and hardware. | SOFTWARE National Semiconductor supplies assemblers and linkers for the COP8. ByteCraft (Waterloo, ON, Canada) has built a C compiler for the controllers, which it and National Semiconductor sell. National Semiconductor has integrated neural nets and fuzzy-logic technology into a COP8 development tool. |
Oki's 65K series chips are redesigns of the 8051 family, which Oki second-sources. Oki designers improved execution time by devising a new core and speeding up the instruction cycle. The 65K combines an 8-bit core with an 8-bit external bus. Oki also sells an nX 66K series, an extension of the 65K core with an 8-bit bus, a 16-bit core, and 200-nsec instruction time. Running at 12 MHz, the nX 65K delivers a 333-nsec instruction cycle, compared with one µsec for a standard 12-MHz 8051. These µCs are not code-compatible with the 8051, but a translator package (and some handiwork) can translate code from one to another. The static cores let clock rates fall to dc to cut power. Chips with on-board ADCs run at 2.7V to further reduce power.
Integrated peripherals include a multiply/divide unit, 16-bit timer with input capture and output compare registers, watchdog timer, UARTs, 8-bit ADCs, PWM, and a 14-bit time-base counter. OKI supplies OTP versions for fast production and prototyping.
The series differs from the 8051's Harvard architecture in having a single 64-kbyte address space for instructions and data. Like the 8051, memory-mapped special-function registers control the peripherals. Data memory is regular; unlike the 8051, there are no specialized segments that require special addressing or logically overlap other segments.
The nX 65K has four local register sets mapped in local data memory. One set acts as the current set for processing; switching to a new set makes for a fast context switch because no registers have to be saved in on-chip RAM or external memory. Unlike the 8051, the 65K has banks of 16 (not 8) 8-bit registers. Two of these registers can function as 16-bit registers for addressing, thus replacing the single 16-bit DPTR pointer in the 8051. The A (accumulator), B, SP, and PSW (program-status-word) 8-bit registers are separate.
The 8-bit 65K pages its local memory, blocking it into 256-byte pages referenced by PSW field. Code can address paged memory using 8-bit registers. Main-memory accesses require 16-bit addresses. The 65K makes a distinction (as does 8051) between local, 8-bit addressable paged memory and general, 16-bit addressable memory.
The 65K can perform bit manipulation. Instructions include set, reset, and complement bit. The 65K can complement its carry bit or transfer a bit to or from carry. Bit operations are not restricted (as in the 8051) and can be anywhere in memory.
Special instructions include exchange, 1/2-byte swap, compare (8 and 16 bit), call or return if carry or zero is set, complement (8- and 16-bit), predecrement and postincrement addressing, and indirect register call.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Oki developed the nX 65K and is the sole supplier. MSM65512A/14/16: 2.7/5V operation; up to 12 MHz; 8/16/32-kbyte ROM, 256/384/640-byte RAM, watchdog timer, three 8-bit timers, 16-bit timer with capture/compare register, 16-bit free-run counter; UART, 32/48/48 I/O pins; three external interrupts. $2.35/$4/$4.80. MSM65524: 3/5V operation; up to 10 MHz; 16-kbyte ROM, 384-byte RAM, watchdog timer, four 8-bit timers, 16-bit timer with capture and compare register, 16-bit free-run counter; UART, 44 I/O pins; three external interrupts; eight-channel 8-bit ADC; two PWMs. $4.25. MSM65X227: 5V operation; up to 6 MHz; 0-kbyte ROM, 1-kbyte RAM, 4-kbyte EEPROM; watchdog timer, two 8-bit timers, UART, 44 I/O pins; two external interrupts; four-channel eight-bit ADC; two PWMs. $11. MSM65355: 3/5V operation; 32 kHz and 0 to 10 MHz; 16-kbyte ROM, 384-byte RAM, watchdog timer, four 8-bit timers, 16-bit timer; three synchronous shift registers, 55 I/O pins; four external interrupts; eight-channel, 8-bit ADC; four PWMs; buzzer output. $5. |
| Support | |
|---|---|
| HARDWARE Evaluation boards and ICEs are available from Oki. Low-cost Metalink emulator available this fall. | SOFTWARE Development tools from Oki include a relocatable assembler/linker. |
Introduced in 1989, SGS-Thomson's ST6 is a stripped-down, first-generation, 8-bit accumulator-based µC. The chip targets low-end control and display tasks in automotive, large-appliance, radio/TV, telecommunications/security, and industrial applications. Most ST6s fit into a 20- or 28-pin package, making them ideal for tight-space applications. The basic ST6 die area is 2000 mm
The ST6 has six registers: two index, two general, an accumulator, and a PC. The PC is 12 bits; all other registers are eight bits. All basic arithmetic operations involve the accumulator as one parameter and end by placing a result into the accumulator. However, the ST6 is not a classic accumulator-based CPU. Loads are a little more flexiblethe accumulator can be either the source or destination. Also, both memory and registers can be incremented or decremented directly without passing through the accumulator.
Registers and peripherals are memory mapped in the chip's address space. Instructions address them directly as a memory location. To configure a peripheral or send or receive data to or from a peripheral, a program simply writes to or reads from the peripheral's memory registers.
The ST6 doesn't have a classic stack for holding PC values during subroutine calls or interrupts. Instead, chip architects put in an automatic fixed stack. On subroutine calls or interrupts, the hardware automatically pushes the current PC onto the stack. On return, the hardware pops the PC value off the stack and loads the PC with it. The automatic stack is only six levels deep, so you must carefully control subroutine-call depths. If the stack is full and a call or interrupt occurs, the current PC value pushes onto the stack and all stack entries move down one. The last entry (first in) will be lostas will be your system.
The PC addresses up to four kbytes of program memory. A banking scheme that uses a dedicated memory-mapped banking register can expand the program memory. The lower two kbytes of ROM can be banked, which provides access to higher 2-kbyte pages in program memory ranging up to 20 kbytes. Program memory can also hold constants or tables, which the CPU accesses via a 64-byte memory-mapped window in RAM that maps into ROM.
The instruction set is small and relatively straightforward. Relative jumps are restrained to 15 to +16 locations, and there are no complex instructions. The ST6 can perform bit-manipulation instructions such as set or reset bits in registers or memory, test bit with jump relative instruction.
| VARIATIONS/SPECIAL FEATURES |
|---|
| SGS-Thomson developed the ST6 and is the sole source.
ST621x/ST622x: Static to 8 MHz; 3V operation at 1 MHz; 2- to 4-kbyte ROM, EPROM or OTP; 64-byte RAM; watchdog; 8-bit timer
ST624x: Static to 8 MHz; 4- to 8-kbyte ROM; 128- to 192-byte RAM; 128-byte EEPROM; watchdog; two 8-bit timers
ST626x: Static to 8 MHz; 4-kbyte ROM; 128-byte RAM; 128-byte EEPROM; watchdog; two 8-bit timers |
Notes:
| Support | |
|---|---|
| HARDWARE SGS-Thomson sells an ICE for the ST6 family as well as a gang programmer and an EPROM programming board. An IBM PC parallel port drives the board. ST6 starter kits (from $125 to $450) can be configured as a nonreal-time in-circuit emulator, an EPROM programmer, or stand-alone apps board. | SOFTWARE A single-pass macroassembler and linker are available for the ST6. The tools use the ROM data window for holding constants in program ROM. SGS-Thomson also has a simulator that runs ST6 code on a PC host. The windowed simulator handles symbolic debugging with as many as 128 breakpoints and 128 software traps. A fuzzy-logic compiler is also available. |
SGS-Thomson's ST9 is an 8-bit processor with some 16-bit characteristics. The ST9 suits medium- to high-end 8-bit applications in automotive, telecommunications, industrial, and radio/TV control. Driven by a 24-MHz clock, the µC delivers 500-nsec operations and 1.8- and 2.3-msec multiplies and divides. The ST9's architecture is related to the Z8, for which SGS-Thomson is a second source.
The ST9 is a register-based processor that operates on a selected group or set of 16 registers, but it's not a classic register-based machine. Instead, the ST9 resembles the Zilog Z8 architecture's three address spacesprogram, memory, and register file. The ST9's CPU manages the 256-byte register file as 14 sets of 16 8-bit general-purpose registers rather than as one set of general-purpose registers (the 15th set is the system page; the 16th set is addressed as peripheral registers).
Switching from one set or group of registers to another makes for fast context switching because no registers must be saved or restored. Instead, the register pointer changes to reference a new register set. The register file has two register pointers. Each pointer can reference one working bank of eight registers, or a single pointer can address a working set of 16 registers.
The µC's 8-bit ALU uses a 16-bit instruction word.
Opcode+displacement is a classic 2-byte instruction usually requiring two memory fetches; a 16-bit instruction takes only one fetch. The ST9 has two internal buses: an 8-bit register bus and a 16-bit memory bus, which also moves instructions.
The general-purpose registers can be accumulators, index registers, or address pointers. Adjacent register pairs make up 16-bit registers for addressing or 16-bit processing. Although the ST9 has an 8-bit ALU, the chip handles 16-bit operations, including arithmetic, loads/stores, and memory/register and memory/memory exchanges. Many opcodes specify byte or word operationsthe hardware automatically handles 16-bit operations and accesses.
On-chip peripherals transfer data to or from memory or registers via DMA channels, thus offloading the CPU. A DMA channel can move up to 222 bytes to the register file or 64 kbytes to data memory.
For interrupts or subroutine calls, the CPU uses a system stack in conjunction with the SP. A separate user stack is under user control with a user SP. The stacks can be in on-chip RAM or off-chip memory.
Special instructions include test/test-complement under mask (AND destination with mask, test for 0) and bit set/reset/complement/test-and-set.
| VARIATIONS/SPECIAL FEATURES |
|---|
| SGS-Thomson developed the ST9 and is the sole source. All standard ST9 family variants include a serial peripheral interface (providing I
ST902X: 12- to 16-kbyte ROM
ST903X/4X: 8- to 16-kbyte ROM
ST90R50/51: Three multifunction timers
ST90R91: 1.5-kbyte RAM; one multifunction timer |
Notes:
| Support | |
|---|---|
| HARDWARE SGS-Thomson offers an ST9 ICE that uses a PC as the front end. The PC runs a symbolic debugger linked to the target µC. An EPROM programming board programs ST9s. SGS also has a starter kit for the ST9040> that supports nonreal-time in-circuit emulation. |
SOFTWARE ST9 software-development tools include a macroassembler, C compiler, linker/loader, library archive to maintain software object files, software simulator, and source-level, Windows-based debugger. The assembler provides high-level-language construct macros. Two real-time operating-system kernels are also available. |
Developed in the mid-'80s, Texas Instruments' TMS370 family of 8-bit µCs handles low-range to midrange applications in the automotive, industrial, communications, computer, and security industries. Clock rates go to 20 MHz, which delivers a 1.6-µsec register-to-register add. Peripherals include a timing subsystem with capture/compare registers, two sets of 16-bit timers, an 8-bit ADC, and two serial communications-port options. One-time-programmable versions are available for prototyping or debugging.
The TMS370's register-based architecture has up to 256 registers in a RAM register file. The CPU can address these registers as registers or as RAM. The processor stack is in the register RAM and referenced by an 8-bit stack pointer, limiting the stack size to 256 bytes. Instead of being memory-mapped, the on-chip peripherals are register-file-mapped: Each peripheral is assigned a frame of 16 registers in a peripheral filean equivalent to the register file in the address space. The peripheral file has 16 frames, one of which holds the system and EEPROM/EPROM control registers.
Instructions range from basic operations to two-address operations, such as adding data, using a register, and returning the results to the register. The CPU has some 16-bit operationssuch as word moves (two registers) and incrementing a wordand uses 16-bit offsets for jumps and register pairs as an address. All arithmetic, however, is 8 bit. Instructions take a variable number of cycles. Each cycle is one-fourth of the external-clock cycle (200 nsec for a 20-MHz clock).
The TMS370Cx5x family addresses up to 112 kbytes of external memory. The nonmultiplexed external bus provides 16 address bits and 8 data bits. The µC has up to six programmable chip selects for memory banking. External memory can be RAM or ROM. To run at 20 MHz with no wait states, the controller needs a 200-nsec cycle memory. Wait states are programmable for memory or I/O. Ports are memory-mapped.
Special instructions1's or 2's complement, double-byte move for register pairs and memory, swap nibbles and decimal add for BCD arithmetic, compare and exchange registers. Can decrement source and jump if not 0 and check two sources and jump if there is at least 1 matching bit in eachor at least one nonmatching bit pair.
Bit operationsInclude jump if bit is 0 or 1, complement, set or clear bit. Instruction operates on registers in register or peripheral file.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Texas Instruments developed the TMS370 and is the sole source.
370x1x: 2 to 20 MHz, 2- to 4-kbyte ROM/EPROM, 128-byte RAM, 0- or 256-byte EEPROM
370x2x: 2 to 20 MHz, 4- to 8-kbyte ROM/EPROM, 256-byte RAM, 0- or 256-byte EEPROM
370x4x: 2 to 20 MHz, 4- to 8-kbyte ROM/EPROM, 256-byte RAM, 0- or 256-byte EEPROM
370x5x: 2 to 20 MHz, 4- to 32-kbyte ROM/EPROM, 256-byte to 1-kbyte RAM, 0 to 512-byte EEPROM |
Notes:
| Support | |
|---|---|
| HARDWARE TI's TMS370 development systems range from a simple evaluation kit to an ICE and a debugger. ICEs are also available from third-party vendors, as are EEPROM/EPROM and gang-EPROM programmers. | SOFTWARE Assemblers, linkers, and C compilers are available from TI and third-party vendors. TI's C compiler comes with a source-code debugger. Also available is a third-party instruction-set simulator that runs on a PC. |
A pseudopipeline speeds operations. The TLCS-90 CPU has two stages: In the first stage, the CPU fetches and decodes instructions; in the second stage, the decoded instructions execute. While the current instruction executes, the CPU fetches and decodes the next one. Instructions have one or two op-code bytes. Immediate and address data can take up to three bytes; the maximum instruction length is five bytes (two op-code, three data bytes). The first op-code byte specifies the position of the second op-code byte in the instruction stream.
The controller sports a Z80-like dual set of eight 8-bit general-purpose registers. The registers can be paired for 16-bit loads, stores, and arithmetic operations. The dual register set allows programs to perform fast context switching and register storage. Supplementing the general-purpose registers are two 16-bit index registers: the stack pointer and the program counter. The 16-bit index registersas well as 16-bit loads, exchanges, and arithmetic operationsmake 16-bit addressing easy. Two 8-bit bank registers extend addressing from 16 to 24 bits, and an MMU extends addressing to 8 Mbytes of data. However, extended addressing is not available on all TLCS-90 µCs.
The µC has a synchronous external bus; multiplexed and non-multiplexed bus versions are available. Some chips also have wait-state registers that can generate up to two wait states for interfacing to slower memory. A standard memory cycle takes four external clocks.
Toshiba engineers added a µDMA controller that processes most interrupts directly, without involving the CPU. The TLCS uses clock-stealing µDMA to move data, offloading the CPU. TLCS-90 µDMA controllers handle 4 to 11 µDMA channels, each programmed for a specific interrupt event. An event interrupts the CPU but does not require the execution of a service routine. Instead, themDMA hardware itself moves a data block, byte by byte, from one memory location to another. Memory-block transfers can be up to 256 bytes. At the completion of the transfers, the CPU executes the service routine. The two types of TLCS-90 DMA controllers are the slower, more general µDMA and the faster HDMA, which is about three times faster than µDMA transfers.
Special instructionsExchange with alternate register set; exchange registers, decrement and jump if not zero; compare, increment/decrement and repeat; load data block (mem to mem); search data block (search up to 64 kbytes for a pattern with one instruction). Bit instructionsbit test, set bit, reset bit, test, and set.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Toshiba is the developer and sole supplier. Note: General pricing for all controllers listed below is around $3.50. TMP90C840/1, TMP91C640/1, TMP90CM40: 1 to 16 MHz, 0- to 32-kbyte ROM; 256- byte to 1-kbyte RAM; serial I/O; watchdog timer; four 8-bit timers; one 16-bit timer; four external interrupts; 28 or 54 I/Os; six-channel, 8-bit ADC; two-channel stepping-motor control; 11-channel µDMA. TMP90C400/1, TMP90C800/1: 1 to 12.5 MHz, 0 to 8-kbyte ROM; 128- to 256-byte RAM; serial I/O; four 8-bit timers; three external interrupts; 38 or 56 I/Os[super{1}]; eight-channel µDMA. TMP90C802/3: 1 to 12.5 MHz, 0- to 8-kbyte ROM; 128- to 256-byte RAM; serial I/O; watchdog timer; four 8-bit timers; three external interrupts; six/32 I/Os; four-channel µDMA. TMP90C844/H44: 1 to 16 MHz, 8-/16-kbyte ROM; 256-/ 512-byte RAM; serial I/O; watchdog timer; four 8-bit timers; one 16-bit timer; three external interrupts; 45/54 I/Os; two-channel stepping-motor control; 13-channel µDMA; four-channel, 8-bit ADC; slave function[super{2}]. TMP90C845/H45: 1 to 16 MHz, 256-/512-byte RAM; watchdog timer; four 8-bit timers; one 16-bit timer; serial I/O; three external interrupts; 38 I/Os; two-channel stepping-motor control; 11-channel µDMA; four-channel, 8-bit ADC; expanded external memory (4-Mbyte code, 8-Mbyte data), pro-grammable chip selects[super{3}]. TMP90C051: 1 to 16 MHz, two serial I/O channels; watchdog timer; four 8-bit timers; 8-Mbyte address space; MMU; eight external interrupts; 31 I/Os; two-channel, four-phase stepping-motor control; two high-speed DMA channels; DRAM controller; real-time clock. |
Notes:
| Support | |
|---|---|
| HARDWARE Toshiba sells evaluation boards and an ICE for all TLCS-90 chips. Third-party ICEs are available for most derivatives. | SOFTWARE Toshiba and third-party macroassembler/linker, C compiler, and source-level debugger. |
Introduced in 1975, the 8-bit 6502 is a derivative of Motorola's 6800. The 6502 was one of the first successful µPs and served as the base for a number of popular early PCs, such as the Commodore PET and Apple II. The 65C02 and its descendants now serve as embedded controllers for telecommunications, TV, computer-peripheral, consumer-product, and industrial-control applications.
The 6502's core is also available for inclusion into single-chip microcomputers. Western Design Center (WDC) sells static CMOS 6502 µPs and µCs as well as 16-bit extended µPs. Mitsubishi redesigned the 6502 to create the 37400 µC, which sports a superset of the 6502 code. Rockwell sells 6502 µPs as well as 6500/x µCs built around the CPU. Rockwell's 6502-based CMOS controllers hold a major presence in modem and fax-machine applications.
The accumulator-based 6502/37400 has a single 8-bit accumulator and two 8-bit index registers. The stack pointer is eight bits wide, limiting the stack to 256 entries, but the PC is 16 bits. For speed, the implementation is semipipelined: The CPU fetches the next instruction while decoding and executing the current instruction. The relatively fast memory interface lets code use page-0 RAM as a large register set to hold dynamic variables.
The 6502/37400 has a 64-kbyte unified address space, which divides into 256-byte pages for X, Y indexing. The 0 page is the first page in memory and is easily addressed via special address modes and instructions. The chip has a fast nonmultiplexed external bus16 bits for addresses and eight bits for data.
WDC's 16-bit extension of the 6502, the W65C816S, has a 6502-emulation mode that lets the W65C816S execute 6502 object code directly. The extended versions have 16-bit accumulator, index, and SP registers. The 16-bit CPU also added 78 op codes, nine addressing modes, and a second 8-bit accumulator.
The W65C816 family addresses up to 16 Mbytes of memory; the 6502 has a 64-kbyte limit. The 16-bit CPU generates a 24-bit address by concatenating the 16-bit program or calculated address with an 8-bit bank register (there's also a bank register for program and one for data). Mitsubishi has also extended the architecture to 16 bits.
Special instructionsTest memory bits against accumulator; compare regs to memory; push/pop stack instructions for accumulator, PSW, effective-addr, index regs, bank regs; bit manipulation, coprocessor enable; load one index reg from another; block moves; long jumps and returns; stop CPU; wait for interrupt.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Rockwell and WDC sell 6502/6500 parts; Mitsubishi makes the 37400 family, a redesigned 6502. Mitsubishi: 4 to 12.5 MHz, 4- to 20-kbyte ROM, 128- to 650-byte RAM, four or five timers, PWM, serial I/O, 8-bit ADC, 8-bit DAC, UART, dot-matrix LCD controllers, on-screen display controller (TV), closed-caption controller. $5 to $9. Rockwell: 4 to 10 MHz, 2- to 8-kbyte ROM, 64- to 624-byte RAM, one to four 16-bit counters, five to eight external interrupts, USART, MPY instruction (R65C40). $2 to $8. WDC: Static 20 MHz (W65C02S, $4.50); static 16 MHz (W65C816S, $6). W65C134S/W65C265S static 8 MHz, 4- to 8-kbyte ROM, 192- to 576-byte RAM, four to eight 16-bit timer/counters, eight chip-select signals, one to four UARTs, two tone generators, watchdog timer, serial-interface channel, two programmable clock inputs. $10.50/$21. |
| Support | |
|---|---|
| HARDWARE ICEs and logic analyzers are available for 6502/65816 chips. Most µC vendors supply piggyback DIPs, which are DIP chips with a piggyback for EPROM to hold program memory. Evaluation boards are available from chip vendors and third-party suppliers. Mitsubishi supplies a ROM emulator for the µCs. | SOFTWARE The 6502/65816 family has a large third-party base of operating and development software (eg, ByteCraft and 2500AD). Languages include assembler, Forth, Basic, C, and Pascal. Apple IIe (65C02) and IIgs (65C816) can serve as native development platforms. Mitsubishi supplies a structured relocatable assembler and multiscreen debugger. |
The 8-bit Z8 handles embedded applications ranging from low-end mice controllers to high-end disk drives and servo control. Z8 family members range from a minimal 18-pin DIP µC to a Z8 CPU integrated with a 16-bit DSP processor for math coprocessing. Z8s don't have on-chip RAM but instead use a small number of register sets for on-chip dynamic storage. The Z8 does, however, access external memory for both code and data.
The Z8's core is a simple register-file-based architecture with 124 to 256 8-bit registers in SRAM. The SRAM also holds the I/O control registers, 16-bit stack pointer (two registers), and register pointer. On-chip program memory runs from 2 to 20 kbytes of ROM or OTP memory.
The unusual Z8 architecture has three address spaces: 64-kbyte code, 64-kbyte data, and a CPU register file with up to 256 registers. The external code and data spaces can be combined off chip. References to external memory are only loads or stores; data manipulation is confined to operations between on-chip registers. Switching between register groups or sets delivers a fast context switch.
Z8s have complex instructions that help to minimize coding multiple operations, such as fetching data, operating on it, and incrementing address pointers. Basic Z8s lack hardware multiply or divide instructions; Zilog, however, added a MPY/DIV unit to some versions.
For heavyweight math processing, Zilog added a 16-bit DSP MAC (multiply and accumulate) coprocessor that has its own register file and RAM. In the 86120, the CPU and the DSP coprocessor operate independently. The processors communicate via shared register memory and interrupts. The DSP coprocessor, which has its own local program and data memory to hold parameters and results, controls its own I/O peripherals, including ADCs and DACs. The coprocessor can take analog data in, operate on it, and output it without affecting the Z8 CPU, which runs from its own memory. They can also do a MAC cycle while updating the addressing for the next set of X, Y parameters needed for the next MAC cycle.
Block transfers are accomplished using a load-external-data-and-autoincrement instruction. This instruction speeds loading data from memory by moving a byte from memory to a register and incrementing memory and the register address held in working registers. A load-constant-auto-increment instruction does the same thing for moving constants from program memory to a register file. Both save time and code by automatically indexing address pointers.
Special operations include BCD arithmetic.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Zilog developed and sells the Z8. Second-source vendors include SGS-Thomson and VLSI Technology. Zilog's Z8s have the designation Z86Cxx. Product offerings classify into four categories: Discrete Z8s: Low-cost consumer electronics; 512- to 4096-byte ROM; 64- to 256-byte RAM. $1 to $2. Z8 regular: Broad-range µCs; 2- to 32-kbyte ROM; 128- to 1024-byte RAM. $1 to $5. Low voltage: Portable electronics; 512-byte to 16-kbyte ROM; 256-byte RAM; enhanced counter/timers. $1.50 to $4. Z8 with DSP: 16x16-bit multiplier and 24-bit ALU and accumulator; ADC and DAC functions; bundled software. $2 to $10. |
| Support | |
|---|---|
| HARDWARE Evaluation boards are available from Zilog for most Z8 µCs and for applications such as keyboards, IR control, and modems. Zilog has ROMless and piggyback versions for development and prototyping. ICEs and programmers are also available for most chips. | SOFTWARE Development software enables terminal- or PC-based debugging with a ROM monitor from Zilog. Zilog also supplies a terminal emulator with a ROM monitor and a macroassembler/linker/loader. |
The Z80, introduced in 1977, is one of the pioneering 8-bit µPs. Former Intel engineers based the Z80 on the 8080 and added a dual-register-set architecture with index registers, built-in memory refresh, and a more powerful extended instruction set. Used in early PCs, the Z80 family also has a solid embedded-systems base in communications (modems and Appletalk), disk controllers, and various monitor/control systems. Later versions such as Zilogs Z80180 and Z380 have extended addressing (to 1 Mbyte and 4 Gbytes, respectively) and specialized on-chip peripheral controllers for communications.
Duplicate sets of 8-bit, general-purpose registers make for fast context switches. But even with two register sets, the Z80 is an accumulator-based CPU. All 8-bit arithmetic/logical operations use the accumulator as source and destination. Compare operations also are relative to the accumulator register.
Special 16-bit registers make addressing much easier for programmers. These registers include two index registers, a stack pointer, and a program counter. Two of these registers also help coding: the interrupt register, which holds the eight upper address bits for interrupt vectors, and the 8-bit memory-refresh register, which uses the lower address bits for memory refresh.
The Z80 family relies on off-chip memory. In the 8-bit world, the Z80 is ideal for large-scale memory-to-memory operations.
A newer, static S180 core is replacing the older Z180 core. Not only is the static core faster, but it lets designers control power consumption by drastically dropping the clock rate. The new core runs at the oscillator clock rate; the older core runs at half that rate. The S180 has specialized communications peripherals that include two DMA channels, two UARTs, one or two serial communications controllers, and a counter/timer circuit.
The Z80s complex instruction set provides many programming options, including block memory moves up to 256 bytes and character memory searches within a block. Instructions are from one to four bytes long. To simplify addressing, the CPU does 16-bit accesses (two 8-bit words accessed sequentially). The Z80 performs 16-bit arithmetic including add, subtract, increment, or decrement register pairs. The mC also performs BCD arithmetic and bit operations such as set, reset, or test a bit in register or memory location.
| VARIATIONS/SPECIAL FEATURES |
|---|
| Zilog is the original Z80 family vendor. Z80 (designated Z84xxx by Zilog) second sources include Hitachi, NEC, SGS-Thomson, Sharp, Toshiba, and VLSI Technology. Zilog, Sharp, and Toshiba use the Z80 as an ASIC core. Hitachi, in a joint development with Zilog, designed the 64180a Z80 with an MMU that extends addressing to 1 Mbyte. Zilog and Hitachi offer several 64180-based µPs with on-chip memory. Discrete Z80: 10 to 20 MHz. $1.36 (100,000). Z84C01: Basic Z80 with clock generator and four power-down modes. $1.10 (100,000). Z84015/840C15: Basic Z80; watchdog timer; SIO and PIO1; CTC2; clock generator; eight I/Os. $3.75 (100,000). Z80181: Z1803; CTC2; SCC4; 16 I/Os. $7.75 (100,000). S180: Static versions of Z180; 16 MHz. $5.10 (100,000). Z80182: S180; ESCC5; 16550 UART mimic; 24 I/Os. $10.30 (100,000). Z380: 32-bit internal data paths and ALU; enhanced instruction set, but compatible with Z80; 4-Gbyte linear address range; 10 to 18 MHz; 3.3/5V. $10 (100,000).
|
Notes:
| Support | |
|---|---|
| HARDWARE Support chips for the basic Z80 CPU include controllers for the counter/timer, DMA, parallel I/O, serial I/O, serial communications, and enhanced serial communications controllers. Zilog has evaluation boards and ICEs for all family members. | SOFTWARE The Z80 has 15 years worth of software tools, including assemblers, Forth and Basic interpreters, and C compilers. Zilog offers the Electronic Programmers Manual, an on-line reference and interactive-programming aid for peripherals. |