Top Banner
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University
23

Fall 2005 Local Serial Asynchronous Communication

Dec 31, 2015

Download

Documents

autumn-jimenez

Fall 2005 Local Serial Asynchronous Communication. Qutaibah Malluhi Computer Science and Engineering Qatar University. Bit-wise data transmission. Data transmission requires: Encoding bits as energy Transmitting energy through medium Decoding energy back into bits - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Fall 2005 Local Serial Asynchronous Communication

1

Fall 2005

Local Serial Asynchronous Communication

Qutaibah MalluhiComputer Science and Engineering

Qatar University

Page 2: Fall 2005 Local Serial Asynchronous Communication

2

Bit-wise data transmission

Data transmission requires: – Encoding bits as energy – Transmitting energy through medium – Decoding energy back into bits

Energy can be electric current, radio, infrared, light

Transmitter and receiver must agree on encoding scheme and transmission timing

Page 3: Fall 2005 Local Serial Asynchronous Communication

3

Using Electric Current to Send Data

Simple idea - use varying voltages to represent 1s and 0s

One common encoding use negative voltage for 1 and positive voltage for 0

In following figure, transmitter puts positive voltage on line for 0 and negative voltage on line for 1

Page 4: Fall 2005 Local Serial Asynchronous Communication

4

Encoding Details and Standards

Encoding scheme must specify the details. For example: – How long will voltage last for each bit? – How soon will next bit start? – How will the transmitter and receiver agree on timing?

All details specified by standards Allow interoperability of devices adhering to the

standard Several organizations produce networking

standards» International Telecommunications Union (ITU) » Electronic Industries Association (EIA) » Institute for Electrical and Electronics Engineers (IEEE)

Page 5: Fall 2005 Local Serial Asynchronous Communication

5

Types of Data Transmission

Page 6: Fall 2005 Local Serial Asynchronous Communication

6

Parallel versus Serial Transmission

Parallel

Serial

Page 7: Fall 2005 Local Serial Asynchronous Communication

7

Asynchronous Communication

Asynchronous and synchronous communications In broad sense, communication may be called

asynchronous if transmitter and receiver do not explicitly coordinate before each data transmission – Sender can wait arbitrarily long between transmissions.

Sends when data becomes ready– Used, for example, when sender may not always have

data ready to send (E.g., keyboard, mouse) – Receiver does not know when a character will arrive.

May wait forever In more technical sense, Asynchronous may also

mean no explicit information about where individual data bits begin and end

Page 8: Fall 2005 Local Serial Asynchronous Communication

8

Asynchronous Vs. Synchronous

Synchronous:– May use a separate

clock signal to indicate duration of bits.

Asynchronous– How do we know beginning of a bit and the ending of

it?– One way to ensure meaningful exchange

» Sender and receiver agree on bit duration» Start bit before character» One or more stop bits after character» 1s when idle

Line idle 0 1 1 0 1 0 1

Clock

Data

e.g., 010100110100110101110011010111111111 Ch1 Ch2

Ch3 Idle

Page 9: Fall 2005 Local Serial Asynchronous Communication

9

Asynchronous Transmission

Page 10: Fall 2005 Local Serial Asynchronous Communication

10

The RS-232C Standard

Standard specified by EIA For transfer of characters across copper wire Full name is RS-232-C common name is RS-232 Defines serial, asynchronous communication

– Serial - bits are encoded and transmitted one at a time (as opposed to parallel transmission)

– Asynchronous - characters can be sent at any time and bits are not individually synchronized

Page 11: Fall 2005 Local Serial Asynchronous Communication

11

More Details about RS-232

Components of standard: – Data represented by voltage between +15 and –15– Cable limited to ~50 feet– 25-pin connector, with specific signals such as data,

ground and control assigned to designated pins – Specifies transmission of characters between, e.g., a

terminal and a modem Transmitter never leaves wire at 0v; when idle,

transmitter puts negative voltage (a 1) on the wire

Page 12: Fall 2005 Local Serial Asynchronous Communication

12

RS-232 Character Transmission

Transmitter indicates start of next character by transmitting a zero – Receiver can detect transition as start of character – Extra zero called the start bit

Transmitter must leave wire idle so receiver can detect transition marking beginning of next character – Transmitter sends a one after each character – Extra one called the stop bit

Thus, character represented by 7 data bits requires transmission of 9 bits across the wire

RS-232 terminology: MARK is a negative voltage (== 1) SPACE is a positive voltage (== 0)

Page 13: Fall 2005 Local Serial Asynchronous Communication

13

Duration of a Bit

Transmitter and receiver must agree on timing of each bit

Agreement accomplished by choosing transmission rate – Measured in bits per second – Detection of start bit indicates to receiver when

subsequent bits will arrive Hardware can usually be configured to select

matching bit rates – Switch settings – Software

– Autodetection

Page 14: Fall 2005 Local Serial Asynchronous Communication

14

Bit Rate And Baud Rate

Baud rate measures number of signal changes per second

Bits per second measures number of bits transmitted per second

In RS-232, each signal change represents one bit, so baud rate and bits per second are equal

If each signal change represents more than one bit, bits per second may be greater than baud rate– Bit rate = Baud rate * the number of bits represented by

each signal unit– Example: An analog signal carries 4 bits in each signal

change. If 1000 signal changes are sent per second, then baud rate = 1000 bauds per second,

bit rate = 1000 * 4 = 4000 bps

Page 15: Fall 2005 Local Serial Asynchronous Communication

15

Character Framing

Start and stop bits represent framing of each character

If transmitter and receiver are using different speeds, stop bit will not be received at the expected time

Problem is called a framing error RS-232 devices may send an intentional framing

error called a BREAK – E.g., ASCII keyboard BREAK key– Deliberately create a framing error. Applications

noticing a framing error as a request to abort

Page 16: Fall 2005 Local Serial Asynchronous Communication

16

Full-Duplex Communication

Simultaneous two-way communication Requires each side to have transmitter and receiver Requires an electrical path in each direction

Transmitter on one side connected to receiver on other

Separate wires needed to carry current in each direction

Common ground wire

Page 17: Fall 2005 Local Serial Asynchronous Communication

17

DB-25 Connection Standard

RS-232 specifies use of 25 pin connector (DB-25)

Pins are assigned for use as data, ground and control: – Pin 2 - Receive (RxD) – Pin 3 - Transmit (TxD) – Pin 4 - Ready to send

(RTS) – Pin 5 - Clear to send

(CTS) – Pin 7 – Ground

Commonly DB-9 is used.

Page 18: Fall 2005 Local Serial Asynchronous Communication

18

2-3 Swap

Cable must cross-over wires to connect pins 2 and 3 on receiver and transmitter

RS-232 specifies that modems (DTE) transmit on pin 2 and receive on pin 3, while computers (DCE) transmit on pin 3 and receive on pin 2– DTE: Data Terminal Equipment (modem)– DCE: Data Computer Equipment (computer)

To connect two DCEs (Computers), RS-232 cables between two computers must have 2-3 swap– Also called null modem cable

To connect DCE to DTE, use a straight through cable– Standard modem cable

Page 19: Fall 2005 Local Serial Asynchronous Communication

19

Electric Transmission

In real world– Electric energy dissipates as it travels along– Wires have resistance, capacitance, and inductance

which distort signals– Magnetic or electrical interference distorts signals– Distortion can result in loss or misinterpretation

Page 20: Fall 2005 Local Serial Asynchronous Communication

20

Distorted Signal For A Single Bit

In practice– Distortion can be much worse than illustrated

Page 21: Fall 2005 Local Serial Asynchronous Communication

21

Consequences

RS-232 hardware must handle minor distortions– Take multiple samples per bit– Tolerate less than full voltage

Can not use electrical current for long-distance transmission– Use carrier signals

Page 22: Fall 2005 Local Serial Asynchronous Communication

22

Newer Standards

USB (Universal Serial Bus)– Hot pluggable– Device powered by bus– Upto 12 Mbps – Newer USB2 speed is 480 Mbps

Firewire: a high speed serial bus– 400/800 Mbps

Page 23: Fall 2005 Local Serial Asynchronous Communication

23

Conclusions

Asynchronous communication - data can start at any time; individual bits not delineated

RS-232 - EIA standard for asynchronous character transmission

Bit rate and baud rate Bandwidth limits maximum data transmission

rate Newer standards such as USB and Firewire are

replacing the role of RS 232 in PCs