Concept of Serial Communication -...

25
Concept of Serial Communication Concept of Serial Communication

Transcript of Concept of Serial Communication -...

Page 1: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Concept of Serial Communication

Concept of Serial Communication

Page 2: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

AgendaAgenda

Serial v.s. ParallelSimplex , Half Duplex , Full Duplex CommunicationRS-485 Advantage over RS-232

Page 3: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Serial v.s. ParallelSerial v.s. Parallel

Page 4: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

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

Remote sensor

T/C

Control room

A/DT/C wire

noise

1200 m

Measuring with a DAC card:

Page 5: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

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

Measuring with a remote I/O module:

Remote sensor

T/C

Control room

Remote I/O

Noise rejection (Differential signal)

Standard T/C signal,

4-20mA,0-5V…

Serial Communication

1200 m

Page 6: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Most Popular 3 types of Serial Comm.Most Popular 3 types of Serial Comm.

TxTxRxRx

CTSCTSRTSRTSDTRDTRDSRDSRGNDGND

RxRxTxTx

RTSRTSCTSCTSDSRDSRDTRDTRGNDGND

TxTx++TxTx--

Rx+Rx+RxRx--

GNDGND

Data+Data+

DataData--

GNDGND

RSRS--232232

RSRS--422422

RSRS--485485

Most commonly availableSimple wiringLow costShort length (40 ft)Slow data ratesSubject to noise

High data ratesLonger cable lengths (4000 ft)Full-duplexNoise rejection

Multipoint application (Up to 32 units)Low costLonger cable lengths (4000 ft)

Noise immunityHalf-duplex

Bar code readerBar code reader

PLCPLC

PLCPLC

Page 7: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Serial V.S. Parallel CommunicationSerial V.S. Parallel CommunicationSerial CommunicationTransfer the data bit by bitSynchronous Data Transfer

Parallel CommunicationTransfer the all data simultaneouslyAsynchronous Data Transfer

Send Data Receive Data

BitBitBitBitBitBitBitBit

BitBitBitBitBitBitBitBit

Receive DataSend Data

Page 8: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Simplex , Half Duplex , Full Duplex Communication

Simplex , Half Duplex , Full Duplex Communication

Page 9: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Simplex CommunicationSimplex 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 erroror control signals to the transmit end.

– The examples of simplex are broadcasting, or Radio

One way only

Simplex Channel OperationSimplex Channel Operation

Page 10: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Half-Duplex CommunicationHalf-Duplex CommunicationHalf 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

Two way but not at the same time

HalfHalf--Duplex OperationDuplex Operation

Page 11: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Full-Duplex CommunicationFull-Duplex CommunicationFull 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, that‘s full duplex!

– All examples of full-duplex are RS-232, RS-422, telephone

Both Way at the same time

FullFull--Duplex OperationDuplex Operation

Page 12: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-485 Advantage over RS-232RS-485 Advantage over RS-232

Page 13: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-232 CommunicationRS-232 CommunicationFull-Duplex OperationNo noise rejection (single-ended)Short transmission distance (within 15m)Low transmission speed (within 115.2kbps)Protocol

1. Point-to-point : Handle communication between 2 devices.2. Unbalanced lines (Single-ended.) : Signal applied to one line and referenced to ground.3. Most common use as a communication device for a Serial port of the PC and peripherals

signal

Single-EndedDriver

Single-EndedReceiver

Tx

Rx

Page 14: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-232 Pin AssignmentRS-232 Pin Assignment

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

25 pin 9 pin Signal Direction Description 1 - Shield - protection ground 2 3 TD DTE → DCE transmitted data 3 2 RD DCE → DTE received data 4 7 RTS DTE → DCE request to send 5 8 CTS DCE → DTE clear to send 6 6 DSR DCE → DTE data set ready 7 5 GND - signal ground (common) 8 1 DCD DCE → DTE data carrier detect 20 4 DTR DTE → DCE data terminal ready 22 9 RI DCE → DTE ring indicator 23 - DSRD DCE ↔ DTE data signal rate detector

DCE : Data Carrier Equipment (Modem) DTE : Data Terminal Equipment (PC’s COMport)

9

8

7

6

5

4

3

2

1

25

24

23

22

21

20

19

18

17

16

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

Page 15: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-232 Hand-Shaking WiringRS-232 Hand-Shaking WiringTransfer Data with no handshaking

Signal Pin

TXRX

GND

325

SignalPin

TXRX

GND

325

Signal Pin

TXRXRTSCTSDSRCD

DTRGND

32786145

SignalPin

TXRXRTSCTSDSRCD

DTRGND

32786145

Transfer Data with handshaking

Page 16: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-232 ApplicationRS-232 Application

The Application for RS-2321. PC’s and Laptops2. Point of Sales Equipment (POS)3. PDA’s and GPS’s4. PC Peripherals (printers, faxes, mouse,…..)5. Barcode Reader

Page 17: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-485 CommunicationRS-485 Communication

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

DifferentialDriver

DifferentialReceiver

SignalVoltage

Twisted-pair

VCM

Twist Pair: to reduce the electromagnetic interference

Page 18: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-485 CommunicationRS-485 Communication

Save the wiring costEasy to setup and maintainCommunication is more reliable

BR G

Y RGY GY

HostRS-485

Power Supply+10 to +30 VDC

DATA+ (Y)

+Vs(R)

GND(B)

DATA- (G)Rt Rt

Local power supply

+-

Page 19: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-485 Multi-drop Network and TerminationRS-485 Multi-drop Network and Termination

RXTX

RXTX

repeater

RXTX

RXTX

Device 0 Device 31 Device 0 Device 31

32 driver / receiver

RT RT

32 driver / receiver

Terminal Resistor: To decrease the distortion of the signal

Page 20: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-485 ApplicationRS-485 Application

Typical RS-485 Applications1. Point of Sales Equipment ( ex. Remote price checker,….)2. Control System Automation (ex. PLC,….)3. Power/Gas Meters

PLC Temperature Controller

AC Power Monitor

Page 21: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-422 CommunicationRS-422 CommunicationThe electrical spec. is similar to RS-485 protocolKey difference

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

Page 22: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

RS-422/485 Pin AssignmentRS-422/485 Pin Assignment

Pin RS-422 RS-485

1 TxD- Data-

2 TxD+ Data+

3 RxD+

4 RxD-

5 GND GND

6 RTS-

7 RTS+

8 CTS+

9 CTS-

9

8

7

6

5

4

3

2

1

25

24

23

22

21

20

19

18

17

16

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

Pin RS-422 RS-485

2 RxD+

3 TxD+ Data+

4 RTS+

5 CTS-

6 RTS-

7 GND GND

8 TxD- Data-

20 RxD-

22 CTS-

Page 23: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

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

Signal Single-Ended Differential Differential

Driving No. 1 10 32

Receiving No. 1 10 32

Distance 15m 1200m 1200m

Max. Data Transfer Rate

115.2Kbps 10Mbps 10Mbps

Transmission Mode

Full-DuplexPoint to Point

Full-DuplexPoint to Point

Half-DuplexMulti-Drop

Page 24: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Q & AQ & A

Page 25: Concept of Serial Communication - …advdownload.advantech.com/productfile/Downloadfile5/EI-6W4E0/02... · Simplex , Half Duplex , Full Duplex Communication ... Most common use as

Thanks~~~