Microprocessors and Microcontrollers

Microprocessors and Microcontrollers

Readers who have no prior concepts of computer operation should read Chapter 4 now.

Microprocessors and microcontrollers stem from the same basic idea, are made by the same people, and are sold to the same types of system designers and programmers. What is the difference between the two?

Microprocessors

A microprocessor, as the term has come to be known, is a general-purpose digital computer central processing unit (CPU). Although popularly known as a "computer on a chip," the microprocessor is in no sense a complete digital computer.

Figure .1 shows a block diagram of a microprocessor CPU, which contains an arithmetic and logic unit (ALU), a program counter (PC), a stack pointer (SP), some working registers, a clock timing circuit, and interrupt circuits.

To make a complete microcomputer, one must add memory, usually read­ only program memory (ROM] and random-access data memory (RAM], mem­ory decoders, an oscillator, and a number of input/output (I/O) devices, such as parallel and serial data ports. In addition, special-purpose devices, such as in­terrupt handlers and counters, may be added to relieve the CPU from time-consuming counting or timing chores. Equipping the microcomputer with mass storage devices, commonly a floppy and hard disk drives, and I/O periph­erals, such as a keyboard and a CRT display, yields a small computer that can be applied to a range of general-purpose software applications.

The key term in describing the design of the microprocessor is generalpurpose. The hardware design of a microprocessor CPU is arranged so that a small or very large system can be configured around the CPU as the application demands. The internal CPU architecture, as well as the resultant machine-level code that operates that architecture, is comprehensive but as flexible as possible.

The prime use of a microprocessor is to read data, perform extensive calculations on that data, and store those calculations in a mass storage device or display the results for human use. The programs used by the microprocessor. are stored in the mass storage device and loaded into RAM as the user directs. A few microprocessor programs are stored in ROM. The ROM-based programs are primarily small fixed programs that operate peripherals and other fixed de­vices that are connected to the system. The design of the microprocessor is driven by the desire to make it as expandable and flexible as possible, in the expectation of commercial success in the marketplace.

microprocessors

Microcontrollers

Figure.2 shows the block diagram of a typical microcontroller, which is a true computer on a chip. The design incorporates all of the features found in a micro-processor CPU: ALU, PC, SP, and registers. It also has added the other features needed to make a complete computer: ROM, RAM, parallel I/O, serial I/O, counters, and a clock circuit.

Like the microprocessor, a microcontroller is a general-purpose device, but one that is meant to read data, perform limited calculations on that data, and control its environment based on those calculations. The prime use of a micro­controller is to control the operation of a machine using a fixed program that is stored in ROM and that does not change over the lifetime of the system.

The design approach of the microcontroller mirrors that of the micro­processor: make a single design that can he used in as many applications as pos­sible in order to sell, hopefully, as many as possible. The microprocessor de­sign accomplishes this goal by having a very flexible and extensive repertoire of multi-byte instructions. These instructions work in a hardware configura­tion that enables large amounts of memory and I/O to be connected to address and data bus pins on the integrated circuit package. Much of the activity in the microprocessor has to do with moving code and data to and from external memory to the CPU. The architecture features working registers that can be programmed to take part in the memory access process, and the instruction set is aimed at expediting this activity in order to improve throughput. The pins that connect the microprocessor to external memory are unique, each having a single function. Data is handled in byte, or larger, sizes.

microprocessors3_03

microprocessors4_03

The microcontroller design uses a much more limited set of single- and double-byte instructions that are used to move code and data from internal memory to the ALU. Many instructions are coupled with pins on the integrated circuit package,- the pins are "programmable"—that is, capable of having sev­eral different functions depending on the wishes of the programmer.

The microcontroller is concerned with getting data from and to its own pins; the architecture and instruction set are optimized to handle data in bit and byte size.

Figure .3 is a photograph of several members of the 8051 family.Comparing Microprocessors and Microcontrollers

The contrast between a microcontroller and a microprocessor is best exemplified by the fact that most microprocessors have many operational codes (opcodes) for moving data from external memory to the CPU; microcontrollers may have one or two. Microprocessors may have one or two types of bit-handling instructions; microcontrollers will have many.

To summarize, the microprocessor is concerned with rapid movement of code and data from external addresses to the chip; the microcontroller is concerned with rapid movement of hits within the chip. The microcontroller can function as a computer with the addition of no external digital parts; the micro­processor must have many additional parts to be operational .

Labels: