Block Diagrams of Microcontrollers.: PD0-PD5 (Serial Port) PE0-PE7 (Eight ADC Inputs) PC0-PC7 PB0-PB7 PA3-PA6 PA0-PA2 PA7
Block Diagrams of Microcontrollers.: PD0-PD5 (Serial Port) PE0-PE7 (Eight ADC Inputs) PC0-PC7 PB0-PB7 PA3-PA6 PA0-PA2 PA7
ROM RAM
4Kbytes 128bytes
CPU
Timers Serial
port
RAM
128bytes
microcontroller is the Intel 8051, which has 128 bytes of RAM and 4K bytes of ROM,
four parallel data ports, and a serial port (see Figure 2.15b). For control applications,
these hardware arrangements usually are adequate: ROM is used to store the control
program, and RAM is used as data registers and a “scratch pad.” The I/O signal lines
can usually be connected directly to the microcontroller without additional port cir-
cuitry. Software is typically written in C++ or some other language (including assem-
bly language) and then converted into machine language with a compiler or assembler
program. The machine language program would then be loaded into the microcon-
troller’s ROM or EPROM.
Another popular microcontroller is the PIC from Microchip Technology. For exam-
ple, the PIC16Cxx family of 8-bit microcontrollers is a low-cost, versitle product that
has found wide acceptance [see Figure 2.15(c)]. There are a wide range of options,
including ROM, EPROM, EEPROM, ADCs, Timers, and serial ports. The PIC uses a
slightly different architecture from the 68HC11 and 8051 in that the ROM (or EPROM)
that contains the program connects to the CPU with its own 14-bit bus, whereas the reg-
ular data bus is 8 bits. Allowing 14 bits for the program memory means that all instruc-
tions are just one word long. The device has three I/O ports, but many of the I/O bits
can be used in different ways (such as for an on/off switch or ADC input), depending
on how they are programmed.
Finally, another product called the BASIC Stamp from Parallax Inc. is usually con-
sidered a microcontroller, although it is actually a very small circuit board with a few
ICs and pins. The whole circuit board plugs into an IC socket, as though it were an IC
(see Figure 2.16 ). What makes the BASIC Stamp somewhat unique is that it has an on-
board BASIC program interperater. A program can be written in BASIC on a PC and
then directly downloaded into the Stamp’s EEPROM through a RS-232 port. No assem-
bler or compiling operation is required. There are now other microcontrollers on the
market that can be programmed in BASIC.
In summary, a wide variety of microcontrollers are available. At the low end are
the 4-bit models, which are more than adequate for appliances and toys. These tend to
be large-volume, low-cost applications. Eight-bit microcontrollers (such as the 68HC11
and 8051 mentioned earlier) are very popular because 8 bits turn out to be a conven-
ient size for both numeric and character data. At the high end, 16- and 32-bit micro-
controllers are available for control systems requiring sophisticated, high-speed
Figure 2.16
BASIC Stamp
module (BS2-IC).
48 CHAPTER 2
Single-Board Computers
Single-board computers are off-the-shelf microprocessor-based computers built on a
single printed-circuit card (Figure 2.17). They come in many configurations, but in gen-
eral they use a standard microprocessor such as the Zilog Z80, the Intel x86 family, the
Motorola 68000, or a microcontroller. They also include memory ICs (both RAM and
ROM), I/O capability, and perhaps special interface circuits such as ADCs or DACs.
Single-board computers are manufactured by major microprocessor producers such as
Intel and Motorola as well as many other smaller companies. Some single board com-
puters are designed to plug into a PC as an expansion card. The obvious advantage of
using a ready-made microprocessor board is that it eliminates design- and board-testing
time. This is particularly important in small-volume production or one-of-kind systems.
Figure 2.17
A single-board
computer.
(Courtesy of
Vesta
Technology, Inc.)
INTRODUCTION TO MICROPROCESSOR-BASED CONTROL 49
interface directly to such system components as switches, relays, small motors, and
lights. Developed in the late 1960s to replace relay logic controllers, PLCs have
evolved to be able to handle sophisticated motion control applications. PLCs come in
various sizes and capabilities; Figure 2.18 shows a selection of PLCs. The big differ-
ence between PLCs and the other devices discussed in this section is that the PLC has
the microprocessor, ports, and power supply built into a package that has been ruggedi-
zed for an industrial environment. Installation is very easy because in many cases the
sensors and actuators can be connected directly to the PLC. Once installed, the micro-
processor program is downloaded into the PLC from some source such as a personal
computer. The PLC manufacturer usually supplies software to facilitate the program-
ming operation. This software allows the user to write a program with line-by-line
instructions, or it can convert a relay logic-wiring diagram (ladder diagram) directly
Figure 2.18
Programmable
logic controllers.
(Allen-Bradley
products courtesy
of Rockwell
Automation).