A Control System Using Parallel Interface.: Microprocessor Controller
A Control System Using Parallel Interface.: Microprocessor Controller
Figure 2.9
A control system Microprocessor
using parallel controller
Analog
interface. drive
DAC Motor Motor Load
Output port control
Adr = 00
Direction
Alarm
Input port
Adr = 02 ADC Sensor
Limit switches
Input port
Adr = 03 Start
Go-to position
40 CHAPTER 2
switches. The limit switches are used as a “back up” to detect it if the load has gone out
of its designated range.
Operation of the system proceeds as follows: The controller inputs the data from
port 03 to determine if the start (or stop) button has been pressed. If the start button has
been pressed, then the set point is read in from port 01 and the digitized sensor data is
read in from port 02. Based on its control strategy, the controller outputs to port 00 a
binary word representing the motor-control voltage. This digital data is converted to an
analog voltage with the DAC. This entire sequence is repeated over and over until the
stop button is pushed.
Figure 2.10
Components in a Microprocessor
serial interface controller
circuit. Parallel-to- Serial data Serial-to-
serial parallel Parallel
Parallel data
converter converter data
(UART) Return (UART)
INTRODUCTION TO MICROPROCESSOR-BASED CONTROL 41
Figure 2.11
r it SB
)
t1 B
t(s
Bi LS
t0 t
Pa M
Bi t bi
Serial data format
bi
y
op
t2
t3
t4
t5
t6
t7
ar
for the binary word
St
St
Bi
Bi
Bi
Bi
Bi
Bi
10110010 (with
even parity). 1
0
Time
Figure 2.11 shows the standard format for asynchronous serial data. First, a start
bit is sent, then the data (LSB first), then a parity-error checking bit, and finally the stop
bit(s). Some variation is allowed to this format, but both transmitter and receiver must
use the same format. The other important parameter in serial transmission is the num-
ber of bits sent per second (frequently called the baud rate, although the term is tech-
nically incorrect in most cases). Standard bit rates are 300 bps (bits per second), 1200
bps, 2400 bps, 9600 bps, 14,400 bps 28,800 bps, 33,600 bps, and 57,600 bps. Serial
data transmission is much slower than parallel transmission. At 300 bps, it takes almost
37 ms to transmit 1 byte of data, compared to less than a microsecond for parallel—
this is thousands of times slower. Still, for many applications, particularly process con-
trol, the longer data-transfer times are not a problem.
RS 232
In order to make the serial interface practical, a set of specifications called the RS-232
standard was established. Officially, the RS-232 standard specifies the serial data inter-
face between data terminal equipment (DTE) and data communication equipment
(DCE). A common application of RS-232 is the interface between a PC and the
modem, in which case the computer is the DTE and the modem is the DCE [see Figure
2.12(a)] A modem is a device that converts digital data into audio tones so that it can
be transmitted over the telephone lines. As shown in Figure 2.12, the RS-232 interface
consists of seven signals; the serial data is sent on pin 2 and received on pin 3; the other
signals, such as “Request to send” and Clear to send,” are used to confirm that the two
units are ready to communicate. The RS-232 standard specifies connector types, signal
names, pin numbers, and voltages. In practice, the RS-232 standard can be applied to
any serial interface as long as one unit acts as a DTE and the other as a DCE. If two
DTE units need to interface with each other—for example, a PC to a PC—a special
cable called a null modem or crossover cable is used. RS-232 is commonly used in
the control field when two units need to exchange data—for example, to connect a PC
to a local control unit for the purpose of downloading a new control program, as illus-
trated in Figure 2.12(b).
RS-232 serial data transfer is somewhat more complicated than parallel data trans-
fer, but it offers advantages such as two-wire communications and a universally
accepted interface. The hardware to handle serial data is standardized, readily available,
and reliable.
42 CHAPTER 2
(a) Interface between data terminal equipment (DTE) and data communication
equipment (DCE). Serial data are transferred on pins 2 and 3; the other signals control
the flow of data.
RS 232 Cable
T
OU
IN
trol
Con it
PC Un
Networking
Probably the most common use of serial data is in networking. More and more, net-
works are being used to interconnect all the units and devices in the control system.
Network cabling differs depending on the type of local area network (LAN), but
most use the generalized bus system diagrammed in Figure 2.13. Typically, each unit
on the net has a unique address number and also address detection circuitry. When
one unit wants to talk to another unit, it first broadcasts the address of the unit its
wants to talk to (serially, of course, on the signal wire) and then sends the data (seri-