introduction to rs232, rs232 working, rs232 applications, rs232 protocol
Hello Friends! Hope you are doing well. I am back to give you a daily dose of valuable information. Today, I'll discuss the detailed Introduction to RS 232 which is a standard communication protocol mainly used for serial communication between two devices. It was first introduced by the EIA (Electronic Industries Association) in 1960 to provide a pathway for connecting one device with other peripheral devices for flawless digital communication. It is true, that the inception of USB has grossly reduced the need for RS232 protocol, still, we can't brush off its significant importance in some industrial applications where Programmable Logic Controllers and Computerized Numerical Control Equipment are specifically programmed using RS 232 connectors which is nothing but an interface between DTE (Data terminal equipment) and (Data communication equipment). Don't worry about these abbreviations, I'll come to them later. In this post, I'll walk you through the basic concept of RS 232, why it is used and what are its main advantages and limitations. Let's dive in and explore the main features of the RS 232 protocol.

Introduction to RS232

RS 232, recently known as TIA 232, is a recommended standard protocol for serial data transmission between the electronic devices. It mainly works on three line signals: a transmission line, receive line and ground.
  • The transmission line is mainly used to send the data serially from one end and receive line accepts the data from the other end while the common ground is used for devices.
Initially, it was very difficult to devise the clear protocol to send the data from one end to another. This led to the inception of the RS 232 protocol, revitalizing the communication industry with the main purpose to keep both ends of the connecting device under the same roof where they can accept, understand and communicate in the same language. The RS 232 is mainly categorized into two systems: DTE and DCE.
introduction to rs232, rs232 working, rs232 applications, rs232 protocol
DTE is a data terminal equipment such as a computer that handles the communication with some control functions and plays the main part of the station. Similarly, DCE is a data circuit-terminal equipment that is placed on the other end of the station and understands data being communicated from the DCE equipment. The DCE system incorporates male DB connectors while the DCE system comes with female DB connectors.
  • RS232 data is bi-polar in nature, indicating an "ON or 0-state (SPACE) condition" if a voltage is around 3 to 12 V and features an "OFF" or 1-state (MARK) condition if voltage ranges from -3 to -12 V.
It is important to note that, most of the companies have reshaped the internal structure of the recent computers where they still indicate an OFF state at the zero voltage level, all the while ignoring the negative voltage. Similarly, the "ON" state is not necessarily dependent on the highest voltage level and can be achieved with much less voltage around 5V.
introduction to rs232, rs232 working, rs232 applications, rs232 protocol
Serial communication is mainly based on logical terms and RS232 transfers one bit at a time in the stream of ones and zeros which at the other end eventually get converted back to bits. There are eight bits in one byte.
  • The duration at which the required signal stays in the particular state is dependent on the baud rate. The communication carried out in a RS 232 protocol is measured in baud - A number of bits transferred per second i.e. 1000 baud indicate 1000 bits per second.
There are other parameters that must be set up before the data transmission: Length of the byte, Parity and magnitude of stop bits. This length of the signal can be reserved anywhere from 5 to 8 bits. The second parameter is important. Partiy mainly comes with five options
  • Even
  • Odd
  • Mark
  • Space
  • None
Even parity indicates the last data bit transmitted will be a logical 1 if it contains an even number of 0 bits. Similarly, Odd parity will be showing that the transmitted data is termed as logical 1 if it comes with an odd number of 0 bits. And MARK and SPACE parity will be representing that the last transmitted data bit will be logical 1 and 0 respectively. The last parameter is a number of stop bits and its value is set as 1 or 2. Transmission Capability RS-232 can perform transmission at data rates up to 20 Kbps with distance range capability around 50 ft. It all depends on the capacitance of the cable. The low capacity cables can transfer data up to 1000 ft while cables with high capacitance can transfer data at the lower distance.
  • As mentioned earlier many computers don't come with RS 232 port anymore, therefore we need to add USB-to RS 232 converter externally in order to make them compatible with RS 232 peripheral devices.
Although excessive use of RS 232 becomes obsolete, they are still used in low speed wired data connection and point-to-point networking equipment with short range capabilities.
Communication Process
The communication is simply based on the transmission and receive protocol and a total of 9 pins are involved in carrying out the complete transmission. The following figure shows how the data is transmitted over the terminal.
introduction to rs232, rs232 working, rs232 applications, rs232 protocol
Mainly the communication is laid out between DTE and DCE terminals over the mutual agreement for required data transfer. The RTS pin shows the desire to send data to another terminal. As it turns ON, it indicates the DTE terminal is ready to transfer the data. The data will be transmitted gradually over the line without any resistance if CTS pin from the other is activated and grants permission to DTE for data transfer.
  • The CD pin represents the current status of the RTS pin. If CD pin remains turned OFF, it will show the DTE terminal is not ready to send data over the channel. Similarly, turning it ON will be showing the DTW desires to send data and looking for permission from the other end.
Once the permission is granted, two other pins RD and TD come into play where former is used to receive data from DCE terminal and later is used for transferring data from DTE to DCE terminal.
  • The DTR pin must be turned ON before both terminals are ready to communicate with each other. Actually, DTR (Data Terminal Ready) will be indicating that entire arrangement from both terminals is adequate and matches with the required protocol for data transfer. It serves as a go-ahead signal for the communication.
Connector Pinout
Following figure shows the configuration of DB 25 connector.
introduction to rs232, rs232 working, rs232 applications, rs232 protocol
Following figure shows the pin configuration of the DB-9 connector.
introduction to rs232, rs232 working, rs232 applications, rs232 protocol
  • DB-9 and DB-25 connectors offer the outstanding quality and reliability for a number of serial and parallel (IEEE 1284) applications.
Types of Serial Communication
There are two main types of serial communication. Half Duplex Full Duplex Half Duplex, as the name suggests, transfers the information in one direction only. It comes with two lines where one is a data line and other is signal ground. In this communication, the terminal is capable to send or receive data, but not at the same time. This method is an old one and is not under practice anymore. Full Duplex communication can transmit and receive data in both directions, requiring three main lines: data transmit line, data receive line and signal ground.
Applications
Before USB came into play, RS-232 ports were the part and parcel for data communication between a computer and other peripheral devices. Still, they are successful in grooving their way in many science and technology applications. Let's have a look.
  • In the absence of any network connection, RS232 ports are used to communicate in headless systems.
These ports play a vital role in establishing communication between the computer and embedded systems. Some Programmable Logic Controllers cannot be programmed without RS232 protocol.
  • Many Computerized Numerical Control Systems are equipped with RS232 port.
Apart from DB9 and DB25 ports, sometimes the two-wire interface is enough when the transmission of data is carried out in one direction only. Some GPS receiver and Digital Postal Scale work on this principle.
  • Similarly, two more lines RTS and CTS are included in a 5-wire version as per the technical needs where two-way data transmission layered with hardware flow control is required.
That's all for today. I hope you have got valuable information out of this read. If you are unsure or have any question, you can approach me in the comment section below. I'll try and help you the best way I can. You are most welcome to keep us updated with your feedback and suggestions, they help us provide you quality work as per your needs and requirements Thanks for reading the article.