ConceptConcept ofof SerialSerial CommunicationCommunication AgendaAgenda

ƒ Serial v.s. Parallel ƒ Simplex , Half Duplex , Full Duplex Communication ƒ RS-485 Advantage over RS-232 SerialSerial v.s.v.s. ParallelParallel Application: How to Measure the temperature in a long distance?

Measuring with a DAC card:

1200 m

Remote sensor Control room

T/C wire T/C A/D

noise 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… Noise rejection (Differential signal) MostMost PopularPopular 33 typestypes ofof SerialSerial Comm.Comm.

z Most commonly available Tx Rx Rx Tx z Simple wiring CTS RTS z Low cost RTS CTS RS-232 z Short length (40 ft) DTR DSR DSR DTR Bar code reader z Slow rates GND GND z Subject to noise

Tx+ z High data rates Tx- z Longer cable lengths (4000 ft) Rx+ Rx- RS-422 z Full-duplex GND z Noise rejection PLC

z Multipoint application (Up to 32 units) z Low cost Data+ z Longer cable lengths (4000 ft) Data- RS-485 zNoise immunity GND zHalf-duplex PLC SerialSerial V.S.V.S. ParallelParallel CommunicationCommunication ƒ 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 Send Data Receive Data SimplexSimplex ,, HalfHalf DuplexDuplex ,, FullFull DuplexDuplex CommunicationCommunication SimplexSimplex CommunicationCommunication

ƒ 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 , or

Simplex Channel Operation

One way only Half-DuplexHalf-Duplex CommunicationCommunication

ƒ 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 Full-DuplexFull-Duplex CommunicationCommunication

ƒ 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, that‘s full duplex! – All examples of full-duplex are RS-232, RS-422, telephone Full-Duplex Operation

Both Way at the same time RS-485RS-485 AdvantageAdvantage overover RS-232RS-232 RS-232RS-232 CommunicationCommunication

ƒ Full-Duplex Operation ƒ No 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 of the PC and peripherals

Single-Ended Tx Single-Ended Driver Receiver

signal

Rx RS-232RS-232 PinPin AssignmentAssignment

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

25 pin 9 pin Signal Direction Description 1 - Shield - protection ground 13 25 2 3 TD DTE → DCE transmitted data 12 24 11 3 2 RD DCE → DTE received data 23 10 4 7 RTS DTE → DCE request to send 22 9 5 8 CTS DCE → DTE clear to send 5 21 9 8 6 6 DSR DCE → DTE data set ready 4 20 8 7 7 5 GND - signal ground (common) 3 19 7 6 2 18 8 1 DCD DCE → DTE data carrier detect 6 5 1 17 20 4 DTR DTE → DCE data terminal ready 4 16 22 9 RI DCE → DTE ring indicator 3 15 2 23 - DSRD DCE ↔ DTE data signal rate detector 14 1 DCE : Data Carrier Equipment (Modem) DTE : Data Terminal Equipment (PC’s COMport)

RS-232RS-232 Hand-ShakingHand-Shaking WiringWiring

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

Transfer Data with handshaking Signal Pin Pin Signal TX 3 3 TX RX 2 2 RX RTS 7 7 RTS CTS 8 8 CTS DSR 6 6 DSR CD 1 1 CD DTR 4 4 DTR GND 5 5 GND RS-232RS-232 ApplicationApplication

ƒ The Application for RS-232 1. PC’s and Laptops 2. Point of Sales Equipment (POS) 3. PDA’s and GPS’s 4. PC Peripherals (printers, , mouse,…..) 5. Barcode Reader RS-485RS-485 CommunicationCommunication

ƒ 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 Differential Driver Twisted-pair Receiver

Signal Voltage

Twist Pair: to reduce the electromagnetic interference

VCM RS-485RS-485 CommunicationCommunication

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

DATA+ (Y)

Host Rt Rt RS-485 DATA- (G)

Local Power Supply+ +Vs(R) - power +10 to +30 VDC GND(B) Y RGY supply GY

R G B RS-485RS-485 Multi-dropMulti-drop NetworkNetwork andand TerminationTermination

Terminal Resistor: To decrease the distortion of the signal

RT repeater RT

RX RX RX RX TX TX TX TX

Device 0 Device 31 Device 0 Device 31

32 driver / receiver 32 driver / receiver RS-485RS-485 ApplicationApplication

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

PLC Temperature AC Power Controller Monitor RS-422RS-422 CommunicationCommunication

ƒ The electrical spec. is similar to RS-485 protocol ƒ Key difference – 1 driver only can connect up to 10 receivers – Full-Duplex RS-422/485RS-422/485 PinPin AssignmentAssignment

Pin RS-422 RS-485 Pin RS-422 RS-485 1 TxD- Data- 2RxD+ 13 25 2 TxD+ Data+ 12 3 TxD+ Data+ 24 11 23 3RxD+ 10 4RTS+ 22 5 9 9 21 4 8 8 4RxD- 20 5CTS- 3 7 7 19 2 6 6 5GNDGND 18 6RTS- 1 5 17 4 6RTS- 16 7GNDGND 3 15 2 14 7RTS+ 1 8 TxD- Data- 8CTS+ 20 RxD- 9CTS- 22 CTS- RS-232RS-232 V.S.V.S. RS-422/485RS-422/485

Protocol 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 115.2Kbps 10Mbps 10Mbps Transfer Rate Transmission Full-Duplex Full-Duplex Half-Duplex Mode Point to Point Point to Point Multi-Drop QQ && AA Thanks~~~