Staudhammer, J, Chen, S.-L, Windley, P.J., Frenzel, J.F. "Microprocessors The Electrical Engineering Handbook Ed. Richard C. Dorf Boca Raton CRC Press llc. 2000
Staudhammer, J., Chen, S.-L., Windley, P.J., Frenzel, J.F. “Microprocessors” The Electrical Engineering Handbook Ed. Richard C. Dorf Boca Raton: CRC Press LLC, 2000
82 Microprocessors John Staudhammer Office of Naval Research Sue-Ling Chen 82.1 Practical Microprocessors Contractor, Allied signal Types of Microprocessors and Microcontrollers. Software for uP/uC Phillip j. windley Systems. Packaging and Cost. Programming uPs. Development upport. Comparison of uP/uC Chips. Trends in uP/uC Developments James F. Frenzel 82.2 Applications University of idaho Data Collection· Control· Computing 82.1 Practical Microprocessors John Staudhammer and Sue-Ling Chen A microprocessor(uP) is a semiconductor die containing the components of a computer central processor, omplete with instruction processing unit, arithmetic, int and basic communication facilities. Such devices have been around since the early 1970s and have greatly benefitted from the continuing improvements in electronics. As microelectronic technology allows the feature sizes of components to be shrunk, more powerful uP systems are being put on single dies. One of the early microprocessors, the Intel 8080, is still a widely used controller; its understanding and study are recommended for all designers of microprocessor systems [see Gaonkar, 1984]. Early processors contained a few thousands of transistors, while the top-end microprocessor has over 1.5 million. The early processors were 4-bit machines, initially intended for hand-held calculator use; the largest chips today are intended for use as full central processing units of large computers. What makes these devices micro is that they are microelectronic devices. These devices are typically built of NMOS(N-type metal-oxide semiconductoror CMOS(complementary metal-oxide semiconductor)circuits; the CMOS version is typically a bit more expensive and requires less power. An excellent overview of micro- processors and systems using them is found in Raffiquzzaman [1990] Application of a microprocessor involves adding memory for program and data, and input/output circuitry which may involve analog/digital and digital/analog converters As feature sizes of electronic components shrink, the manufacturer of the chip has three options: 1. Reduce the chip size(the die size)-this may result in a cheaper device of the same capability 2. Increase the processing power at the same cost. 3. Add peripheral circuits to the processor, thus putting on-chip devices normally added to the uP. Adding t combination of peripherals has the greatest benefit for system cost. A microcontroller (uC) is a microprocessor with peripherals on the same chip. These include various types of memory, interrupt structures, communication means, timing and data acquisition circuits. All three chip developments listed above occur simultaneously, thus keeping a successful product line going for many years. For example, the Motorola 6800 processor was introduced over 20 years ago; today it is still available, but the manufacturer steers designers to the successor chips, the 6809 uP and the 68HC1l uo A uP chip communicates to its peripherals by means of three sets of lines: the bidirectional data bus, memory address bus, and the control bus. In addition, the up will also send/receive data on communication c 2000 by CRC Press LLC
© 2000 by CRC Press LLC 82 Microprocessors 82.1 Practical Microprocessors Types of Microprocessors and Microcontrollers • Software for mP/mC Systems • Packaging and Cost • Programming of mPs • Development Support • Comparison of mP/mC Chips • Trends in mP/mC Developments 82.2 Applications Data Collection • Control • Computing 82.1 Practical Microprocessors John Staudhammer and Sue-Ling Chen A microprocessor (mP) is a semiconductor die containing the components of a computer central processor, complete with instruction processing unit, arithmetic, interrupt , and basic communication facilities. Such devices have been around since the early 1970s and have greatly benefitted from the continuing improvements in electronics. As microelectronic technology allows the feature sizes of components to be shrunk, more powerful mP systems are being put on single dies. One of the early microprocessors, the Intel 8080, is still a widely used controller; its understanding and study are recommended for all designers of microprocessor systems [see Gaonkar, 1984]. Early processors contained a few thousands of transistors, while the top-end microprocessor has over 1.5 million. The early processors were 4-bit machines, initially intended for hand-held calculator use; the largest chips today are intended for use as full central processing units of large computers. What makes these devices micro is that they are microelectronic devices. These devices are typically built of NMOS (N-type metal-oxide semiconductor) or CMOS (complementary metal-oxide semiconductor) circuits; the CMOS version is typically a bit more expensive and requires less power. An excellent overview of microprocessors and systems using them is found in Raffiquzzaman [1990]. Application of a microprocessor involves adding memory for program and data, and input/output circuitry, which may involve analog/digital and digital/analog converters.As feature sizes of electronic components shrink, the manufacturer of the chip has three options: 1. Reduce the chip size (the die size)—this may result in a cheaper device of the same capability. 2. Increase the processing power at the same cost. 3. Add peripheral circuits to the processor, thus putting on-chip devices normally added to the mP. Adding the right combination of peripherals has the greatest benefit for system cost. A microcontroller (mC) is a microprocessor with peripherals on the same chip. These include various types of memory, interrupt structures, communication means, timing and data acquisition circuits. All three chip developments listed above occur simultaneously, thus keeping a successful product line going for many years. For example, the Motorola 6800 processor was introduced over 20 years ago; today it is still available, but the manufacturer steers designers to the successor chips, the 6809 mP and the 68HC11 mC. A mP chip communicates to its peripherals by means of three sets of lines: the bidirectional data bus, the memory address bus, and the control bus. In addition, the mP will also send/receive data on communication John Staudhammer University of Florida and Office of Naval Research Sue-Ling Chen Contractor, Allied Signal Phillip J. Windley Brigham Young University James F. Frenzel University of Idaho
ines; the number and types of these vary greatly among chips. a uc will have on the same chip a number of memory elements, timers, communication ports and buffers, counters, and analog/digital converters in addition to a processor; communication to the peripheral circuits is through ports assigned to these devices, as well as any needed external memories. A discussion of general uC systems is given in Clements [1987], while Myers and Budde[ 1988] present the details of a very-high-performance Ho processors require an external clock, typically a crystal. The processor internal circuits run at this speed, but external devices usually use a submultiple of this rate, the bus clock, which is usually 2 to 4 times slower. The advertised clock rate is usually the external clock rate, not the bus cycle speed. There are well over a hundred different uP systems on the market. They each have peculiarities and may have me advantages. They differ by the kind of data they handle, the amount of processing they do, and the software apport they enjoy. What makes uP practical is not so much its claimed prowess, typically stated in peak instruction execution capability(MIPS, millions of instructions per second), but rather its ease of use in a given applicatio determined to a large degree by the kind and amount of support software available from the manufacturer. Types of Microprocessors and Microcontrollers The yearly compendium of uP/uC chips [Markowitz, 1997] categorizes these chips by the width of the data path: 4, 8, 16, 32, and 64 bits. In addition, high-performance chips include bit/word slice chips--these are meant to implement the functions of a central processing unit for a limited number of bits(4 or 8 bits)and re meant to be concatenated for handling an entire computer word. For a discussion of these chips and their uses, see Mick and Brick [1980] The most precious resource in a uP chip is the number of connection pins. Great efforts are made to utilize the ones used by various control lines and mode selections for the processor. Hence, a given uP chip may have four or more modes of operation: it is simply cheaper to build a flexible system, rather than several different ones. The vast majority of uPs possess a richness of data access (addressing modes ) they support mai ifferent ways of working with memory and external data items. They are complex instruction set computers (CISC). A prime example is the Motorola 68000 with five data groupings and nine addressing modes Even the simplest 4-bit processor in wide use(National Semiconductor COP400)has a 10-bit address bus (and a 4-bit data bus). The device can have up to l K words(1024 bytes)of memory on the chip, which is often enough for a simple dedicated task. Thus, these chips often appear as single items in simple computer controlled devices. Most of these chips are found in embedded applications, in kitchen appliances, and in toys By far the largest volume of uPs are 8-bit devices; they use 8-bit-wide(1 byte)data paths, but have address busses usually 16(or more)bits. Often the data bus is time-multiplexed with the lower byte of the address bus These types of devices can access as much as 65 K memory locations. The typical instruction execution time is 3 to 7 bus cycles. a widely used 8-bit processor is the Zilog Z-80 The 16-bit uP chips have 16 data and address lines. The typical execution time is 2 to 5 bus cycles. The 32-bit and 64-bit uP chips are the high end of these devices and find application in advanced personal computers, high-performance workstations, and digital controllers. They are characterized by high cost(com- pared to most uC chips) and extensive support circuitry. The typical execution time is 1 to 2 bus cycles. They represent the developing efforts in up technology. Microcontroller chips contain a uP and various items that make up a up-based system: there is usually some random access memory(RAM)for holding volatile data, at least one kind of read only memory(roM) for holding the control program, communication peripherals, including parallel interface(s), serial communication dapter(s), various counting and timing circuits for measuring input pulses, and analog/digital converters Because each processor has an external clock, usually a crystal clock, timing intervals can be determined to great precision. Many procedures have been developed to take advantage of this precision: voltage-to-frequency converters are used externally to bring pulses to the uP system, which then proceeds to accurately count them. The timing and counting capabilities of uP systems gives them their ubiquitous applicability. Software for uP/uC Systems Manufacturers of up/uc devices have gone to extraordinary efforts to make their devices attractive to system designers. Much software is offered for use with the chips and to support the design effort. ROM-based monitor e 2000 by CRC Press LLC
© 2000 by CRC Press LLC lines; the number and types of these vary greatly among chips. A mC will have on the same chip a number of memory elements, timers, communication ports and buffers, counters, and analog/digital converters in addition to a processor; communication to the peripheral circuits is through ports assigned to these devices, as well as any needed external memories. A discussion of general mC systems is given in Clements [1987], while Myers and Budde [1988] present the details of a very-high-performance mC. All processors require an external clock, typically a crystal. The processor internal circuits run at this speed, but external devices usually use a submultiple of this rate, the bus clock, which is usually 2 to 4 times slower. The advertised clock rate is usually the external clock rate, not the bus cycle speed. There are well over a hundred different mP systems on the market. They each have peculiarities and may have some advantages. They differ by the kind of data they handle, the amount of processing they do, and the software support they enjoy. What makes mP practical is not so much its claimed prowess, typically stated in peak instruction execution capability (MIPS, millions of instructions per second), but rather its ease of use in a given application, determined to a large degree by the kind and amount of support software available from the manufacturer. Types of Microprocessors and Microcontrollers The yearly compendium of mP/mC chips [Markowitz, 1997] categorizes these chips by the width of the data path: 4, 8, 16, 32, and 64 bits. In addition, high-performance chips include bit/word slice chips—these are meant to implement the functions of a central processing unit for a limited number of bits (4 or 8 bits) and are meant to be concatenated for handling an entire computer word. For a discussion of these chips and their uses, see Mick and Brick [1980]. The most precious resource in a mP chip is the number of connection pins. Great efforts are made to utilize the ones used by various control lines and mode selections for the processor. Hence, a given mP chip may have four or more modes of operation: it is simply cheaper to build a flexible system, rather than several different ones. The vast majority of mPs possess a richness of data access means (addressing modes); they support many different ways of working with memory and external data items. They are complex instruction set computers (CISC). A prime example is the Motorola 68000 with five data groupings and nine addressing modes. Even the simplest 4-bit processor in wide use (National Semiconductor COP400) has a 10-bit address bus (and a 4-bit data bus). The device can have up to 1 K words (1024 bytes) of memory on the chip, which is often enough for a simple dedicated task. Thus, these chips often appear as single items in simple computercontrolled devices. Most of these chips are found in embedded applications, in kitchen appliances, and in toys. By far the largest volume of mPs are 8-bit devices; they use 8-bit-wide (1 byte) data paths, but have address busses usually 16 (or more) bits. Often the data bus is time-multiplexed with the lower byte of the address bus. These types of devices can access as much as 65 K memory locations. The typical instruction execution time is 3 to 7 bus cycles. A widely used 8-bit processor is the Zilog Z-80. The 16-bit mP chips have 16 data and address lines. The typical execution time is 2 to 5 bus cycles. The 32-bit and 64-bit mP chips are the high end of these devices and find application in advanced personal computers, high-performance workstations, and digital controllers. They are characterized by high cost (compared to most mC chips) and extensive support circuitry. The typical execution time is 1 to 2 bus cycles. They represent the developing efforts in mP technology. Microcontroller chips contain a mP and various items that make up a mP-based system: there is usually some random access memory (RAM) for holding volatile data, at least one kind of read only memory (ROM) for holding the control program, communication peripherals, including parallel interface(s), serial communication adapter(s), various counting and timing circuits for measuring input pulses, and analog/digital converters. Because each processor has an external clock, usually a crystal clock, timing intervals can be determined to great precision. Many procedures have been developed to take advantage of this precision: voltage-to-frequency converters are used externally to bring pulses to the mP system, which then proceeds to accurately count them. The timing and counting capabilities of mP systems gives them their ubiquitous applicability. Software for mP/mC Systems Manufacturers of mP/mC devices have gone to extraordinary efforts to make their devices attractive to system designers. Much software is offered for use with the chips and to support the design effort. ROM-based monitor
THE INTEGRATED CIRCUIT M icroelectronics has been the most significant area of development in Ia electrical technology in recent years 1 and has had a profound effect on the course of electrical engineering. The integrated circuit was one of the major developments of its time The increasing complexity of electronic devices meant that even transistorized circuits ould be too large and heavy, especially for aero- space applications. In addition, the reliability of uch circuits was limited by the ever-increasing number of interconnections. The integrated cir- uit was a solution to both of these problems They actually changed the way electrical circuits The Intel 4004, the first commercial microprocessor, was were designed. Engineers had grown accus- originally designed for a programmable calculator. It repre- tomed to creating circuits with a minimum of sented the first consolidation of the arithmetic and logic active components, since transistors and diodes functions of several chips onto a single integrated circuit were relatively more expensive than resistors(Photo courtesy of the IEEE Center for the History of Elec- and capacitors. However, active components are trical Engineering. both smaller and easier to put on a silicon chip than inactive ones. Thus, the circuits most adaptable to integration are digital circuits, with many active components performing"yes-no"logic functions. Since these are the types of circuits used in computers it actually encouraged engineers to look for digital solutions to design problems. The blending of microelectronics and computers has produced the microprocessor, the computer on a chip. This has made possible tremendous reductions in computer size and cost, and consequently has made computers far more available for previously undreamed-of applications. Not since the develop- ment of electric power systems began over one hundred years ago have engineers produced such a fundamental and far-reaching tool for change. Courtesy of the IEEE Center for the History of Electrical Engineering. programs are available in most chips so that normal communication tasks can be accomplished easily; programs usual input/output tasks, data acquisition, timing, and program examples are distributed so that(relatively) error-free software is available for the designers. Most of these are distributed through public-access dial-up bulletin boards. Programming then becomes largely an adaptation of these programs to the tasks that the system is to perform. Of course, the system task analysis and program system design are still the designer's responsi bilities. as is the conduct of a software validation. The uP receives instructions, from its internal or external memory, and data, as a combination of zeros and ones; it is this machine code instruction that controls the operation of the system. The writing of such machine code is far too tedious. An English-like language, machine mnemonics, is used to describe each machine operation and this is then translated to the 0s and 1s which are stored in the memory. For example ADD 123 may stand for the machine code necessary to perform the addition of the number contained in memory location 123 to the content of the computers arithmetic register, leaving the result in the arithmetic register. The manufacturers supply assemblers to accomplish the mnemonic language assembly into code that may be loaded into the uP memory. These assemblers typically will run on personal computers and various minicomputer systems. Pro- e 2000 by CRC Press LLC
© 2000 by CRC Press LLC programs are available in most chips so that normal communication tasks can be accomplished easily; programs for usual input/output tasks, data acquisition, timing, and program examples are distributed so that (relatively) error-free software is available for the designers. Most of these are distributed through public-access dial-up bulletin boards. Programming then becomes largely an adaptation of these programs to the tasks that the system is to perform. Of course, the system task analysis and program system design are still the designer’s responsibilities, as is the conduct of a software validation. The mP receives instructions, from its internal or external memory, and data, as a combination of zeros and ones; it is this machine code instruction that controls the operation of the system. The writing of such machine code is far too tedious. An English-like language, machine mnemonics, is used to describe each machine operation and this is then translated to the 0’s and 1’s which are stored in the memory. For example ADD 123 may stand for the machine code necessary to perform the addition of the number contained in memory location 123 to the content of the computer’s arithmetic register, leaving the result in the arithmetic register. The manufacturers supply assemblers to accomplish the mnemonic language assembly into code that may be loaded into the mP memory. These assemblers typically will run on personal computers and various minicomputer systems. Programs that monitor the operation of an actual chip through the mP serial port(s) are effective development tools. THE INTEGRATED CIRCUIT icroelectronics has been the most significant area of development in electrical technology in recent years and has had a profound effect on the course of electrical engineering. The integrated circuit was one of the major developments of its time. The increasing complexity of electronic devices meant that even transistorized circuits could be too large and heavy, especially for aerospace applications. In addition, the reliability of such circuits was limited by the ever-increasing number of interconnections. The integrated circuit was a solution to both of these problems. They actually changed the way electrical circuits were designed. Engineers had grown accustomed to creating circuits with a minimum of active components, since transistors and diodes were relatively more expensive than resistors and capacitors. However, active components are both smaller and easier to put on a silicon chip than inactive ones. Thus, the circuits most adaptable to integration are digital circuits, with many active components performing “yes-no” logic functions. Since these are the types of circuits used in computers, it actually encouraged engineers to look for digital solutions to design problems. The blending of microelectronics and computers has produced the microprocessor, the computer on a chip. This has made possible tremendous reductions in computer size and cost, and consequently has made computers far more available for previously undreamed-of applications. Not since the development of electric power systems began over one hundred years ago have engineers produced such a fundamental and far-reaching tool for change. (Courtesy of the IEEE Center for the History of Electrical Engineering.) The Intel 4004, the first commercial microprocessor, was originally designed for a programmable calculator. It represented the first consolidation of the arithmetic and logic functions of several chips onto a single integrated circuit. (Photo courtesy of the IEEE Center for the History of Electrical Engineering.) M
Hence, the typical software includes an assembler, a loader, and a monitor. More these tasks is available from third-party vendors; many of these extra-cost software packages are highly cost effective. Interactive assemblers and debugging tools are particularly good investments. nd Cost The simplest processors are housed in normal dual in-line packages(DIP)of 16 pins or more, spaced 0.3 inches wide. Thus, they resemble conventional transistor-transistor logic (TTL) packages. The mid-range ones are usually in large DIP packages, 0.8 inches wide, with 40 to 68 pins(2 to 4 inches long. The high-performance ones come in multirow pin packages and may require 200 connections and may use unusual chip sockets. The high performance chips may require special cooling Virtually all processors are multisource, i. e, they are available from more than one manufacturer. This n important consideration for continued product support. The processors come in various speed grades; the higher speed ones may be 3 to 5 times as costly as the slow-speed versions. The low-end processors, with no memory and a few communication ports, cost less than Sl in quantity. The widely used Z-80, developed about 20 years ago, costs about $1, while the high-end processors(860, Pentium Pro)cost around s1000, in low q ramming of uPs Most uP systems are programmed in assembly language. Each of the instructions that the processor can execute given an English-like name (i.e, ADD for the instruction to add two numbers )and translator programs are available from the uP manufacturers to translate the English-like statements(the source code) into the machine codes(which are streams of zeros/ones that the uP interprets). Such assemblers are available from public-acce bulletin boards maintained by several vendors; however, convenient assemblers for specific uP systems are usually bought from third-party vendors. Almost all uP assemblers are meant to be used on personal computers ome are available for minicomputer systems. One should check with the chip manufacturer for current software High-level language compilers are also available for most uPs, typically from third-party vendors. These are sually C-language compilers, but Pascal compilers also may be available. Here again, the best guide is the chip The programming of uP systems usually involves carefully tailored code to control signals that interact with the processor chip. Usually the functions that are required of the processor are time-critical real-time control actions. Programs for such applications can easily become highly intricate and require detailed knowledge of all the functions of the processor chip. For a discussion of these problems, see Chapters 3 and 4 of Peatman [ 1988] Development Support Complex uP/uC systems are designed top-down: the task statements are successively refined to a set of smaller tasks, until they can be implemented in relatively short subroutines. The design approach for micro-based systems is described and illustrated in Peatman [ 1988] The most important support software for a designer is programs for checking the system, both for logical flow and for cycle-by-cycle activity Often subtle errors and data dependencies will occur; finding them may be a daunting task. Simulators are the first-level checkout tools for programs. Simulators do not use the actual hardware; rather they use a software model of it. They calculate and show the contents of all computer registers, of ports and selected memory locations, so that an effective check of the internal operations can be made. Most simulators are from third-party vendors The actual operation of the uP/uC system may be checked with an in-circuit emulator(ICE), an expensive but effective tool that replaces the up or uc pin-for-pin in the actual circuit. The ICE typically powerful computer to mimic the performance of the uP/uC being developed. The ICE tracks signals(including many transients)and can be used to effectively show the behavior of the system, as well as the expected response from the uP and its associated software. e 2000 by CRC Press LLC
© 2000 by CRC Press LLC Hence, the typical software includes an assembler, a loader, and a monitor. More user-oriented software for these tasks is available from third-party vendors; many of these extra-cost software packages are highly cost effective. Interactive assemblers and debugging tools are particularly good investments. Packaging and Cost The simplest processors are housed in normal dual in-line packages (DIP) of 16 pins or more, spaced 0.3 inches wide. Thus, they resemble conventional transistor-transistor logic (TTL) packages. The mid-range ones are usually in large DIP packages, 0.8 inches wide, with 40 to 68 pins (2 to 4 inches long.) The high-performance ones come in multirow pin packages and may require 200 connections and may use unusual chip sockets. The high performance chips may require special cooling. Virtually all processors are multisourced, i.e., they are available from more than one manufacturer. This is an important consideration for continued product support. The processors come in various speed grades; the higher speed ones may be 3 to 5 times as costly as the slow-speed versions. The low-end processors, with no memory and a few communication ports, cost less than $1 in quantity. The widely used Z-80, developed about 20 years ago, costs about $1, while the high-end processors (i860, Pentium Pro) cost around $1000, in low quantities. Programming of mPs Most mP systems are programmed in assembly language. Each of the instructions that the processor can execute is given an English-like name (i.e., ADD for the instruction to add two numbers) and translator programs are available from the mP manufacturers to translate the English-like statements (the source code) into the machine codes (which are streams of zeros/ones that the mP interprets). Such assemblers are available from public-access bulletin boards maintained by several vendors; however, convenient assemblers for specific mP systems are usually bought from third-party vendors. Almost all mP assemblers are meant to be used on personal computers; some are available for minicomputer systems. One should check with the chip manufacturer for current software. High-level language compilers are also available for most mPs, typically from third-party vendors. These are usually C-language compilers, but Pascal compilers also may be available. Here again, the best guide is the chip manufacturer. The programming of mP systems usually involves carefully tailored code to control signals that interact with the processor chip. Usually the functions that are required of the processor are time-critical real-time control actions. Programs for such applications can easily become highly intricate and require detailed knowledge of all the functions of the processor chip. For a discussion of these problems, see Chapters 3 and 4 of Peatman [1988]. Development Support Complex mP/mC systems are designed top-down: the task statements are successively refined to a set of smaller tasks, until they can be implemented in relatively short subroutines. The design approach for micro-based systems is described and illustrated in Peatman [1988]. The most important support software for a designer is programs for checking the system, both for logical flow and for cycle-by-cycle activity. Often subtle errors and data dependencies will occur; finding them may be a daunting task. Simulators are the first-level checkout tools for programs. Simulators do not use the actual hardware; rather they use a software model of it. They calculate and show the contents of all computer registers, of ports and selected memory locations, so that an effective check of the internal operations can be made. Most simulators are from third-party vendors. The actual operation of the mP/mC system may be checked with an in-circuit emulator (ICE), an expensive but effective tool that replaces the mP or mC pin-for-pin in the actual circuit. The ICE typically uses a more powerful computer to mimic the performance of the mP/mC being developed. The ICE tracks signals (including many transients) and can be used to effectively show the behavior of the system, as well as the expected response from the mP and its associated software
Comparison of uP/uC Chips As with all computer devices, the advertised speeds and performance figures must be carefully interpreted. These numbers tend to measure only the performance of the manufacturer's test cases and may not be directly omparable [see Hennessey and Patterson, 1990]. These numbers may not be applicable to any one users requirements. Since the market for uP/uC chips is highly competitive, small differences become amplified dvertising Unfortunately, getting a valid number for comparison purposes requires an extensive effort at benchmarking The advertised performance figures may be taken as a guide, if the task is similar to the benchmark programs. If the processor does not pass the comparison with a comfortable margin, however, one should opt for a higher performance version of the same chip(if much programming already has been done)or select a clearly superior other candidate Trends in uP/uC Developments An entire microprocessor may be used as a building block in an application-specific integrated circuit(ASIC), available from various vendors. ASIC and vlSI design tools may be used to design such systems, tailored to specific user applications. The uP manufacturers are developing uC chips extending the use of their basic processors. For any application, the best procedure is to invite several vendors to propose alternate systems Current chips are merely indications of devices to come High-performance uP systems are becoming more RISC (reduced instruction set computer)oriented. The object is to execute one instruction per clock period (versus the prevailing 3 to 7 cycles)and to obtain a more regular processor structure. The most popular uP/uC systems are CISC processors. For a user it makes little difference what the internal structure of the processor is; the availability of user support software is far more critical. The trend is to make processors simpler, thus speeding up program execution, even if some programs may have to use more program steps in replacing many"convenience"instructions Nevertheless, the very high end uP systems have such a wide data path(32 or 64 bits)that more than one instruction may be accessed at one time. These machines are termed very long instruction word (VLIw) machines. They are able to execute more than one instruction per clock cycle, but they will be more complex internally. For users, both the simpler RISC and the complex VLIW machines will provide increased performance Microelectronics is able to produce 2 million transistor chips. While they are expensive, they will replace virtually all of the peripheral chips: memory, timers, and communication channels can all be controlled from a single chip. However, the humble 8-bit chip is still be the most cost-effective workhorse of the bulk of uc Defining Terms Die: The piece a silicon wafer containing all electronics. Feature size: The characteristic size of electronic components on a die Microcontroller(HC): A microelectronic chip incorporating a uP and memory, communication, as well as other computer support functions. Microprocessor (uP): A microelectronic chip that carries out all operations of a computer central processing unit: instruction fetch, execution, interrupt and management of address, data and control lines which are connected to the chip Peripheral: Device that supports the functions of the processor. The peripheral may be all electronic (a communications adapter)or may contain mechanical parts(a disk memory). To the processor a periph eral appears as electronics with timing constraints Related Topic e 2000 by CRC Press LLC
© 2000 by CRC Press LLC Comparison of mP/mC Chips As with all computer devices, the advertised speeds and performance figures must be carefully interpreted. These numbers tend to measure only the performance of the manufacturer’s test cases and may not be directly comparable [see Hennessey and Patterson, 1990]. These numbers may not be applicable to any one user’s requirements. Since the market for mP/mC chips is highly competitive, small differences become amplified in advertising. Unfortunately, getting a valid number for comparison purposes requires an extensive effort at benchmarking. The advertised performance figures may be taken as a guide, if the task is similar to the benchmark programs. If the processor does not pass the comparison with a comfortable margin, however, one should opt for a higherperformance version of the same chip (if much programming already has been done) or select a clearly superior other candidate. Trends in mP/mC Developments An entire microprocessor may be used as a building block in an application-specific integrated circuit (ASIC), available from various vendors. ASIC and VLSI design tools may be used to design such systems, tailored to specific user applications. The mP manufacturers are developing mC chips extending the use of their basic processors. For any application, the best procedure is to invite several vendors to propose alternate systems. Current chips are merely indications of devices to come. High-performance mP systems are becoming more RISC (reduced instruction set computer) oriented. The object is to execute one instruction per clock period (versus the prevailing 3 to 7 cycles) and to obtain a more regular processor structure. The most popular mP/mC systems are CISC processors. For a user it makes little difference what the internal structure of the processor is; the availability of user support software is far more critical. The trend is to make processors simpler, thus speeding up program execution, even if some programs may have to use more program steps in replacing many “convenience” instructions. Nevertheless, the very high end mP systems have such a wide data path (32 or 64 bits) that more than one instruction may be accessed at one time. These machines are termed very long instruction word (VLIW) machines. They are able to execute more than one instruction per clock cycle, but they will be more complex internally. For users, both the simpler RISC and the complex VLIW machines will provide increased performance. Microelectronics is able to produce 2 million transistor chips. While they are expensive, they will replace virtually all of the peripheral chips: memory, timers, and communication channels can all be controlled from a single chip. However, the humble 8-bit chip is still be the most cost-effective workhorse of the bulk of mC applications. Defining Terms Die: The piece a silicon wafer containing all electronics. Feature size: The characteristic size of electronic components on a die. Microcontroller (mC): A microelectronic chip incorporating a mP and memory, communication, as well as other computer support functions. Microprocessor (mP): A microelectronic chip that carries out all operations of a computer central processing unit: instruction fetch, execution, interrupt and management of address, data and control lines which are connected to the chip. Peripheral: Device that supports the functions of the processor. The peripheral may be all electronic (a communications adapter) or may contain mechanical parts (a disk memory). To the processor a peripheral appears as electronics with timing constraints. Related Topic 82.2 Applications
References A Clements, Microprocessor System Design, Boston: PWS Publishers, 1987 R.S. Gaonkar, Microprocessor Architecture, Programming, and Applications with the 8085/8080A, 2nd ed, Colum bus, Ohio: Merrill Publishing Company, 1984 J.L. Hennessey and D.A. Patterson, Computer Architecture: A Quantitative Approach, Palo Alto, Calif: Morgan Kaufmann Publishers, 1990 M.C. Markowitz, EDN's 24th annual uP/uC chip directory, " EDN Magazine, September 25, 1997 J.R. Mick and J. Brick, Bit-Slice Microprocessor Design, New York: McGraw-Hill, 1980 G J. Myers and D L. Budde, The 80960 Microprocessor Architecture, New York: Wiley Interscience, 1988. J.B. Peatman, Design with Microcontrollers, New York: McGraw-Hill, 1988 M. Rafiquzzaman, Microprocessors and Microcomputer-Based System Design, Boca Raton, Fla. CRC Press, 1990 Further information The magazine EDN runs an annual microprocessor/microcontroller review, typically late in the year (i.e September 25, 1997). These are handy compendia of characteristics The IEEE magazine Micro presents detailed articles on device development and applications of micropro- cessors and systems which embed them. At mid-year the magazine carries a set of articles based on the Hot Chips Symposium, presenting developments in uP and chip technology for high-performance workstations and systems Specifics of various microprocessor and microsystem chips are found in the respective manufacturer's reference literature; for any design one must become familiar with the applicable manual and design notes Even for a modest chip the reference manual may run 300 pages; in addition, the manufacturer's free-of-charge ipport software is of comparable size. For example the Motorola 68HCll reference manual is 512 pages, and there is over 1 megabyte of design support software available from the manufacturer. The Intel i860 data book 150 pages, hardware and programmer reference manuals are over 300 pages, and the support software is several mega 82.2 Applications Phillip windley and James F. frenzel Microprocessors are cheap, small, and consume little power. In addition, in recent years their performance has increased at a greater rate than the performance of larger computers. These factors have led to an explosion the application of microprocessors. A short section could never do justice to every application; therefore, we will view representative applications in three broad areas: Data collection, where microprocessors are used to monitor sensors and either record the collected information or communicate the information to some other computer Control, where microprocessors have largely replaced analog electronics for controlling everything from anufacturing robots to home appliances. Computing, where microprocessors have transformed the concept of computer and made parallel pre Admittedly, these categories are not strictly disjoint. They do, however, represent the most pervasive uses for microprocessors at an abstract level. Data Collection In data collection the microprocessor-based system serves primarily as a low-cost data recorder. Basic functions include the polling of sensors, acceptance of data, data storage, and data transmission or display. Additional features might include preprocessing of the raw data. Such a classification spans a broad range of applications, from automotive diagnostics to space-born monitoring stations e 2000 by CRC Press LLC
© 2000 by CRC Press LLC References A. Clements, Microprocessor System Design, Boston: PWS Publishers, 1987. R.S. Gaonkar, Microprocessor Architecture, Programming, and Applications with the 8085/8080A, 2nd ed., Columbus, Ohio: Merrill Publishing Company, 1984. J.L. Hennessey and D.A. Patterson, Computer Architecture: A Quantitative Approach, Palo Alto, Calif.: Morgan Kaufmann Publishers, 1990. M.C. Markowitz, “EDN’s 24th annual mP/mC chip directory,” EDN Magazine, September 25, 1997. J.R. Mick and J. Brick, Bit-Slice Microprocessor Design, New York: McGraw-Hill, 1980. G.J. Myers and D.L. Budde, The 80960 Microprocessor Architecture, New York: Wiley Interscience, 1988. J.B. Peatman, Design with Microcontrollers, New York: McGraw-Hill, 1988. M. Rafiquzzaman, Microprocessors and Microcomputer-Based System Design, Boca Raton, Fla.: CRC Press, 1990. Further Information The magazine EDN runs an annual microprocessor/microcontroller review, typically late in the year (i.e., September 25, 1997). These are handy compendia of characteristics. The IEEE magazine Micro presents detailed articles on device development and applications of microprocessors and systems which embed them. At mid-year the magazine carries a set of articles based on the Hot Chips Symposium, presenting developments in mP and chip technology for high-performance workstations and systems. Specifics of various microprocessor and microsystem chips are found in the respective manufacturer’s reference literature; for any design one must become familiar with the applicable manual and design notes. Even for a modest chip the reference manual may run 300 pages; in addition, the manufacturer’s free-of-charge support software is of comparable size. For example the Motorola 68HC11 reference manual is 512 pages, and there is over 1 megabyte of design support software available from the manufacturer. The Intel i860 data book is 150 pages, hardware and programmer reference manuals are over 300 pages, and the support software is several megabytes. 82.2 Applications Phillip J. Windley and James F. Frenzel Microprocessors are cheap, small, and consume little power. In addition, in recent years their performance has increased at a greater rate than the performance of larger computers. These factors have led to an explosion in the application of microprocessors. A short section could never do justice to every application; therefore, we will view representative applications in three broad areas: • Data collection, where microprocessors are used to monitor sensors and either record the collected information or communicate the information to some other computer. • Control, where microprocessors have largely replaced analog electronics for controlling everything from manufacturing robots to home appliances. • Computing, where microprocessors have transformed the concept of computer and made parallel processing possible. Admittedly, these categories are not strictly disjoint. They do, however, represent the most pervasive uses for microprocessors at an abstract level. Data Collection In data collection the microprocessor-based system serves primarily as a low-cost data recorder. Basic functions include the polling of sensors, acceptance of data, data storage, and data transmission or display. Additional features might include preprocessing of the raw data. Such a classification spans a broad range of applications, from automotive diagnostics to space-born monitoring stations
CENTRAL PROCESSOR ROM DATA BUS SCANNER KEYPAD DISPLA MAGNETIC STORAGE FIGURE 82.1 Point-of-sale terminal system o. Microprocessors are well suited as the controller for such tasks because of their cost and flexibility. Sufficient bers of processors may be used to allow real-time data acquisition. Because the microprocessor is pre grammable, sensors may be added, removed, or rearranged without major system impact. Finally, because the microprocessor is a computational device, calculations may be performed on the recorded data to produce useful information, such as calculating speed from distance and time. In the next section we will examine the components of one such system, the retail point-of-sale terminal Hordeski, 1984] Point-of-Sale terminal The function of a point-of-sale(POS) terminal is characteristic of the applications under the category of data collection. The microprocessor is not being used for intensive computations, nor for controlling a complex process, but rather to collect data, perform some processing, and then pass the results on to a central collector The cost and flexibility of the microprocessor make it an excellent choice over special-purpose hardware. System Components. In addition to the microprocessor and storage capability, the typical retail terminal has one or more input devices for entering prices(e.g, keyboard, bar code scanner)and one or more output devices for displaying totals(e.g, paper tape, display). Often these terminals are part of a large network of terminals and may support additional features beyond totaling purchases such as automated inventory control and credit checking. A complete system is shown in Fig. 82.1, including magnetic tape for storing transactions and a universal asynchronous receiver/transmitter(UART) for communication with a central processing facility Because of the high unit volume, it is desirable to keep the cost and complexity low. Typically, each terminal will have limited storage capability, relying on a central processor for maintaining store inventory and credit checks. In order to reduce communication traffic with the central processor, however, each terminal generally has in storage the current price for all items Universal Product Code. The use of the Universal Product Code(UPC) has enabled the development of intelligent POS terminals which can"read"the UPC symbol and determine the identity of the item. The UPC symbol consists of ten decimal digits, split into two fields of five digits each. Each digit is encoded using a 7-bit binary number, represented by a group of 7 dark(binary 1)and light(binary 0)bars. The five left-hand digits re encoded using odd parity and the right-hand digits are encoded using even parity. This allows correct recognition of the symbol, independent of its orientation. for groceries, the first five decimal digits identify the manufacturer and the second group of five digits entify the specific product. There are additional codes in use as well, such as the National Drug Code. By sing a microprocessor-based system, a POS terminal can be quickly reconfigured to recognize a different code Operation. A typical sale might involve the following steps. The clerk inquires whether the sale is to be a cash purchase or charged to an account. If the latter, the clerk enters the necessary information and the terminal e 2000 by CRC Press LLC
© 2000 by CRC Press LLC Microprocessors are well suited as the controller for such tasks because of their cost and flexibility. Sufficient numbers of processors may be used to allow real-time data acquisition. Because the microprocessor is programmable, sensors may be added, removed, or rearranged without major system impact. Finally, because the microprocessor is a computational device, calculations may be performed on the recorded data to produce useful information, such as calculating speed from distance and time. In the next section we will examine the components of one such system, the retail point-of-sale terminal [Hordeski, 1984]. Point-of-Sale Terminal The function of a point-of-sale (POS) terminal is characteristic of the applications under the category of data collection. The microprocessor is not being used for intensive computations, nor for controlling a complex process, but rather to collect data, perform some processing, and then pass the results on to a central collector. The cost and flexibility of the microprocessor make it an excellent choice over special-purpose hardware. System Components. In addition to the microprocessor and storage capability, the typical retail terminal has one or more input devices for entering prices (e.g., keyboard, bar code scanner) and one or more output devices for displaying totals (e.g., paper tape, display). Often these terminals are part of a large network of terminals and may support additional features beyond totaling purchases such as automated inventory control and credit checking. A complete system is shown in Fig. 82.1, including magnetic tape for storing transactions and a universal asynchronous receiver/transmitter (UART) for communication with a central processing facility. Because of the high unit volume, it is desirable to keep the cost and complexity low. Typically, each terminal will have limited storage capability, relying on a central processor for maintaining store inventory and credit checks. In order to reduce communication traffic with the central processor, however, each terminal generally has in storage the current price for all items. Universal Product Code. The use of the Universal Product Code (UPC) has enabled the development of intelligent POS terminals which can “read’’ the UPC symbol and determine the identity of the item. The UPC symbol consists of ten decimal digits, split into two fields of five digits each. Each digit is encoded using a 7-bit binary number, represented by a group of 7 dark (binary 1) and light (binary 0) bars. The five left-hand digits are encoded using odd parity and the right-hand digits are encoded using even parity. This allows correct recognition of the symbol, independent of its orientation. For groceries, the first five decimal digits identify the manufacturer and the second group of five digits identify the specific product. There are additional codes in use as well, such as the National Drug Code. By using a microprocessor-based system, a POS terminal can be quickly reconfigured to recognize a different code (or multiple codes) through a simple software change. Operation. A typical sale might involve the following steps. The clerk inquires whether the sale is to be a cash purchase or charged to an account. If the latter, the clerk enters the necessary information and the terminal FIGURE 82.1 Point-of-sale terminal system
Shaft Encoder Controller Converter 「「 Rer cik FIGURE 82.2 Digital tachometer transmits a request to a central processor, inquiring as to the available credit. In the interim, items are entered, either through the bar code scanner or the keypad, and the price and running total are displayed. The identity of the items purchased is also stored for later transmission to the central processor responsible for inventory control. Finally, the terminal checks the available credit against the total and records the transaction for later transmission to the central processor Digital Tachometer Another example of using a microprocessor for data collection is the implementation of a digital tachometer icroprocessor samples the output of a shaft encoder and compares it with a refere ignal to determine the rotational speed. The calculated value is passed to a digital-to-analog converter to in Fig. 82 Speed Evaluation Methods. Various methods may be used to evaluate the speed value, all of which involve some combination of pulse counting and time measurement. The constant elapsed time(CET)method provides a good compromise between measurement accuracy and response time. The CET method records the number of encoder pulses observed during a fixed time interval. The rotational speed, n, is then given by n=C/(C, m/T) where Cp is the number of encoder pulses, C, is the number of clock pulses, m is the number of encoder marks per turn, and T is the clock pulse period Implementation. Rather than continuously stopping and resetting external counters, it is possible to take advantage of features often found in modern microcontrollers, microprocessors containing additional interface circuitry. Microcontrollers often contain counters, timers, and capture registers Capture registers allow the toring of timer or counter values triggered by an external signal. At the start of evaluation, the rising edge of the next encoder pulse triggers the capture of the timer count and the pulse count. After a minimum evaluation time has elapsed, the next encoder pulse again triggers the capture of the current counter values. The rotational speed can then be computed using the difference between the captured values. a flowchart of the algorithm is Performance. Using an encoder with 1024 marks per revolution, a 2-MHz reference clock, and an evaluation period of 2.3 ms resulted in a measurable speed range of 25.5-4883 rpm. The maximum relative error was 0. 123%, induced primarily by the encoder tolerance [Bonert, 1989] Contro Microprocessors are ubiquitous in control applications. While some custom analog controllers are still built he advantages of cost and flexibility inherent in microprocessors make them a natural choice. The advantages of microprocessors are particularly obvious in mass-produced goods where time-to-market can be a sigi driving force e 2000 by CRC Press LLC
© 2000 by CRC Press LLC transmits a request to a central processor, inquiring as to the available credit. In the interim, items are entered, either through the bar code scanner or the keypad, and the price and running total are displayed. The identity of the items purchased is also stored for later transmission to the central processor responsible for inventory control. Finally, the terminal checks the available credit against the total and records the transaction for later transmission to the central processor. Digital Tachometer Another example of using a microprocessor for data collection is the implementation of a digital tachometer [Bonert, 1989]. The microprocessor samples the output of a shaft encoder and compares it with a reference signal to determine the rotational speed. The calculated value is passed to a digital-to-analog converter to generate an analog speed signal. The system is shown in Fig. 82.2. Speed Evaluation Methods. Various methods may be used to evaluate the speed value, all of which involve some combination of pulse counting and time measurement. The constant elapsed time (CET) method provides a good compromise between measurement accuracy and response time. The CET method records the number of encoder pulses observed during a fixed time interval. The rotational speed, n, is then given by n = Cp /(Ctm/Tc) where Cp is the number of encoder pulses, Ct is the number of clock pulses, m is the number of encoder marks per turn, and Tc is the clock pulse period. Implementation. Rather than continuously stopping and resetting external counters, it is possible to take advantage of features often found in modern microcontrollers, microprocessors containing additional interface circuitry. Microcontrollers often contain counters, timers, and capture registers. Capture registers allow the storing of timer or counter values triggered by an external signal. At the start of evaluation, the rising edge of the next encoder pulse triggers the capture of the timer count and the pulse count. After a minimum evaluation time has elapsed, the next encoder pulse again triggers the capture of the current counter values. The rotational speed can then be computed using the difference between the captured values. A flowchart of the algorithm is shown in Fig. 82.3. Performance. Using an encoder with 1024 marks per revolution, a 2-MHz reference clock, and an evaluation period of 2.3 ms resulted in a measurable speed range of 25.5–4883 rpm. The maximum relative error was 0.123%, induced primarily by the encoder tolerance [Bonert, 1989]. Control Microprocessors are ubiquitous in control applications. While some custom analog controllers are still built, the advantages of cost and flexibility inherent in microprocessors make them a natural choice. The advantages of microprocessors are particularly obvious in mass-produced goods where time-to-market can be a significant driving force. FIGURE 82.2 Digital tachometer
Set INIT Flag Set WAIT Flag Y Flag set? T andT Flag Set? Speed =0 valutate Loop ear INIT Flag T Elapsed? T Expired eturn Set Timer Clear WAIT Flag from Interrupt and Interrup Wait Lot FIGURE 82.3 Tachometer program. (Source: Bonert, 1989.) Microcontrollers Microprocessors designed especially for use in control applications are called microcontrollers. Typically, the major difference between a microcontroller and a standard microprocessor is the presence of scratchpad RAM, input and output ports, timers, and even analog-to-digital (A/D)and digital-to-analog(D/A)converters on-chip Figure 82.4 shows a simplified microcontroller architecture. The process to be controlled is monitored by means of sensors. The outputs from the sensors are fed to A/d converters which convert the analog signals from the sensors to digital signals appropriate for use in the microprocessor. The microprocessor reads the digital signal from the A/D converter and uses it for input to a control program stored in the microprocessor memory. The program produces digital outputs which are fed to D/A converters. The analog outputs from the D/A converters(which are typically low power)are fed to amplifiers, and the amplified signal is used to control actuators that affect the process being controlled. Control Applications Consumer Electronics. A survey of the typical home will show numerous microprocessors where 10 years ago, there were none Microprocessors are used for controlling VCRs, TVs, stereo equipment, microwave ovens, sprinkler systems, telephone equipment, heating systems, and virtually every other appliance using electricity. ufacturing. Microprocessors have found numerous applications in manufacturing. Perhaps none is better n than the robot Microprocessor technology has made the modern robot possible Robot arms used in e 2000 by CRC Press LLC
© 2000 by CRC Press LLC Microcontrollers Microprocessors designed especially for use in control applications are called microcontrollers. Typically, the major difference between a microcontroller and a standard microprocessor is the presence of scratchpad RAM, input and output ports, timers, and even analog-to-digital (A/D) and digital-to-analog (D/A) converters on-chip. Figure 82.4 shows a simplified microcontroller architecture. The process to be controlled is monitored by means of sensors. The outputs from the sensors are fed to A/D converters which convert the analog signals from the sensors to digital signals appropriate for use in the microprocessor. The microprocessor reads the digital signal from the A/D converter and uses it for input to a control program stored in the microprocessor memory. The program produces digital outputs which are fed to D/A converters. The analog outputs from the D/A converters (which are typically low power) are fed to amplifiers, and the amplified signal is used to control actuators that affect the process being controlled. Control Applications Consumer Electronics. A survey of the typical home will show numerous microprocessors where 10 years ago, there were none. Microprocessors are used for controlling VCRs, TVs, stereo equipment, microwave ovens, sprinkler systems, telephone equipment, heating systems, and virtually every other appliance using electricity. Manufacturing. Microprocessors have found numerous applications in manufacturing. Perhaps none is better known than the robot. Microprocessor technology has made the modern robot possible. Robot arms used in FIGURE 82.3 Tachometer program. (Source: Bonert, 1989.)