Anda di halaman 1dari 19

Introduction to Serial Communications

All IBM PC and compatible computers are typically equipped with two serial ports and
one parallel port. Although these two types of ports are used for communicating with
external devices, they work in different ways.
A parallel port sends and receives data eight bits at a time over 8 separate wires. This
allows data to be transferred very quickly; however, the cable required is more bulky
because of the number of individual wires it must contain. Parallel ports are typically
used to connect a PC to a printer and are rarely used for much else. A serial port sends
and receives data one bit at a time over one wire. While it takes eight times as long to
transfer each byte of data this way, only a few wires are required. In fact, two-way (full
duplex) communications is possible with only three separate wires - one to send, one to
receive, and a common signal ground wire.

Bi-Directional Communications
The serial port on your PC is a full-duplex device meaning that it can send and receive
data at the same time. In order to be able to do this, it uses separate lines for
transmitting and receiving data. Some types of serial devices support only one-way
communications and therefore use only two wires in the cable - the transmit line and the
signal ground.
Communicating by Bits
Once the start bit has been sent, the transmitter sends the actual data bits. There may
either be 5, 6, 7, or 8 data bits, depending on the number you have selected. Both
receiver and the transmitter must agree on the number of data bits, as well as the baud
rate. Almost all devices transmit data using either 7 or 8 databits.
Notice that when only 7 data bits are employed, you cannot send ASCII values greater
than 127. Likewise, using 5 bits limits the highest possible value to 31. After the data
has been transmitted, a stop bit is sent. A stop bit has a value of 1 - or a mark state and it can be detected correctly even if the previous data bit also had a value of 1. This
is accomplished by the stop bit's duration. Stop bits can be 1, 1.5, or 2 bit periods in
length.
The Parity Bit
Besides the synchronization provided by the use of start and stop bits, an additional bit
called a parity bit may optionally be transmitted along with the data. A parity bit affords a
small amount of error checking, to help detect data corruption that might occur during
transmission. You can choose either even parity, odd parity, mark parity, space parity or
none at all. When even or odd parity is being used, the number of marks (logical 1 bits)
in each data byte are counted, and a single bit is transmitted following the data bits to

indicate whether the number of 1 bits just sent is even or odd.


For example, when even parity is chosen, the parity bit is transmitted with a value of 0 if
the number of preceding marks is an even number. For the binary value of 0110 0011
the parity bit would be 0. If even parity were in effect and the binary number 1101 0110
were sent, then the parity bit would be 1. Odd parity is just the opposite, and the parity
bit is 0 when the number of mark bits in the preceding word is an odd number. Parity
error checking is very rudimentary. While it will tell you if there is a single bit error in the
character, it doesn't show which bit was received in error. Also, if an even number of
bits are in error then the parity bit would not reflect any error at all.
Mark parity means that the parity bit is always set to the mark signal condition and
likewise space parity always sends the parity bit in the space signal condition. Since
these two parity options serve no useful purpose whatsoever, they are almost never
used.
RS-232C
RS-232 stands for Recommend Standard number 232 and C is the latest revision of the
standard. The serial ports on most computers use a subset of the RS-232C standard.
The full RS-232C standard specifies a 25-pin "D" connector of which 22 pins are used.
Most of these pins are not needed for normal PC communications, and indeed, most
new PCs are equipped with male D type connectors having only 9 pins.
DCE and DTE Devices
Two terms you should be familiar with are DTE and DCE. DTE stands for Data Terminal
Equipment, and DCE stands for Data Communications Equipment. These terms are
used to indicate the pin-out for the connectors on a device and the direction of the
signals on the pins. Your computer is a DTE device, while most other devices are
usually DCE devices.
If you have trouble keeping the two straight then replace the term "DTE device" with
"your PC" and the term "DCE device" with "remote device" in the following discussion.
The RS-232 standard states that DTE devices use a 25-pin male connector, and DCE
devices use a 25-pin female connector. You can therefore connect a DTE device to a
DCE using a straight pin-for-pin connection. However, to connect two like devices, you
must instead use a null modem cable. Null modem cables cross the transmit and
receive lines in the cable, and are discussed later in this chapter. The listing below
shows the connections and signal directions for both 25 and 9-pin connectors.
25 Pin Connector on a DTE device (PC connection)

Male RS232
DB25
Pin Number

Direction of signal:

Protective Ground

Transmitted Data (TD) Outgoing Data (from a DTE to a DCE)

Received Data (RD) Incoming Data (from a DCE to a DTE)

Request To Send (RTS) Outgoing flow control signal controlled by


DTE

Clear To Send (CTS) Incoming flow control signal controlled by DCE

Data Set Ready (DSR) Incoming handshaking signal controlled by


DCE

Signal Ground Common reference voltage

Carrier Detect (CD) Incoming signal from a modem

20

Data Terminal Ready (DTR) Outgoing handshaking signal controlled


by DTE

22

Ring Indicator (RI) Incoming signal from a modem

9 Pin Connector on a DTE device (PC connection)


Male RS232
DB9
Pin Number

Direction of signal:

Carrier Detect (CD) (from DCE) Incoming signal from a modem

Received Data (RD) Incoming Data from a DCE

Transmitted Data (TD) Outgoing Data to a DCE

Data Terminal Ready (DTR) Outgoing handshaking signal

Signal Ground Common reference voltage

Data Set Ready (DSR) Incoming handshaking signal

Request To Send (RTS) Outgoing flow control signal

Clear To Send (CTS) Incoming flow control signal

9
Ring Indicator (RI) (from DCE) Incoming signal from a modem
The TD (transmit data) wire is the one through which data from a DTE device is
transmitted to a DCE device. This name can be deceiving, because this wire is used by
a DCE device to receive its data. The TD line is kept in a mark condition by the DTE
device when it is idle. The RD (receive data) wire is the one on which data is received
by a DTE device, and the DCE device keeps this line in a mark condition when idle.
RTS stands for Request To Send. This line and the CTS line are used when "hardware

flow control" is enabled in both the DTE and DCE devices. The DTE device puts this
line in a mark condition to tell the remote device that it is ready and able to receive data.
If the DTE device is not able to receive data (typically because its receive buffer is
almost full), it will put this line in the space condition as a signal to the DCE to stop
sending data. When the DTE device is ready to receive more data (i.e. after data has
been removed from its receive buffer), it will place this line back in the mark condition.
The complement of the RTS wire is CTS, which stands for Clear To Send. The DCE
device puts this line in a mark condition to tell the DTE device that it is ready to receive
the data. Likewise, if the DCE device is unable to receive data, it will place this line in
the space condition. Together, these two lines make up what is called RTS/CTS or
"hardware" flow control. The Software Wedge supports this type of flow control, as well
as Xon/XOff or "software" flow control. Software flow control uses special control
characters transmitted from one device to another to tell the other device to stop or start
sending data. With software flow control the RTS and CTS lines are not used.
DTR stands for Data Terminal Ready. Its intended function is very similar to the RTS
line. DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to
RTS. Some serial devices use DTR and DSR as signals to simply confirm that a device
is connected and is turned on. The Software Wedge sets DTR to the mark state when
the serial port is opened and leaves it in that state until the port is closed. The DTR and
DSR lines were originally designed to provide an alternate method of hardware
handshaking. It would be pointless to use both RTS/CTS and DTR/DSR for flow control
signals at the same time. Because of this, DTR and DSR are rarely used for flow
control.
CD stands for Carrier Detect. Carrier Detect is used by a modem to signal that it has a
made a connection with another modem, or has detected a carrier tone.
The last remaining line is RI or Ring Indicator. A modem toggles the state of this line
when an incoming call rings your phone.
The Carrier Detect (CD) and the Ring Indicator (RI) lines are only available in
connections to a modem. Because most modems transmit status information to a PC
when either a carrier signal is detected (i.e. when a connection is made to another
modem) or when the line is ringing, these two lines are rarely used.

RS-232 Connections

A straight-through cable is used to connect a DTE (e.g. computer) to a DCE (e.g.


modem), all signals in one side connected to the corresponding signals in the other side
in a one-to-one basis.
A crossover (null-modem) cable is used to connect two DTE directly, without a modem
in between. They cross transmit and receive data signals between the two sides and

there are many variations on how the other control signals are wired, below is one of
them:
Straight-through (DB-9)
(DTE)

Crossover (Null-Modem) (DB-9)

(DCE)

(DTE)

DCD

-------

DCD

DCD

RxD

-------

TxD

RxD

TxD

-------

RxD

DTR

-------

DSR

GND

-------

GND

DSR

-------

RTS

8
9

(DTE)
DCD

-------

TxD

TxD

-------

RxD

DTR

-------

DSR

GND

-------

GND

DTR

DSR

-------

DTR

-------

CTS

RTS

-------

CTS

CTS

-------

RTS

CTS

-------

RTS

RI

-------

RI

RI

RI

9 to 25 Pin Adapters
The following table shows the connections inside a standard 9 pin to 25 pin adapter.
9-Pin Connector

25 Pin Connector

Pin 1 DCD

Pin 8 DCD

Pin 2 RD

Pin 3 RD

Pin 3 TD

Pin 2 TD

Pin 4 DTR

Pin 20 DTR

Pin 5 GND

Pin 7 GND

Pin 6 DSR

Pin 6 DSR

Pin 7 RTS

Pin 4 RTS

Pin 8 CTS

Pin 5 CTS

Pin 9 RI

Pin 22 RI

Baud vs. Bits per Second


The baud unit is named after Jean Maurice Emile Baudot, who was an officer in the
French Telegraph Service. He is credited with devising the first uniform-length 5-bit
code for characters of the alphabet in the late 19th century. What baud really refers to is
modulation rate or the number of times per second that a line changes state. This is not
always the same as bits per second (BPS). If you connect two serial devices together
using direct cables then baud and BPS are in fact the same. Thus, if you are running at
19200 BPS, then the line is also changing states 19200 times per second. But when
considering modems, this isn't the case.
Because modems transfer signals over a telephone line, the baud rate is actually limited
to a maximum of 2400 baud. This is a physical restriction of the lines provided by the
phone company. The increased data throughput achieved with 9600 or higher baud
modems is accomplished by using sophisticated phase modulation, and data
compression techniques.
Cables, Null Modems, and Gender Changers
In a perfect world, all serial ports on every computer would be DTE devices with 25-pin
male "D" connectors. All other devices to would be DCE devices with 25-pin female
connectors. This would allow you to use a cable in which each pin on one end of the
cable is connected to the same pin on the other end. Unfortunately, we don't live in a
perfect world. Serial ports use both 9 and 25 pins, many devices can be configured as
either DTE or DCE, and - as in the case of many data collection devices - may use
completely non standard or proprietary pin-outs. Because of this lack of standardization,
special cables called null modem cables, gender changers and custom made cables are
often required.

Cables Lengths
The RS-232C standard imposes a cable length limit of 50 feet. You can usually ignore
this "standard", since a cable can be as long as 10000 feet at baud rates up to 19200 if
you use a high quality, well shielded cable. The external environment has a large effect
on lengths for unshielded cables. In electrically noisy environments, even very short
cables can pick up stray signals. The following chart offers some reasonable guidelines
for 24 gauge wire under typical conditions. You can greatly extend the cable length by
using additional devices like optical isolators and signal boosters. Optical isolators use
LEDs and Photo Diodes to isolate each line in a serial cable including the signal ground.
Any electrical noise affects all lines in the optically isolated cable equally - including the
signal ground line. This causes the voltages on the signal lines relative to the signal
ground line to reflect the true voltage of the signal and thus canceling out the effect of
any noise signals.
Baud Rate

Shielded Cable Length

Unshielded Cable Length

110

5000

1000

300

4000

1000

1200

3000

500

2400

2000

500

4800

500

250

9600

250

100

Gender Changers
A problem you may encounter is having two connectors of the same gender that must
be connected. You can purchase gender changers at any computer or office supply
store for under $5.
Note: The parallel port on a PC uses a 25 pin female connector which sometimes
causes confusion because it looks just like a serial port except that it has the wrong
gender. Both 9 and 25 pin serial ports on a PC will always have a male connector.
Null Modem Cables and Null Modem Adaptors
If you connect two DTE devices (or two DCE devices) using a straight RS232 cable,
then the transmit line on each device will be connected to the transmit line on the other
device and the receive lines will likewise be connected to each other. A Null Modem
cable or Null Modem adapter simply crosses the receive and transmit lines so that
transmit on one end is connected to receive on the other end and vice versa. In addition
to transmit and receive, DTR & DSR, as well as RTS & CTS are also crossed in a Null
modem connection.

Synchronous and Asynchronous Communications


There are two basic types of serial communications, synchronous and asynchronous.
With Synchronous communications, the two devices initially synchronize themselves to
each other, and then continually send characters to stay in sync. Even when data is not
really being sent, a constant flow of bits allows each device to know where the other is
at any given time. That is, each character that is sent is either actual data or an idle
character. Synchronous communications allows faster data transfer rates than
asynchronous methods, because additional bits to mark the beginning and end of each
data byte are not required. The serial ports on IBM-style PCs are asynchronous devices
and therefore only support asynchronous serial communications.
Asynchronous means "no synchronization", and thus does not require sending and
receiving idle characters. However, the beginning and end of each byte of data must be
identified by start and stop bits. The start bit indicate when the data byte is about to
begin and the stop bit signals when it ends. The requirement to send these additional
two bits cause asynchronous communications to be slightly slower than synchronous
however it has the advantage that the processor does not have to deal with the
additional idle characters.
An asynchronous line that is idle is identified with a value of 1, (also called a mark
state). By using this value to indicate that no data is currently being sent, the devices
are able to distinguish between an idle state and a disconnected line. When a character
is about to be transmitted, a start bit is sent. A start bit has a value of 0, (also called a
space state). Thus, when the line switches from a value of 1 to a value of 0, the receiver
is alerted that a data character is about to come down the line.
RS232 is a asynchronous serial communication protocol widely used in computers and
digital systems. It is called asynchronous because there is no separate synchronizing
clock signal as there are in other serial protocols like SPI and I2C. The protocol is such
that it automatically synchronize itself. We can use RS232 to easily create a data link
between our MCU based projects and standard PC. Excellent example is a commercial
Serial PC mouse (not popular these days, I had got one with my old PC which I bought
in year 2000 in those days these were famous). You can make a data loggers that
reads analog value(such as temperatures or light using proper sensors) using the ADC
and send them to PC where a special program written by you shows the data using nice
graphs and charts etc.. actually your imagination is the limit!

In RS232 there are two data lines RX and TX. TX is the wire in which data is sent out to
other device. RX is the line in which other device put the data it need to sent to the
device.

Fig- RS232 transmission. The arrows indicates the direction of data transfer. In
addition to RX/TX lines there is a third line i.e. Ground (GND) or Common.

One more thing about RS232. We know that a HIGH =+5v and LOW=0v in TTL / MCU
circuits but in RS232 a HIGH=-12V and LOW=+12V. Ya this is bit weird but it increases
the range and reliability of data transfer. Now you must be wondering how to interface
this to MCUs who understand only 0 and 5v? But you will be very happy to know that
there is a very popular IC which can do this for you! It is MAX232 from Maxim
Semiconductors. I will show you how to make a level converter using MAX232 in next
tutorial.
As there is no "clock" line so for synchronization accurate timing is required so
transmissions are carried out with certain standard speeds. The speeds are measured
in bits per second. Number of bits transmitted is also known as baud rate. Some
standard baud rates are
1200
2400
4800
9600
19200
38400
57600
115200
... etc
For our example for discussion of protocol we chose the speed as 9600bps (bits per
second). As we are sending 9600 bits per second one bits takes 1/9600 seconds or
0.000104 sec or 104 uS (microsecond= 10^-6 sec).
To transmit a single byte we need to extra bits they are START BIT AND STOP
BIT(more about them latter). Thus to send a byte a total of ten bits are required so we
are sending 960 bytes per second.
Note: The number of stop bits can be one or two (for simplicity we will be using
single stop bit)
There is one more bit the parity bit but again for simplicity we would not be using it)

RS232 Data Transmission.


The data transfer is done in following ways

Transmission
1. When there is no transmission the TX line sits HIGH (-12V See above para) ( STOP
CONDITION )
2. When the device needs to send data it pulls the TX line low for 104uS (This is the start bit
which is always 0)
3. then it send each bits with duration = 104uS
4. Finally it sets TX lines to HIGH for at least 104uS (This is stop bits and is always 1). I said
"at least" because after you send the stop bit you can either start new transmission by
sending a start bit or you let the TX line remain HIGH till next transmission begin in this
case the last bit is more than 104uS.

RS232 Data Reception


1.
2.
3.
4.
5.

The receiving device is waiting for the start bit i.e. the RX line to go LOW (+12V see above para).
When it gets start bit it waits for half bit time i.e. 104/2 = 51uS now it is in middle of start bit it reads it again to
make sure it is a valid start bit not a spike.
Then it waits for 104uS and now it is in middle of first bit it now reads the value of RX line.
In same way it reads all 8 bits
Now the receiver has the data.

The RS-232 protocol defines two signal levels, called a "mark" and a "space" (terms
that date back to the early days of telegraphy). In digital logic terms, a "mark" is a
logic HI while a "space" is a logic LO. To transmit a mark the transmitter outputs a
voltage between -5V and -15V. To output a space, the transmitter outputs a voltage
between +5V and +15V. The receiver, in order to provide a 2V noise margin,
recognizes any signal less than -3V as a mark and any signal greater than +3V as a
space.

Interfata Seriala RS232


Protocolul de transmisie RS232 a fost dezvoltat original pentru transmisia de date pe
linia telefonica. A fost definit ca bytii de date 8-bit sunt transmisi. In plus, la inceput un
bit de start este trimis care marcheaza inceputul unui byte de date. La sfarsitul byte-ului
este trimis un bit de stop, in plus. Asta inseamna ca in total sunt trimisi 10 biti. Nivelul de
tensiune al unui bit de start si al unuia de stop este de asemenea definit, de acees bitii
trimisi de user sunt cu siguranta detectati. Pentru transmiterea datelor de la user a fost
definit codul ASCII (American Standard Code of Information Interchange) astfel ca
informatia sa fie universala si independenta de tipul teminalelor de date. Interfata este
realizata pentru manevrarea si utilizarea modemurilor (Modulator / Demodulator) si
contine niste semnale speciale in acest scop. Totusi, aplicatii de genul celor de testare
a automobilelor care folosesc de asemenea o interfata RS232, nu necesita aceste
semnale specifice modemurilor. Pentru acest echipament este suficienta utilizarea
semnalelor RD, TD si GND (Masa). Aceste semnale sunt explicate aici in detaliu.

RS232 Glosar
DCE = Echipament de Comunicatii de Date (Data Communications Equipment)DCE.
Aceasta este o alta denumire pentru modem. Acesta este un dispozitiv care transforma
datele in asa fel incat sa poata fi transmise pe linie telefonica. Echipamentele de
Comunicatii de Date (de ex. modemuri si convertoare de nivel) sunt dispozitive care
transmit si receptioneaza semnale si le canalizeaza spre alte echipamente fara a le
procesa.
DTE = Echipament Terminal de Date (Data Terminal Equipment). Acesta poate fi de
ex. un terminal de computer al unui sistem mainframe, care este de fapt originea
acestei denumiri. Poate fi o imprimanta, un ploter sau un PC, etc. Echipamentele
Terminale de Date sunt dispozitive care transmit si / sau receptioneaza date si le
proceseaza fara a le retransmite mai departe la alt echipament.
Null Modem = Aceasta expresie defineste un cablu de conexiune RS232 intre doua
DTE, care folosesc acest protocol de transmisie fara a folosi modemuri. Acesta este de

ex. cazul cand o imprimanta seriala este conectata la un PC. Lungimea cablului, totusi,
este limitata la 10 metri. Exista amplificatoare disponibile care pot fi conectate intre
cabluri si astfel permite o lungime mult mai mare a cablului. Cum nu sunt folosite
modemuri, este necesara conectarea semnalelor specifice modem intr-un anumit fel
pentru a simula prezenta unui modem. Detaliile conectarii firelor sunt date mai jos.

RS232 Descrierea Semnalelor


RD/RX = Receptie date. Pe acest fir se primesc bitii de date de la terminalul de date
(DTE).
TD/TX = Transmisie date. Pe acest fir sunt transmisi bitii de date catre terminalul de
date (DTE).
CHS GND = Masa Comuna. Terminalul de date si modemul trebuie sa aiba o masa
comuna pentru prevenirea buclelor de masa.
DSR = Data Set Ready. Acest semnal este generat de catre modem si inseamna ca
modemul este activ si pregatit sa comunice cu terminalul de date.
DTR = Data Terminal Ready. Acest semnal este generat de terminalul de date si
transmis catre modem si insemna ca terminalul de date este activ si pregatit sa
comunice cu modemul.
DCD/CD = Data Carrier Detect sau Carrier Detect. Acest semnal arata ca modemurile
de la ambele capete sunt conectate pe linia telefonica si sunt pregatite sa faca schimb
de date.
RTS = Cerere de Transmisie. Acest semnal este generat de terminalul de date si
inseamna ca terminalul doreste sa transmita date.
CTS = Permisiune (Liber) de Transmisie. Acesta este semnalul raspuns de la modem
catre terminalul de date (urmand un RTS) si semnaleaza ca modemul este pregatit sa
receptioneze date de la terminalul de date si sa le transforme pentru formatul liniei
telefonice.
SIG GND = Semnal Masa. Aceasta masa este masa de referinta pentru toate
semnalele. In functie de echipament, acesta poate fi o masa separata sau poate fi
conectata la masa comuna.
RI = Ring Indicator. Este un semnal de la modem catre terminalul de date care arata
ca vine un semnal telefonic extern pe linia telefonica. De.ex. "suna" telefonul. In functie
de aplicatie, repectorul este "ridicat". Numarul de ringuri pana la ridicare poate fi setat in
modem.

RS232 Asignarea Pinilor


Vedere asupra unui conector mama pe 25 de pini D-SUB (mufa)
+-------------------------------------+
\ 13 O O O O O O O O O O O O O 1
/
\ 25 O O O O O O O O O O O O 14 /
+------------------------------+
Vedere asupra unui conector tata pe 25 de pini D-SUB (stecher)
+-------------------------------------+
\
1 + + + + + + + + + + + + + 13 /
\ 14 + + + + + + + + + + + + 25 /
+------------------------------+
Vedere asupra unui conector mama pe 9 pini D-SUB (mufa)
+-------------------+
\ 5 O O O O O 1 /
\ 9 O O O O 6 /
+------------+
Vedere asupra unui conector tata pe 9 pini D-SUB (stecher)
+-------------------+
\ 1 + + + + + 5 /
\ 6 + + + + 9 /
+------------+
Nume
Functie
Semnal

Directie
D-SUB
D-SUB
PC (DTE) < > pe 25 de pe
9
DCE
pini
pini

GND

Masa - Comuna

<>

TxD

Transmisie Date

>

RxD

Receptie Date

<

RTS

Cerere de Transmisie

>

CTS

Permisiune de Transmisie

<

DSR

Data Set Ready

<

GND

Semnal - Masa

<>

DCD

Data Carrier Detect

<

DTR

Data Terminal Ready

>

20

RI

Ring Indicator

<

22

9,
11,
12,
14,
15,
17,
18,
21,
23,
25

Nefolosit

10,
13,
16,

19,
24,

Asignarea pinilor din acest tabel poate fi folosita ca si schematica de legare a firelor
pentru un adaptor intre doua tipuri de conectoare.

RS232 Transmisia Datelor Trei Fire (Conexiune Minimala) intre


DTE (de. ex. PC) si DCE (de. ex. modem)
DTE
DCE
+------------+
+------------+
| TxD
| 2 |-----------------| 2 |
TxD |
+------------+
+------------+
| RxD
| 3 |-----------------| 3 |
RxD |
+------------+
+------------+
| RTS
| 4 |
| 4 |
RTS |
+------------+
+------------+
| CTS
| 5 |
| 5 |
CTS |
+------------+
+------------+
| DSR
| 6 |
| 6 |
DSR |
+------------+
+------------+
| GND
| 7 |-----------------| 7 |
GND |
+------------+
+------------+
| DCD
| 8 |
| 8 |
DCD |
+------------+
+------------+
| DTR
| 20 |
| 20 |
DTR |
+------------+
+------------+

Trei Fire (Conexiune Minimala) intre DTE (de. ex. PC) si DTE (de. ex.
Plotter)
DTE
DTE
+------------+
+------------+
| TxD
| 2 |-------\ /------| 2 |
TxD |
+------------+
X
+------------+
| RxD
| 3 |-------/ \------| 3 |
RxD |
+------------+
+------------+
| RTS
| 4 |
| 4 |
RTS |
+------------+
+------------+
| CTS
| 5 |
| 5 |
CTS |
+------------+
+------------+
| DSR
| 6 |
| 6 |
DSR |
+------------+
+------------+
| GND
| 7 |-----------------| 7 |
GND |
+------------+
+------------+
| DCD
| 8 |
| 8 |
DCD |
+------------+
+------------+
| DTR
| 20 |
| 20 |
DTR |
+------------+
+------------+

Pentru a obtine o transmisie de date sigura via unei conexiuni pe trei fire ar trebui
folosita o metoda in care blocuri de date sunt transmise si un checksum este calculat
pentru fiecare bloc. O alta posibilitate ar fi utilizarea unui "software handshake" cu
protocolul Xon (ASCII: 11h) / Xoff (ASCII: 13h).

Conexiune Full (cu Hardware-Hand-Shake) intre DTE (de. ex. PC) si


DCE (de. ex. Modem)
DTE
DCE
+------------+
+------------+
| TxD
| 2 |-----------------| 2 |
TxD |
+------------+
+------------+
| RxD
| 3 |-----------------| 3 |
RxD |
+------------+
+------------+
| RTS
| 4 |-----------------| 4 |
RTS |
+------------+
+------------+
| CTS
| 5 |-----------------| 5 |
CTS |
+------------+
+------------+
| DSR
| 6 |-----------------| 6 |
DSR |
+------------+
+------------+
| GND
| 7 |-----------------| 7 |
GND |
+------------+
+------------+
| DCD
| 8 |-----------------| 8 |
DCD |
+------------+
+------------+
| DTR
| 20 |-----------------| 20 |
DTR |
+------------+
+------------+

RS232 Null Modem


Aceasta este o conexiune full (cu Hardware-Hand-Shake) intre DTE (de. ex. PC) si DTE
(de. ex. plotter). Toti ceilalti pini nu sunt folositi. Acest cablu poate fi de asemenea
folosit la conectarea a doua PC-uri pentru schimb de date (cablu interlink WIN98 /
WIN95)
DTE
DTE
+------------+
+------------+
| TxD
| 2 |-------\ /-------| 2 |
TxD |
+------------+
X
+------------+
| RxD
| 3 |-------/ \-------| 3 |
RxD |
+------------+
+------------+
| RTS
| 4 |-------\ /-------| 4 |
RTS |
+------------+
X
+------------+
| CTS
| 5 |-------/ \-------| 5 |
CTS |
+------------+
+------------+
| DSR
| 6 |-----\
/-----| 6 |
DSR |
+------------+
\
/
+------------+
| GND
| 7 |-----------------| 7 |
GND |
+------------+
X
+------------+
| DCD
| 8 |-----------------| 8 |
DCD |
+------------+
/
\
+------------+
| DTR
| 20 |-----/
\-----| 20 |
DTR |
+------------+
+------------+
Iata inca un tabel cu folosirea conectorilor pe 9 pini
DB25

DB-9

Semnale

<--->

Xmit-Recv data

<--->

Recv-Xmit data

<--->

RTS-CTS

<--->

CTS-RTS

1&6

<--->

20

DSR-DTR

<--->

Gnd-Gnd

DB-9

DB-25

20

<--->

1&6

DTR-DSR

Conexiunea Simplificata Null Modem


DTR la DSR si DCD ale propriei interfete. DTR este setat daca terminalul de date
este pornit si pregatit. Acest semnal genereaza acum semnalul DSR care simuleaza
catre terminalul de date ca modemul este pregatit. Aditional, semnalul DTS este
conectat la intrarea DCD a interfetei, care simuleaza catre terminalul de date ca
modemul este conectat la modemul partenerului de comunicatie si ca datele pot fi
transmise.
RTS la CTS al propriei interfete. Daca terminalul de date vrea sa transmita un byte,
seteaza semnalul RTS si asteapta ca raspuns de la modem semnalul CTS. Daca ambii
pini sunt conectati se simuleaza catre interfata DTE ca datele pot fi trensmise.
TD la RD al partenerului de comunicatie. Linia de transmisie a primului echipament
de comunicatie trebuie sa fie conectata sa receptioneze linia de la al doilea echipament
de comunicatie si vice-versa. Aditional, semnalul masa si masa comuna trebuie sa fie
conectate intre cele doua statii.

Asignarea Pinilor pentru Null Modem Simplificat


Imprimanta / Plotter cu
Conector pe 25 de pini DSub

PC cu Conector pe 25 de PC cu Conector pe 9 pini


pini D-Sub
D-Sub
5 (CTS)

8 (CTS)

---->

6 to 8 to 20 (DTR/DSR/CD)

3 (RD)

2 (RD)

<----

2 (TD)

2 (TD)

3 (TD)

---->

3 (RD)

7 (SIG GND)

5 (SIG GND)

<--->

7 (SIG GND)

6 la 8 la 20 (DTR/DSR/CD)
Conectate
in
interiorul
propriului conector, fara vreo
conexiune
catre
celalalt
partener de comunicatie!

1 la 4 la 6 (DTR/DSR/CD)
Conectate
in
interiorul
propriului conector, fara vreo
conexiune
catre
celalalt
partener de comunicatie!

4 la 5 (RTS la CTS)
Conectate
in
interiorul
propriului conector, fara vreo
conexiune
catre
celalalt
partener de comunicatie!

Anda mungkin juga menyukai