2. RS232
RS232C “Recommended Standard 232C” is the recent version of Standard 25 pin
whereas, RS232D which is of 22 pins. In new PC‟s male D-type which is of 9 pins.
RS232 is a standard protocol used for serial communication, it is used for connecting computer
and its peripheral devices to allow serial data exchange between them.
As it obtains the voltage for the path used for the data exchange between the devices. It is used in
serial communication up to 50 feet with the rate of 1.492kbps.
The RS232 is used for connecting Data Transmission Equipment (DTE) and Data
Communication Equipment (DCE).
2
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
3. RS232
RS-232 serial cabling interface came into existence in the year 1962.
It is known to be the oldest cabling method to form a connection between data terminal
equipment and data communication equipment.
For example connection of computer system with a printer.
Electrical Specifications
Voltage Levels: RS232 also used as ground & 5V level. Binary 0 works with voltages up to
+5V to +15Vdc. It is called as „ON‟ or spacing (high voltage level) whereas Binary 1 works
with voltages up to -5V to -15Vdc. It is called as „OFF‟ or marking (low voltage level).
Received signal voltage level: Binary 0 works on the received signal voltages up to +3V to
+13 Vdc & Binary 1 works with voltages up to -3V to -13 Vdc.
Line Impedances: The impedance of wires is up to 3 ohms to 7 ohms & the maximum cable
length are 15 meters, but new maximum length in terms of capacitance per unit length.
Operation Voltage: The operation voltage will be 250v AC max.
Current Rating: The current rating will be 3 Amps max.
3
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
4. RS232
Dielectric withstanding voltage: 1000 VAC min.
Slew Rate: The rate of change of signal levels is termed as Slew Rate. With its slew rate is up to
30 V/microsecond and the maximum bitrate will be 20 kbps.
How RS232 Works?
RS232 works on the two-way communication that exchanges data to one another.
There are two devices connected to each other, (DTE) Data Transmission Equipment&
(DCE) Data Communication Equipment which has the pins like TXD, RXD, and RTS&
CTS.
Now, from DTE source, the RTS generates the request to send the data.
Then from the other side DCE, the CTS, clears the path for receiving the data.
After clearing a path, it will give a signal to RTS of the DTE source to send the signal.
Then the bits are transmitted from DTE to DCE.
Now again from DCE source, the request can be generated by RTS and CTS of DTE sources
clears the path for receiving the data and gives a signal to send the data.
This is the whole process through which data transmission takes place.
4
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
5. RS232
Structure of the transmitted data in RS-232
One message sent over RS-232/422/485 consists of a start bit, several data bits, a parity bit and a
stop bit.
The start bit is the bit denoting the beginning of the transmission, usually 0.
Data bits - 5, 6, 7 or 8 bits of data. The first bit is the less significant bit.
Parity bit - A bit intended for parity checking. Serves for detecting errors. It can take the
following values:
5
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
6. RS232
The parity (EVEN) takes such value that the number of units in the message is even
Oddness (ODD), takes on such value that the number of units in the message is odd
Always 1 (MARK), the parity bit will always be 1
Always 0 (SPACE), the parity bit will always be 0
Not used (NONE)
Stop bit - a bit indicating the completion of the message transmission, can take the values 1,
1.5 (Data bit = 5), 2. For example, a reduction of 8E1 means that 8 data bits are transmitted, a
parity bit is used in EVEN mode and a stop bit occupies one bit.
6
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
7. RS232 CONNECTOR
For connection to RS-232, a special D-sub connector is used, usually a 9-pin DB9, and a 25-pin
DB25 is used less often.
DB connectors are divided into:
Male - "daddy" (plug, pin)
Female - "mother" (socket, socket).
7
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
8. RS232 CONNECTOR
Pinout of DB9 connector for RS-232
Pin Description DB-9 Connector:
8
PIN No. Pin Name Pin Description
1 DCD (Carrier Detect) Incoming signal from DCE
2 RD (Receive Data)
Receives incoming data from
DTE
3 TD (Transmit Data) Send outgoing data to DCE
4 DTR (Data Terminal Ready) Outgoing handshaking signal
5 GND (Signal ground) Common reference voltage
6 DSR (Data Set Ready) Incoming handshaking signal
7 RTS (Request to Send)
Outgoing signal for controlling
flow
8 CTS (Clear to Send)
Incoming signal for controlling
flow
9 RI (Ring Indicator) Incoming signal from DCE
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
9. WHAT IS HANDSHAKING?
Handshaking is the process which is used to transfer the signal from DTE to DCE to make
the connection before the actual transfer of data. The messaging between transmitter &
receiver can be done by handshaking.
There are 3 types of handshaking processes named as:-
No Handshaking
If there is no handshaking, then DCE reads the already received data while DTE transmits the
next data.
All the received data stored in a memory location known as receiver‟s buffer.
This buffer can only store one bit so receiver must read the memory buffer before the next bit
arrives.
If the receiver is not able to read the stored bit in the buffer and next bit arrives then the
stored bit will be lost.
As shown in below diagram, a receiver was unable to read the 4th bit till the 5th bit arrival and
this result overriding of 4th bit by 5th bit and 4th bit is lost.
9
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
10. WHAT IS HANDSHAKING?
Hardware Handshaking:
It uses specific serial ports, i.e., RTS & CTS to control data flow.
In this process, transmitter asks the receiver that it is ready to receive data then receiver checks
the buffer that it is empty, if it is empty then it will give signal to the transmitter that I am
ready to receive data.
The receiver gives the signal to transmitter not to send any data while already received data
cannot be read.
Its working process is same as above described in handshaking.
10
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
11. Software Handshaking:
In this process, there are two forms, i.e., X-ON & X-OFF. Here, „X‟ is the transmitter.
X-ON is the part in which it resumes the data transmission.
X-OFF is the part in which it pauses the data transmission.
It is used to control the data flow and prevent loss during transmission.
11
WHAT IS HANDSHAKING?
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
12. APPLICATION OF RS232 COMMUNICATION
RS232 serial communication is used in old generation PCs for connecting the peripheral
devices like mouse, printers, modem etc.
Nowadays, RS232 is replaced by advanced USB.
It is also used in PLC machines, CNC machines, and servo controllers because it is far
cheaper.
It is still used by some microcontroller boards, receipt printers, point of sale system (PoS), etc.
12
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
13. RS422
The RS422 is similar to RS232 which allows to simultaneously send and receive messages on
separate lines but uses a differential signal for this.
In the RS-422 network, there can only be one transmitting device and up to 10 receiving
devices.
The data transfer speed in RS-422 depends on the distance and can vary from 10 kbps (1200
meters) to 10 Mbps (10 meters).
The RS-422 line is 4 wires for data transmission (2 twisted wires for transmission and 2 twisted
wires for receiving) and one common GND ground wire.
The voltage on the data lines can be in the range from -6 V to +6 V.
One master device (Master) and the rest slave devices (Slave), the slave devices cannot
communicate with each other, so RS-422 supports point-to-multidirectional two-way
communication.
13
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
14. RS485
RS-485 serial cabling interface invented in 1998 is known to be an advancement of RS-232 that
suits the technological advancement of the present world.
This communication protocol holds the ability to handle 32 connected devices which were only 1
in the case of RS-232.
Thus, it has 32 transmitter and 32 receiver terminals by which multiple devices of a single
system can be connected easily.
14
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
15. RS485
The RS-485 serial bus is widely used when the communication distance must be several tens
of meters to several kilometers.
RS-485 uses balanced transmit and differential receives so that it can reject common-mode
interference.
In addition to the high sensitivity of the bus transceiver, it can detect voltages as low as
200mV, so recover the transmitted signal beyond the kilometer.
RS-485 uses a half-duplex mode of operation and sends only one point at any time. Therefore,
the transmitting circuit must be controlled by an enable signal.
15
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
16. RS485 FEATURES
The new standard RS-485 has the following features:
Electrical characteristics of RS-485: The logic “1” is represented by the voltage difference between the
two lines +2V~+6V, and the logic “0” is represented by the voltage difference between the two lines -
6V~-2V. The interface signal level is lower than RS-232-C, and it is not easy to damage the interface
circuit chip. The level is compatible with the TTL level, which is convenient for connecting with the
TTL circuit.
The highest data transmission rate is: 10Mbps
The RS-485 interface adopts a combination of a balanced driver and a differential receiver, which has
anti-common solid mode interference capability, that is, good anti-noise performance.
The maximum transmission distance of the RS-485 interface is 4000 feet, which is actually up to 3000
meters.
The RS-232-C interface allows only one transceiver connected to the bus, i.e., single-station
capability. In contrast, the RS-485 interface allows only up to 128 transceivers connected on the bus,
i.e., multi-station ability. The user The device network can be quickly established using a single RS-
485 interface.
There are two types of RS-485 such as half duplex mode RS-485 with 2 contacts and full duplex mode
RS-485 with 4 contacts.
16
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002
17. DIFERENCE BETWEEN RS232, RS422 AND RS485
RS-232 RS-422 RS-485
Network Topology Point-to-Point Point-to-Point
Or Multidrop
Point-to-Point
Or Multidrop
Duplex Type Full duplex Full duplex
Half duplex
Full duplex
Half duplex
Number of Devices 1 Controller
1 receiver
1 controller
10 receivers
32 unit loads
(controllers or receivers)
Signalling Unbalanced Balanced Balanced
Max Distance 50 feet at 19.2 kbps 4000 feet at 100 kbps 4000 feet at 100 kbps
Mark (data 1) -15V to -3V 2V to 6V (B>A) 1.5V to 5V (B>A)
Space (data 0) +3Vto +15V 2V to 6V (A>B) 1.5V to 5V (A>B)
17
RS232, RS422 AND RS485 EMBEDDED SYSTEM REC7D002