In 1962, RS232 was introduced by Radio Sector of EIA. With the invention of electronic devices such as printers, computers and laptops etc., the researchers felt that some device should be manufactured so the communication between these devices can be carried out. So RS232 was adopted as a standard to carry out digital communication as well as data exchange. With the help of RS232, the data can be exchanged more reliably over the analog channels. The voltage levels are defined in the standard thus making it immune to noise disturbances as well as reduction in data exchange error. RS232 has many applications in microcontroller based projects and embedded systems projects.
Table of Contents
INTRODUCTION to RS232
To carry out communication, RS232 is used as a standard in order to link computer as well as its peripheral devices that allow the serial data exchange. The basis working of RS232 is to define the voltages for the path that is to be used for data exchange purposes among various devices. Signal level as well as common voltages, configuration of common pin and the control signals are specified. This standard was basically designed for modem and teletypewriter. Thus it don’t provide support to several elements like framing of character, character encoding and error detection protocols etc. that are mandatory whenever data transfer is going to take place. Without providing support to such devices, this standard cannot be adopted to carry out data transfer. So, in order to overcome this issue, an integrated circuit known as UART i.e. “Universal Asynchronous Receiver Transmitter” is used with RS232.
IMPLEMENTATION OF RS232
The RS232 interface works in conjunction with UART that is integrated in the controller or processor. The bytes are being taken and thus individual bits are being transmitted in sequential manner inside a frame. Frame can be thought as defined structure that carries meaningful bytes or bits sequence of data. The data flow starts with the start bit that is further followed by eight data bits, stop bit as well as a parity bit. Once the data has been aligned in this way, the separate line drivers play their role in conversion of UART logic family to the RS232 logic. In the final phase, the signals are transmitted at the specified voltage level of RS232. The transfer of bits is carried out in sequential manner i.e. bits are being sent one after another and this mode of data transfer needs that the receiver side should be aware that when the actual bits of data are going to be received so that it can get synchronized with the coming data.
As starting bit, logic 0 is sent which is used to signal the receiver that new characters are coming. Once this is acknowledged by the receiver, the next 5 to 8 bits are sent followed by the parity bit. The parity bit is used for error detection. The parity bit can be specified using the odd or even numbers of 1s present in the data and same calculation is also done at the receiving side. Then the received and calculated parity bits are compared. If both are same, then the decoding of data is performed otherwise the data is discarded if both are not same. The parity bit is followed by the stop bit which shows that the data transmission process is completed and there is no more data that is to be sent.
RS232 is considered as a complete standard. Perfect compatibility is ensured by RS232 by not only defining the electrical characteristics but also mechanical as well as functional characteristics. For instance, slew rate, pin identification, signaling rate, voltage levels and pluggable connectors etc. All of these specifications as well as their values are mentioned in the block diagram below:
Figure: RS232 Specifications
ELECTRICAL CHARACTERISTICS OF RS232
In electrical characteristics, the voltage level, voltages withstand level as well as slew rates are included. The pin out signals of RS232 is represented by different voltage levels with respect to the common pin voltage. The maximum voltage specified by RS232 comes out to be 25 volts. On the transmitter side, the output voltage level of driver is specified as +3 volts and +5 volts for representing the high levels. For low levels, -3 volts and -15 volts are specified. At the receiver side, the same voltage levels are observed i.e. for high level +3 and +15 volts and for low levels, -3 and -15 volts. However, at the receiver side, the +2 volts are provided as noise margin.
Between the +3 and -3 voltages is the dead area i.e. it is designed for absorption area. The low voltage area is considered as ON state i.e. logic 1 and the high voltage area are considered as OFF state i.e. logic 0. The low voltage areas are referred as Marking and high voltage are referred as Spacing. The maximum slew rate that is allowed in RS232 is 30 volts per micro second thus the fall as well as rise time is slowed down and cross talk is significantly reduced. The following figure represents the logic specifications of RS232:
Figure: Electrical Characteristics
MECHANICAL CHARACTERISTICS OF RS232
As the mechanical interface of RS232 is concerned, initially 25 pin connector was being used. The minimum connector size specified by RS232 is capable of accommodating all the signals. Every pin is pre-defined in order to check the compatibility among the peripheral systems as well as the host. The male connector is used by the data terminal equipment and for female connector; the data communication equipment is used. The type of gender is another important concept regarding the connector. In mechanical as well as electrical trade, each connector comes as pair i.e. one female and one male connector. The pins of male connector are sticking out while in case of female connector, it has holes so that it can hold the male connector.
Figure: Male and female connector
Figure: 25 pin & 9 pin connector
FUNCTIONAL CHARACTERISTICS OF RS232
The different signals that are being used in the interface are defined in this section. The signals can be categorized in four groups that are common, timing, data and control signals. Some terminologies such as Look Back, Secondary channel along with off hook are discussed.
- Loop Back: It allows user to test to ensure that their network is properly functioning.
- Off Hock: This condition is occurred mostly during the communicating or dialing phase. It prevails whenever separate receiver was used that was hangs on the hook switch till the time when needed by user
- Secondary Channel: Secondary channels are regarded as data channels. For instance, secondary received data, secondary carrier data and Secondary transmitted data.
Presently, many new developments are made but RS232 is still used in many applications. The reason of using RS232 lies in the simplicity of this standard that allows user to use it for direct communication from its serial ports. Various fields like automation, laboratory as well as surveying plays vital role in sustaining the demand of RS232. Along with RS232, serial ports are being used for communicating with the headless system i.e. a server having no installation of keyboard during the boot process that signifies the importance of RS232. That’s all for this article. Feel free to ask any question regarding this article in the comment section below.