Vous êtes sur la page 1sur 24

Concept of Serial Communication

Hoang Van Informatics Technology Co., Ltd. www.hoangvanco.com.vn

Agenda

Serial v.s. Parallel Simplex , Half Duplex , Full Duplex Communication RS-485 Advantage over RS-232

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Serial v.s. Parallel

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Application: How to Measure the temperature in a long distance?


Measuring with a DAC card:
1200 m

Remote sensor

Control room

T/C

T/C wire A/D

noise

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Application: How to Measure the temperature in a long distance?


Measuring with a remote I/O module:
1200 m

Remote sensor

Control room

T/C
Remote I/O

Standard T/C signal, 4-20mA, 0-5V

Serial Communication Noise rejection (Differential signal)

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Most Popular 3 types of Serial Comm.


Most commonly available Simple wiring Low cost Short length (40 ft) Slow data rates Subject to noise

Tx Rx CTS RTS DTR DSR GND Rx Tx RTS CTS DSR DTR GND

RS-232

Bar code reader

RS-422

High data rates Longer cable lengths (4000 ft) Full-duplex Noise rejection

Tx+ TxTxRx+ RxRxGND

PLC Multipoint application (Up to 32 units) Low cost Longer cable lengths (4000 ft) Noise immunity Half-duplex

Data+ DataDataGND

RS-485

PLC

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Serial V.S. Parallel Communication

Serial Communication
Transfer the data bit by bit Synchronous Data Transfer

Bit Send Data

Receive Data

Parallel Communication
Transfer the all data simultaneously Asynchronous Data Transfer

Bit Bit Bit Bit Bit Bit Bit Bit


HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

Send Data

Receive Data
www.hoangvanco.com.vn

Simplex , Half Duplex , Full Duplex Communication

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Simplex Communication

Simplex Communication :

Data in a simplex channel is always one way. Simplex channels are not often used because it is not possible to send back error or control signals to the transmit end. The examples of simplex are broadcasting, or Radio

Simplex Channel Operation

One way only

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Half-Duplex Communication

Half Duplex Communication :

A half-duplex channel can send and receive, but not at the same time. It's like a one-lane bridge where two way traffic must give way in order to cross. Only one end transmits at a time, the other end receives. Another examples of half-duplex are talk-back radio , RS-485

Half-Duplex Operation

Two way but not at the same time

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Full-Duplex Communication

Full Duplex Communication

Data can travel in both directions simultaneously. There is no need to switch from transmit to receive mode like in half duplex. Its like a two lane bridge on a two-lane highway. Have you ever watched these television talk shows where the host has a number of people on the show, and they all try to talk at once. Well, thats full duplex! All examples of full-duplex are RS-232, RS-422, telephone

Full-Duplex Operation

Both Way at the same time

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-485 Advantage over RS-232

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-232 Communication

1. 2. 3.

Full-Duplex Operation No noise rejection (single-ended) Short transmission distance (within 15m) Low transmission speed (within 115.2kbps) Protocol
Point-to-point : Handle communication between 2 devices. Unbalanced lines (Single-ended.) : Signal applied to one line and referenced to ground. Most common use as a communication device for a Serial port of the PC and peripherals
Single-Ended Driver

Tx

Single-Ended Receiver

signal

Rx
HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.
www.hoangvanco.com.vn

RS-232 Pin Assignment

Layouts and signals of DB25 and DB9 connector (RS-232)


25 pin 9 pin 1
13

Signal Shield TD RD RTS CTS DSR GND DCD DTR RI DSRD

Direction DTE DCE DCE DTE DTE DCE DCE DTE DCE DTE DCE DTE DTE DCE DCE DTE DCE DTE

Description protection ground transmitted data received data request to send clear to send data set ready signal ground (common) data carrier detect data terminal ready ring indicator data signal rate detector
9 8 7 6 5 4 3 2 1

3 2 7 8 6 5 1 4 9 -

25 24 23 22 21 20 19 18 17 16 15 14

12 11 10 9 8 7 6 5 4 3 2 1

2 3 4 5 6 7 8 20 22 23

DCE : Data Carrier Equipment (Modem) DTE : Data Terminal Equipment (PCs COMport)

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-232 Hand-Shaking Wiring


Transfer Data with no handshaking
Signal TX RX GND Pin 3 2 5 Pin 3 2 5 Signal TX RX GND

Transfer Data with handshaking


Signal TX RX RTS CTS DSR CD DTR GND Pin 3 2 7 8 6 1 4 5
HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

Pin 3 2 7 8 6 1 4 5

Signal TX RX RTS CTS DSR CD DTR GND

www.hoangvanco.com.vn

RS-232 Application

1. 2. 3. 4. 5.

The Application for RS-232


PCs and Laptops Point of Sales Equipment (POS) PDAs and GPSs PC Peripherals (printers, faxes, mouse,..) Barcode Reader

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-485 Communication

Half-Duplex Operation Noise rejection and cross wire (Differential) Long transmission distance (Up to 1200m) High transmission speed (Up to 10Mbps ) Auto-Flow Control
Differential Driver

Twisted-pair
Signal Voltage

Differential Receiver

Twist Pair: to reduce the electromagnetic interference VCM

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-485 Communication

Save the wiring cost Easy to setup and maintain Communication is more reliable

DATA+ (Y)

Host RS-485

Rt DATA- (G)

Rt

Power Supply +Vs(R) + +10 to +30 VDC- GND(B) Y RG B RGY

Local power supply

GY

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-485 Multi-drop Network and Termination

Terminal Resistor: To decrease the distortion of the signal


RT

repeater

RT

RX

TX

RX

TX

RX

TX

RX

TX

Device 0

Device 31

Device 0

Device 31

32 driver / receiver

32 driver / receiver

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-485 Application

1. 2. 3.

Typical RS-485 Applications


Point of Sales Equipment ( ex. Remote price checker,.) Control System Automation (ex. PLC,.) Power/Gas Meters

PLC

Temperature Controller

AC Power Monitor

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-422 Communication

The electrical spec. is similar to RS-485 protocol Key difference


1 driver only can connect up to 10 receivers Full-Duplex

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-422/485 Pin Assignment


Pin RS-422 RS-485 1 2 3
5 9 8 7 6 4 3 2 1

Pin RS-422 RS-485 2


13 25 24 12 11 10 9 8 7 6 5 4 3 2 1

TxDTxD+ RxD+ RxDGND RTSRTS+ CTS+ CTS-

DataData+

RxD+ TxD+ RTS+ CTSRTSGND TxDRxDCTSGND DataData+

3 4 5 6 7 8 20 22

23 22 21 20

4 5 6 7 8 9

GND

19 18 17 16 15 14

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

RS-232 V.S. RS-422/485


Protocol Signal Driving No. Receiving No. Distance Max. Data Transfer Rate Transmission Mode RS-232 Single-Ended 1 1 15m 115.2Kbps Full-Duplex Point to Point RS-422 Differential 10 10 1200m 10Mbps Full-Duplex Point to Point RS-485 Differential 32 32 1200m 10Mbps Half-Duplex Multi-Drop

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Q&A

HOANG VAN INFORMATICS TECHNOLOGY CO., LTD.

www.hoangvanco.com.vn

Vous aimerez peut-être aussi