Serial Data Communication

29
SERIAL DATA COMMUNICATION

description

 

Transcript of Serial Data Communication

Page 1: Serial Data Communication

SERIAL DATA COMMUNICATION

Page 2: Serial Data Communication

INTRODUCTION

• Definition

Page 3: Serial Data Communication

• Component

All data communications systems have the following components:• The source of the data (e.g. a computer). Also required is circuitry that converts the signal into one that is compatible with the communications link, called a transmitter or line driver • The communications link (twisted-pair cable, coaxial cable, radio, telephone network etc), which transfers the message to the receiver at the other end• The receiver of the data where the signal is converted back into a form that can be used by the local electronics circuitry

Page 4: Serial Data Communication

• Transmission modes1. Simplex

Page 5: Serial Data Communication

2. Duplex- Half duplex

- Full duplex

Page 6: Serial Data Communication

BASIC PRINCIPLE

a. CodingEncoding is the process of converting the message data

into a standard binary code for transfer over the data communications link. This code assigns a binary field of 7-bits to represent each character, giving 128 (27) unique characters made up of:• Upper and lower case letters, and numerals 1 to 9• Various punctuation marks and symbols• A set of control codes (the first 32 characters) that are used by the communications link itself and are not printable

Page 7: Serial Data Communication

ASCII tables

Page 8: Serial Data Communication

• Format of data communication

Format of a typical serial asynchronous data message

Page 9: Serial Data Communication

In summary, the optional settings for asynchronous transmission of characters are:• Start bits 1• Data bits 5, 6, 7, 8• Parity bits even, odd, mark, space or none• Stop bits 1, l½ or 2As there cannot be half a bit, 1½-stop bits means that the mark length is 50% longer than for one stop bit.

Page 10: Serial Data Communication

• Data transmission speedFactor:• Type and complexity of the circuitry at each end

(interface)• Communication link (twisted-pair, coaxial cable,

radio etc)• Distance between the sender and receiver• Amount of data being transferred• The overhead associated with the data transfer• The acceptable rate of error

Page 11: Serial Data Communication

RS-232-C• Characteristics1. Electrical

The RS-232 standard is designed for the connection of two devices: data terminal equipment (DTE), such as a computer or printer, and data communications equipment (DCE), such as a modem.

Page 12: Serial Data Communication

Connection between DTE and DCE

Page 13: Serial Data Communication

The electrical connections are divided into the four groups shown below:• Data lines• Control lines• Timing lines• Special secondary functions

Page 14: Serial Data Communication

2. Mechanical

Page 15: Serial Data Communication

• Function• Pin 1: Protective ground (shield)• Pin 2: Transmitted data (TXD)• Pin 3: Received data (RXD)• Pin 4: Request to send (RTS)• Pin 5: Clear to send (CTS)• Pin 6: Data set ready (DSR)• Pin 7: Signal ground (common)• Pin 8: Data carrier detect (DCD)• Pin 20: DTE ready (or data terminal ready)• Pin 22: Ring indicator• Pin 23: Data signal rate selector (DSRS)

Page 16: Serial Data Communication

Sequence of Operation

Page 17: Serial Data Communication

RS-485• Application

The RS-485 standard was designed for two-wire, half duplex, balanced multidrop communications, and allows up to 32 line drivers and 32 line receivers on the same line. It incorporates the advantages of balanced lines with the need for only two wires (plus signal common) cabling. RS-485 provides reliable serial communications for:• Distances of up to 1200 m• Data rates of up to 10 Mbps• Up to 32 line drivers permitted on the same line• Up to 32 line receivers permitted on the same line

Page 18: Serial Data Communication

• RangeThe line voltages range between –1.5 V to –6 V for logic ‘1’ and +1.5 V to +6 V for logic ‘0’. The line driver for the RS-485 interface produces a 5 V differential voltage on two wires. For full-duplex systems, four wires are required. For a half-duplex system, only two wires are required.

Page 19: Serial Data Communication

• Sequence of operation

Page 20: Serial Data Communication
Page 21: Serial Data Communication

Converter (RS-232 to RS-485)

Typical specifications for an RS-232/RS-485 converter are:• Data transfer rate up to 1 Mbaud• DCE/DTE switch selectable• Converts all data and control signals• LEDs for status of data and control signals• Powered from AC source or self-powered from pins 9 & 10 of EIA-232 port• Optically isolated (optional)• DB-25 connector (male or female)• DB-37 connector (male or female)

Page 22: Serial Data Communication

PROTOCOLS

A protocol is essentially a common set of rules governing the exchange of data between the transmitter and receiver of a communications network, and is normally associated with the packaging of data transmitted on the communications interface. Important feature:• Initialization• Framing and frame synchronization• Flow control• Line control• Error control• Timeout control

Page 23: Serial Data Communication

FLOW CONTROL PROTOCOLS

1. Character flow protocols (XON/XOFF)This is a popular flow control protocol that has two characters assigned as XON (start) or XOFF (stop). Typically, the ASCII characters DC3 (Ctrl-S) and DC1 (Ctrl-Q) are assigned to XOFF and XON respectively.

2. Whole line protocols (ETX/ACK)The ETX/ACK protocol, designed by IBM, is based on the transmitter appending an ETX character after each line of data and waiting for the receiver’s ACK, requesting the next line of data.

Page 24: Serial Data Communication

ASCII-based PROTOCOLS

- Protocols Structure

Page 25: Serial Data Communication

ERROR DETECTION

• Character redundancy checks• Block redundancy checks• Cyclic redundancy checkS

Page 26: Serial Data Communication

TROUBLESHOOTING

• Check the basic parameters• Identify which is DTE or DCE• Clarify the needs of the hardware handshaking• Check the actual protocol used

Page 27: Serial Data Communication

TESTING SERIAL DATA COMMUNICATION CIRCUITS

When a data communication link won’t work, the following five very useful devices can be used to assist in analyzing the problem:• The breakout box

Page 28: Serial Data Communication

• Null modem

Page 29: Serial Data Communication

• Protocol analyzerA protocol analyzer is used to display the actual

bits on the data line, as well as the special control codes, such as X-ON, X-OFF, LF, CR, etc.

This helps to confirm that the transmitting terminal is sending the correct data and that the receiving device is receiving it. The protocol analyzer is useful in identifying incorrect setting of baud rate, parity, stop bit, noise or incorrect wiring and connection.