Transcript Document

Local Asynchronous
Communications (RS-232)
Computer Networks and Internets by Douglas Comer
Includes material from other sources.
Rick Graziani
[email protected]
[email protected]
1
5.2 Asynchronous Communications


Note: The next two chapters are better discussed in a Data
Communications class where they can be given the appropriate amount
of time and focus.
This chapter discusses how electric current is used to transfer digital
information across short distances.
Asynchronous communications

In the broadest sense, asynchronous communications is when the send
and receiver to no need to coordinate (synchronize) before data is
transmitted.

Note: This synchronization is at layer 1 as opposed to layer 4.

Communications hardware is classified asynchronous if the electrical
signal the transmitter sends does not contain information that the
receiver can use to determine where individual bits begin and end.

The receiving hardware must be built to accept and interpret the signal
the sending hardware generates.

Comer, Chapter 6 Long Distance Communications, will describe
synchronous communications.
Rick Graziani, [email protected]
2
Asynchronous Transmission – more info





Serial Transmission = Method of information transmission in which
one bit of a character is sent at a time. (figure 3-9)
Requires only one wire for transmission of a bit, plus other wires for
transmitting other characters (later)
Generally slower than parallel transmission
Generally costs less than parallel transmission due to needing fewer
hardware components and cables
Serial Transmission can use one of the following transmission modes:
 Asynchronous transmission
 Synchronous transmission
Rick Graziani, [email protected]
3
Asynchronous Transmission – more info





Asynchronous: From the Greek asyn-, meaning "not with," and
chronos, meaning "time“, “not with time”
A method of data transmission which allows characters (bytes) to be
sent at irregular intervals by preceding each character with a start bit,
and following it with a stop bit. (Newton)
Common for low speed and inexpensive transmissions such as
terminals.
Data rate = Transmission rate usually measured in bits per second or
bps.
Start and Stop bits define where the character begins and ends.
Rick Graziani, [email protected]
4
Asynchronous Transmission – more info
Start bit = A bit, always a 0 (off), followed by each of the data bits.

“Tips off the computer that the next bit is part of a transmitted
character and not just part of the inter-character gap.” (Newton)
Stop bit = A bit, always a 1 (on), which follows the last data bit or
parity bit.

“An interval at the end of each asynchronous character that allows
the receiving computer to pause before the start of the next
character.” (Newton)
Rick Graziani, [email protected]
5
Asynchronous Transmission – FYI






The start bit starts the receiving computer’s internal clock and the
expects to receive a certain number of data bits depending on the
agreed upon data rate.
Each device, sender and receiver, must be set to transmit and receive
data at a given speed.
Error checking is done on each character, using the parity bit (later).
Receiver must somehow “sample” the incoming data accurately, i.e.
receiver must sample the incoming data as close to the center of the
“bit-cell” as possible. (coming) (See the Nyquist criteria for more
information on how this is done.)
Transmitter and receiver clocks are independent of each other.
Timing problems may arise if sender and receiver have different clock
rates.
Rick Graziani, [email protected]
6
Asynchronous Transmission – FYI
Timing in Asynchronous Communications (UDC refers to the book Understanding Data
Communications by Held)





Transmitter and receiver must agree on an exact clock rate
Receiver retimes its clock on the edge of the of the transition (change) from the
previous stop bit (1) to the zero (0) of the start bit.
Receiver uses new timing to find the middle of the start bit. (Figure UDC-2.15a)
If the receiver clock is slightly fast, no error occurs because the sample strobe
still occurs within each bit time or bit cell. (Figure UDC-2.15b)
If the receiver clock is so much slower than the clock of the transmitter, the
sample strobe does not sample bit 4 and an error occur in the output. (Figure
UDC-2.15c)
Rick Graziani, [email protected]
7
Another
explanation
from
Sangoma
Technologies





FYI
Asynchronous communications
This is the method most widely used for PC or simple terminal serial
communications.
In asynch. serial communication, the electrical interface is held in the mark position
between characters. The start of transmission of a character is signaled by a drop in
signal level to the space level. At this point, the receiver starts its clock. After one bit
time (the start bit) come 8 bits of true data followed by one or more stop bits at the
mark level. The receiver tries to sample the signal in the middle of each bit time. The
byte will be read correctly if the line is still in the intended state when the last stop bit is
read.
Thus the transmitter and receiver only have to have approximately the same clock
rate. A little arithmetic will show that for a 10 bit sequence, the last bit will be
interpreted correctly even if the sender and receiver clocks differ by as much as 5%.
Asynch. is relatively simple, and therefore inexpensive. However, it has a high
overhead, in that each byte carries at least two extra bits: a 25% loss of line
bandwidth. A 56kbps line can only carry 5600 bytes/second asynchronously, in ideal
conditions.
Sangoma Technologies: http://www.sangoma.com/sync&a.htm
Rick Graziani, [email protected]
8
5.3 Using Electrical Current



The simplest electronic communication systems use a small electric
current to encode data.
Negative voltage might be used to represent a 1 (on bit), and a positive
voltage might be used to represent a 0 (off bit).
These voltages are sent over the wire for a specific amount of time.
Rick Graziani, [email protected]
9
5.4 Standards for Communications
Challenges:

How long should the voltage be held for a 0 or a 1?

What voltages and levels do we use?

How do you determine the number of 0’s or 1’s when the bits are
consecutive?

How do we consider issues such as clocking, timing and high-speed
transmission issues? (Data Communications)

How do we ensure inter-vendor compatibility?
Solution:

Use standards set by responsible organizations such as ITU, EIA, IEEE.
Rick Graziani, [email protected]
10
5.4 – Standards For Communications
RS-232

EIA RS-232-C = A common standard designed for use with devices such
as modems and terminals, specifying the transmission of characters.

Designed for 7 bit characters, but can send 8 bit as well.

RS-232 is asynchronous so sender and receiver do not need to
coordinate (clocking, etc.) before transmission.
 RS-232 allows a character to be sent at any time and the delay between
characters is arbitrary.

Used for short distances between a computer and a modem or terminal.

Let’s see how this is done!
Rick Graziani, [email protected]
11
5.4 – Standards For Communications
RS-232




RS-232 never leaves zero volts on the wire.
When the transmitter has nothing to send, it leaves the wire with
negative voltage that corresponds to bit value of 1.
Since the wire does “not return to zero volts” between each bit, a
receiver cannot use the lack of voltage to mark the end of one bit and
the start of the next. (see consecutive 1’s)
Instead both the sender and receiver must agree on the exact length of
time the voltage will be help for each bit.
Rick Graziani, [email protected]
12
5.4 – Standards For Communications
RS-232
When the first bit arrives, the receiver starts a timer.

Each bit is transmitted with the same length of time.

The start bit (+15v) is used to signal the beginning of the character,
transitioning from idle (-15v) and to start (+15v).

Positive (+) 15 volts are used for 0 bits

Negative (-) 15 volts are used for 1 bits
RS-232

1 start bit (0 bit or +15v)

7 data bits

1 stop bit (1 bit or –15v)

Rick Graziani, [email protected]
13
RS-232 – More info (FYI)

Common RS-232-C connectors
Rick Graziani, [email protected]
18
14
RS-232 – More info (FYI)
Voltage Levels for Data

0 = signal b/t +3 and +15 volts

1 = signal b/t -3 and -15 volts
Transition zone or Guard band

signals outside the specified ranges which are ignored by the receiver
Limitations

Distance: 50 feet per standard

Speed: 20 kbps (can be faster)
Rick Graziani, [email protected]
15
RS-232 – More info (FYI)
The previous slides can be somewhat misleading, making you think RS-232 is a
standard between two computers (DTE devices) although it can be used as
such. (later)

EIA Interface standard for communications between a DTE and a DCE

20 - 115 kbps data rate
DTE (Data Terminal Equipment) = any device capable of generating and/or
receiving data such as computers, terminals, etc.

a source and a sink of data
DCE (Data Circuit-terminating Equipment or Data Communications
Equipment) = any device capable of connecting to a DTE on one side and a
transmission channel on the other side

allows for DTE to communicate remotely (Figure 4-3)

examples: modem or DSU (Data Service Unit) - later

responsible for converting data into “signals” so that they can be transported
over the transmission channel

Rick Graziani, [email protected]
16
RS-232 – More info (FYI)
Rick Graziani, [email protected]
17
RS-232 – More info (FYI)
1
20
LOCAL
Sending
Device
DTR
2
6
3
2
DTE
20
20
REMOTE
Receiving
Device
DTR
DSR
6
6
DSR
6
TD
2
22
RI
22
8
CD
8
DCE
4

Transmission
Send Telephone
Number
Sends a Carrier
Wave
Returns a Carrier
Wave
DCE
DTE
20
5
8
CD
8
6
4
RTS
4
4
7
5
CTS
5
5
CTS
5
8
2
TD
2
Send Data
3
RD
3
9
3
RD
3
Receive Data
2
TD
2
1
0
20
DTR
----------->
20
Carrier Wave is
Dropped ---------- >
8
CD
---------->
8
RTS
4
Explanation on next slide.
Rick Graziani, [email protected]
18
RS-232 – More info (FYI)
1.
2.
3.
Local and Remote DTE: “I would like to talk to the modem.” (Raise DTR)
Local and Remote DCE: “I am powered up and ready to go.” (Raise DSR)
Local DTE: “Send Telephone Number.” (On TD),
Remote DCE: “The phone is ringing.”
(RI) Remote DTE: “Well, answer it!”
4. (4 – 7) Modems send a Carrier Wave. In a full-duplex environment, CD, RTS and CTS are
constantly asserted.
8. Local DTE: Data Transmitted on TD.
Local DCE: Data Received on TD and sent out on telephone line to Remote DCE.
Remote DCE: Data Received on telephone line and sent to Remote DTE on RD.
Remote DTE: Data Received on RD.
9. Remote DTE: Data Transmitted on TD.
Remote DCE: Data Received on TD and sent out on telephone line to Local DCE.
Local DCE: Data Received on telephone line and sent to Local DTE on RD.
Local DTE: Data Received on RD.
10. Local DTE: “Session is over, I am going to hang-up and drops the DTR.”
Local DCE: “Hey, DTR is dropped, so I am going to drop the Carrier Wave to the Remote
DCE.
Remote DCE: “Hey, there is no carrier wave, I am going to drop CD to Remote DTE.”
Remote DTE: “Hey, there is not Carrier, so the session must be over and so am I.”
Rick Graziani, [email protected]
19
RS-232 – More info (FYI)


Differences in pinning between DTE to DCE and DTE to DTE.
See AndyWhittaker.com for more info:
http://www.andywhittaker.com/ecu/rs232.htm
Rick Graziani, [email protected]
20
For More On Channel Coding Schemes
Unipolar NRZ
Polar NRZ
NRZI
Manchester
Differential
Manchester

For more information on other Channel Coding Schemes, including AMI,
B8ZS, and others, check out various data communications books and
articles.
Rick Graziani, [email protected]
21
5.5 Baud Rate, Framing, and Errors


Baud rate is better explained in the next Comer chapter,
after we have had a chance to explain frequency, amplitude,
and phase shift.
The rest of this section is FYI.
Rick Graziani, [email protected]
22
5.6 Full Duplex Asynchronous Comms.



Simplex Transmission: One way and one way only. (Note: Comer does not
differentiate between simplex and half-duplex.)

One way street
Half-duplex Transmission: Either way, but only one way at a time.

Two way street, but only one way at a time (land slide).
Full-duplex Transmission: Both ways at the same time.

Two way street
Rick Graziani, [email protected]
23
5.6 Full Duplex Asynchronous Comms.


Minimal wiring required for full-duplex RS-232
communications.
When using coax cable, signal is sent along the center
conductor, and the shield provides a return path.
Rick Graziani, [email protected]
24
5.7 Limitations of Real Hardware


Samples are taken at the middle of the time allocated to the bit in order
to take into account imperfections in voltage.
More information in Channel Coding presentation.
Rick Graziani, [email protected]
25
5.8 Hardware Bandwidth and the
Transmission of Bits


In an attempt to be brief, Comer is not complete in this
section.
Instead, we will cover this information in the next chapter
from Comer, (Chapter 6 Long Distance Communication) and
use information from Data Communication sources as well.
Rick Graziani, [email protected]
26
Possible Final Projects



To do justice to these subjects, we would need to spend
more time than allocated by Comer.
Instead, we will make these possible topics for final
projects.
 5.9 The Effect of Noise on Communications
 5.10 Significance For Data Networking
 Nyquist Theorem
 Shannon’s Theorem or Shannon’s Law
Other possible topics for final projects from this area:
 Channel-coding schemes
 Details of the operation of RS-232
 How coaxial cable is used for transmissions.
Rick Graziani, [email protected]
27
Chapter 5 – Local Asynchronous
Communications (RS-232)
Computer Networks and Internets by Douglas Comer
Instructor: Rick Graziani, August 1, 2002
CST 311 Introduction to Telecommunications
Includes material from other sources.
University transferable option of CIS 181 at Cabrillo College
Rick Graziani
[email protected]
[email protected]
28