Showing posts with label Serial. Show all posts
Showing posts with label Serial. Show all posts

Wednesday, August 25, 2010

Difference between RS232 & RS485

SPECIFICATIONSRS232RS423RS422RS485
Mode of OperationSINGLE
-ENDED
SINGLE
-ENDED
DIFFERENTIALDIFFERENTIAL
Total Number of Drivers and Receivers on One Line (One driver active at a time for RS485 networks)1 DRIVER
1 RECVR
1 DRIVER
10 RECVR
1 DRIVER
10 RECVR
32 DRIVER
32 RECVR
Maximum Cable Length50 FT.4000 FT.4000 FT.4000 FT.
Maximum Data Rate (40ft. - 4000ft. for RS422/RS485)20kb/s100kb/s10Mb/s-100Kb/s10Mb/s-100Kb/s
Maximum Driver Output Voltage+/-25V+/-6V-0.25V to +6V-7V to +12V
Driver Output Signal Level (Loaded Min.)+/-5V to +/-15V+/-3.6V+/-2.0V+/-1.5V
Driver Output Signal Level (Unloaded Max)+/-25V+/-6V+/-6V+/-6V
Driver Load Impedance (Ohms)3k to 7k>=45010054
Max. Driver Current in High Z State (Power ON)N/AN/AN/A+/-100uA
Max. Driver Current in High Z State (Power OFF)+/-6mA @ +/-2v+/-100uA+/-100uA+/-100uA
Slew Rate (Max.)30V/uSAdjustableN/AN/A
Receiver Input Voltage Range+/-15V+/-12V-10V to +10V-7V to +12V
Receiver Input Sensitivity+/-3V+/-200mV+/-200mV+/-200mV
Receiver Input Resistance (Ohms), (1 Standard Load for RS485)3k to 7k4k min.4k min.12k

Serial RS485

RS-485 standard supports half-duplex data communication, this means that in order to send and receive data using only two cable channels. The specifications of this standard can support data communications from a number of devices and is also capable of supporting data communication in a distance up to 1200 meters. Connection from each device connected to the RS-485 carried out in parallel, so that connection and release device can be done without disrupting the whole network work.

To adjust the impedance of the cable used to install a resistor whose value is adjusted with the characteristic impedance of the cable (~ 120 Ohm). Communication network topology using the RS-485 data can be viewed at the following picture.

Here datasheet for RS485


Serial RS232

Serial Ports come in two "sizes", There are the D25 pin type connector and the D9 pin type connector, both of which are male on the back of the PC, thus you will require a female connector on your device. Below is a table of pin connections for the 9 pin and 25 pin D-Type connectors.


DB9DB25AbbrevationFunction
18CDCarrier Detect
23RDReceive Data
32TDTransmit Data
420DTRData Terminal Ready
57SGSignal Ground
66DSRData Set Ready
74RTSRequest To Send
85CTSClear To Send
922RIRing Indicator

AbbrevationFunctionDescription
CDCarrier DetectWhen the modem detects
a "Carrier" from the modem at the other end of the phone line, this Line becomes active.
RDReceive DataSerial Data Input (RXD)
TDTransmit DataSerial Data Output (TXD)
DTRData Terminal ReadyThis is the opposite to DSR. This tells the Modem that the UART is ready to link.
DSRData Set ReadyThis tells the UART that the modem is ready to establish a link.
RTSRequest To SendThis line informs the Modem that the UART is ready to exchange data.
CTSClear To SendThis line indicates that the Modem is ready to exchange data.
RIRing IndicatorGoes active when modem detects a ringing signal from the PSTN.

Null Modems
A Null Modem is used to connect two serial communication devices. This is commonly used as a cheap way to network games or to transfer files between com
puters (using Zmodem Protocol, Xmodem Protocol etc). This can also be used with many Microprocessor Development Systems. It only requires 3 wires (TD, RD & SG) to be wired straight through thus is more cost effective to use with long cable runs.

LoopBack
It has the receive and transmit lines connected together, so that anything transmitted out of the Serial Port is immediately received by the same port. If you connect this to a Serial Port an load a Terminal Program, anything you type will be immediately displayed on the screen.

Here datasheet for RS232

Serial Port Overview

The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connect to the serial port will need the serial transmission converted back to parallel so that it can be used directly. This can be done using a UART. On the software side of things, there are many more registers that you have to attend to than on a Standard Parallel Port.

So what are the advantages of using serial data transfer rather than parallel ?
  1. Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to -25 volts and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1' as 5v. Therefore the serial port can have a maximum swing of 50V compared to the parallel
    port which has a maximum swing of 5 Volts. Therefore cable loss is not going to be as much of a problem for serial cables than they are for parallel.

  2. You don't need as many wires than parallel transmission. If your device needs to be mounted a far distance away from the computer then 3 core cable (Null Modem Configuration) is going to be a lot cheaper than running 19 or 25 core cable for paralel device.

  3. Microcontroller's have also proven to be quite popular recently. Many of these have in built SCI (Serial Communications Interfaces) which can be used to talk to the outside world. Serial Communication reduces the pin count of these MPU's. Only two pins are commonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8 bit Parallel method (You may also require a Strobe).