Sie sind auf Seite 1von 5

630

Introduction to Instrumentation and Measurement

9.9 Serial Data Communications Links


While the GPIB is eminently suited for managing a large measurement system, there is often need to couple the output of a single instrument to a computer interface over long distances, using few electrical conductors. Serial data transmission has well-established protocols, and predates the GPIB by at least ten years. The RS-232 serial interface was originally developed in the early 1960s to send data to a CRT terminal or teletypewriter over telephone wires. Its low maximum bit transfer rates now makes the RS-232 serial interface generally obsolete for the control of the modern equivalents of terminals, printers and instruments. The RS-232 interface currently finds use in coupling mice, trackballs, joysticks and other slow input devices to computers, as well as computers to certain plotters and non-graphics printers. Hardly any measurement instruments are designed to use the RS-232 interface, since it lacks the speed and flexibility of the IEEE488.2 bus. However, for specific applications, such as reading in the data from remote dc sensors and sending data to loggers, it can be useful. Other, more modern, serial, asynchronous data transmission protocols include the RS422, RS-423, RS-449, RS-485 and USB. We will first describe the RS-232 serial interface, as it is the oldest serial bus. It has been widely used and its protocol is utilized with little variation in the later serial bus designs. RS stands for Recommended Standard (of the Electronic Industries Association, Washington, DC). 9.9.1 The RS-232C and D Interfaces

In describing the RS-232C interface, we encounter some new acronyms. RS-232C serial communications are sent by Data Terminal Equipment (DTE) and Data Communications Equipment (DCE). DTE include computer terminals, teleprinters, computers and digital instruments. DCE are devices (modems) that encode the serial digital signals into low bandwidth (sinusoidal) formats, compatible with transmission on voice band telephone lines. The rate that modems transmit data is given in baud, which stands for bit rate audio. (Modern modems used for serial telephone line communications between PCs and instruments typically run between 2,400 baud and 56,000 baud, depending on the

Digital Interfaces in Measurement Systems

631

FIGURE 9.29 Standard pin connections for the RS-232C serial data interface. Pin nomenclature based on the connections in DTE equipment. (Source: Wolf, 1983)

limiting bandwidth of the transmission system. FAX modems typically run at 24,400 baud.) Just as the GPIB has a unique, standard connector, the RS-232C interface uses a standard male or female 25-pin, DB25P (male) or DB25S (female) connector, shown in Figure 9.29. The RS-232C interface operates either in the simplex, half-duplex, or full-duplex mode. In the simplex mode, data transmission is unidirectional (e.g. from the computer to a printer). In the half-duplex mode, serial data can be sent in both directions, but in only one direction at a time. Full-duplex operation permits simultaneous, bidirectional, serial data transmission. Data is transmitted as 8-bit ASCII words, signalled by high or low logic voltages on the transmitted data (TD) line. An example of this process is shown in Figure 9.30. In the idle state, the TD line is held high. At the beginning of data word transmission, the TD line goes low and stays low for one clock period. This is the start bit, which is always low. The receiving equipment senses the high-low transition of the start bit, and in order to verify start, samples the received data (RD) one-half clock period later. If low, the start bit is verified. The state of the received data line is then sampled eight times at intervals of one clock period. The last (eighth) sample is the MSB and is called the parity bit. In setting up an RS-232D interface, the user can specify the use of odd, even, or no parity in the data transmission process. If even parity is used, the parity (8th) bit is set so that the total number of logical 1s in the transmitted word, including the parity bit, is even. If the parity check algorithm in the receiver counts an odd number of highs in a received word, it

632
(Always 0) Mark 1 Idle state Space 0 Start bit 0 1 0

Introduction to Instrumentation and Measurement


(Always 1, 1) 1 0 1 0 Idle Stop bits state Data bits (5 to 8 data bits) Parity bit

FIGURE 9.30 Example of an 8-bit, serial data signal sent on pin 2 of an RS-232C DTE.

declares a parity error. The parity error can terminate transmission, or require that the same character be sent again. Similarly, if an even number of 1s is counted in a received word when using odd parity, then an error is declared. Parity is generally used when serial data is transmitted under noisy conditions over long distances. It is normally not used in situations where the receiver is connected to the transmitter by a short cable in a low noise environment. At the end of data transmission, after the parity bit is sent, one or two high stop bits are sent before the TD line is declared idle and is ready to transmit the next word (ASCII character). Note that there are a number of handshaking functions on the RS-232C lines which accompany the serial data transmission and receiving lines. These includering indicator, data terminal ready, carrier detect, signal ground, data set ready, clr to send, request to send and others. For detailed descriptions of the operation of the RS-232C interface, the reader can consult Section 5.2 in Stone (1982), Chapter 18 in Wolf (1983), Chapter 6 in Tompkins and Webster (1988), or Motorola Application Note AN-781A. In the earliest days of RS-232 use, it was common for computers to be connected to teletypewriters such as the Western Electric ASR33. The ASR33 used no IC electronic components. All logical and switching operations were done electromechanically at very low baud rates. Modern serial data communications use UART (universal asynchronous receiver/transmitter) IC chip sets which handle the parallel to serial conversion of data for transmission and at the receiver, convert the RD to parallel form. The latest RS-232 embodiment uses the D designator. It is essentially the same as the RS-232C in its specifications and protocols. However, it uses an 8-pin, telephone type connector, the RJ-45 (similar to those used in 10-BaseT Ethernet lines). The RJ-45 pin signal descriptions and their acronyms are: 1. DCE Ready/Ring Indicator (DSR/RI) 2. Received Line Signal Detector (DCD) 3. DTE Ready (DTR) 4. Signal Ground (SG) 5. Received Data (R D) 6. Transmitted Data (T D) 7. Clear to Send (CTS) 8. Request to Send (RTS) Like the RS-232C, The D is used for low speed, asynchronous communication between a computer and a single, slow, peripheral device. The present state-of-the-art for the RS-232C & D protocol limits data transmission rates to less than 20 kbaud, and wire cables are seldom effective over 15 m (50 ft) in length.

Digital Interfaces in Measurement Systems

633

Also, RS-232 protocol restricts the dV/dt of the T D line data to a maximum of 30 V/ms. To circumvent these problems, other serial data transmission standards were developed, making use of improvements in hardware to achieve higher baud rates and longer transmission lines. These interfaces are described in the next section. 9.9.2 The RS-422, RS-423 and RS-485 Interfaces

These interfaces make use of our knowledge about the transmission properties of transmission lines for transient signals and improved IC designs to realize improved data transmission rates over longer distances than possible with the 40 year old technology of the RS-232 interface. Their properties are summarized in the following paragraphs, and are illustrated in Figure 9.31. The RS-422A Interface uses a balanced, twisted pair transmission line, terminated in the characteristic impedance of the line. A balanced, or differential, amplifier line driver, as well as a differential line receiver, is used. The RS-422A interface can transmit data at up to 10 Mbaud, and can have lengths of up to 1200 m. There is a trade-off between baud rate and cable length10 M baud is possible on a 12 m cable, 1 Mbaud on a 100 m cable, 100 kbaud on a 1 km cable and up to 80 kbaud on a 1.2 km cable. The TI 9636 and 9637 ICs, as well as the Motorola MC3487 differential receiver and the MC3486 differential driver can be used to realize an RS-422A link.
Q DT Zo __ Q L1 L2 DR

OUT

S1 S2

OUT1 OUT2

Sk

Lk CG

OUTk

T/R T Q __ Q T/R Q __ Q R T R __ Q T T/R

FIGURE 9.31 A. RS-422A, balanced, twisted pair transmission line. Note: DT differential transmitter, DR differential receiver, Zo characteristic impedance of the line B. RS-423A, unbalanced serial data transmission lines. Note: CG common ground C. RS-485, balanced, bidirectional, twisted pair serial data transmission system. Differential, tristate, transceivers are used.

634
TABLE 9.4 Specifications of RS serial data lines
Specifications Mode of operation Allowed Number of Tx and Rx Maximum data rate, bps Normal driver output voltage Maximum driver output Tx Load impedance,
Rx input sensitivity Rx input voltage range Maximun Rx input resistance,
Maximum cable length, feet RS-232C&D Single ended 1 Tx, 1 Rx 20 k 5 to 15 V 25 V 37 k 3 V 15 V 37 k 50

Introduction to Instrumentation and Measurement

RS-423 Single ended 1 Tx, 10 Rx 100 k/10 M 3.6 V 6 V 450 200 mV 12 V 54 k 4000

RS-422 Differential (twisted pair) 1 Tx, 10 Rx 100 k/10 M 2 V 6 V 100 200 mV 7 V 54 k 4000

RS485 Differential (twisted pair) 32 Tx, 32 Rx 100 k/10 M 1.5 V 6 V 54 200 mV 7 to 12 V 12 k 4000

The mechanical connections for the RS-422A interface are specified by the RS-449 standard, which specifies a 37-pin connector supporting the mandatory twisted pair lines for receive ready, test mode, data mode, request to send, clear to send, receive data and send data [Stone, 1982]. The RS-423A Interface uses an unbalanced single line, similar to the RS-232D link. Even so, the RS-423A link is faster than the RS-232C. According to Stone (1982), it was designed to provide a linkage between the old RS-232C and the RS-422A interfaces. Its operational protocol is very similar to RS-232, although improvements in the driver and receiver electronics allow it to operate at rates up to 100 kbaud over short cables (530 m) and at significantly slower rates over cables up to 1.2 km. The RS-485 Interface is a balanced (twisted pair), party line, on which a number of secondary receivers and transmitters can operate. In this respect, it is effectively a data bus. Although the RS-485 interface can transmit data up to 10 Mbaud, considerations of line resistance, loading and terminations set practical limits on line lengths. The SN75172 and SN75174 differential drivers, and the SN74173 and SN75175 differential receivers are used to implement the RS-485 protocol. Table 9.4 summarizes some important specifications for the RS-series serial data lines. 9.9.3 The Universal Serial Bus (USB)

The USB is rapidly replacing the RS-232C & D serial interfaces as a means for a computer to communicate with medium speed peripheral devices such as scanners and digital cameras. Practically all new PCs made in the last four years have two USB ports. Reasons for the popularity of USBs includes its simple connection, plug and play feature, hot insertion capability, speed and versatility. USB v.1.0 was released in January 1996. It permitted low speed (1.5 Mb/s) and medium speed (12 Mb/s) data transfer rates. (Note that Mb/s refers to Megabits per second, not Megabytes.) The actual USB data rate is slower because of USB protocol (operating) data sent to and from a peripheral device. USB v.1.1 was released in September 1998. This edition fixed many of the problems found in release 1.0. The USB v.2.0 was released in early 2000 and has a maximum bit clock rate of 480 Mb/s. It is downward compatible with v.1.1 and v.1.0. The USB data is clock encoded and uses NRZI with bit stuffing. A transaction 3 packets, with flexible packet size of up to 1023 Bytes. A start-of-frame marker occurs

Das könnte Ihnen auch gefallen