RS232 Serial Interface: V24

RS232, also know as V24 standardised by EIA provided a useful means of serial data communications for many years.


RS232 Includes:
RS232 basics     RS232 standard     Software handshaking     Signals & voltage levels     Pinouts & connectors     Loopback connections     RS232 cables    

Serial Data standards:     Serial data standards     RS422     RS449     RS485     20 mA current loop    


The RS-232 / V24 serial interface communications standard was widely used for many years. It is still used in some instances, especially in existing installations, although its use is now decreasing as Ethernet and other standards take its place.

RS232 / V24 was found in many areas from computers to remote terminals and many more. It was an effective way of providing serial data connectivity and as such it was widely used.

RS-232 interface basics

The interface is intended to operate over distances of up to 15 metres. This is because any modem is likely to be near the terminal. Data rates are also limited. The maximum for RS-232C is 19.2 k baud or bits per second although slower rates are often used. In theory it is possible to use any baud rate, but there area number of standard transmission speeds used.

Common data transmission rates

50
75
110
150
300
600
1200
2400
4800
9600
19200
38400
76800

Note: speeds up to 19200 bits per second are normally used. Above this noise that is picked up, especially over long cable runs can introduce data errors. Where high speeds and long data runs are required then standards such as RS422 may be used.

RS-232 connections

The RS-232C specification does not include a description of the connector to be used. However, the most common type found is the 25 pin D-type connector.

RS232 signal levels

The voltage levels are one of the main items in the specification. For RS232 data signals a voltage of between -3V and -25V represents a logic 1. The logic 0 is represented by a voltage of between +3V and +25V. Control signals are in the "ON" state if their voltage is between +3V and +25V and "OFF" if they are negative, i.e. between -3V and -25V.

The data is sent serially on RS232, each bit is sent one after the next because there is only one data line in each direction. This mode of data transmission also requires that the receiver knows when the actual data bits are arriving so that it can synchronise itself to the incoming data. To achieve this a logic 0 is sent as a start bit for the synchronisation. This is followed by the data itself and there are normally seven or eight bits. The receiver obviously has to know how many data bits to expect, and there are often small dual in line switches either on the back of the equipment or inside it to set this information.

Data on RS232 is normally sent using ASCII (American Standard Code for Information Interchange). However other codes including the Murray Code or EBCDIC (Extended Binary Coded Decimal Interchange Code) can be used equally well.

After the data itself a parity bit is sent. Again this requires setting because it is optional and it can be even or odd parity. This is used to check the correctness of the received data and it can indicate whether the data has an odd or even number of logic ones. Unlike many systems these days there is no facility for error correction.

Finally a stop bit is sent. This is normally one bit long and is used to signify the end of a particular byte. Sometimes two stop bits are required and again this is an option that can often be set on the equipment.

RS232 data transmission is normally asynchronous. However transmit and receive speeds must obviously be the same. A certain degree of tolerance is allowed. Once the start bit is sent the receiver will sample the centre of each bit to see the level. Within each data word the synchronisation must not differ by more than half a bit length otherwise the incorrect data will be seen. Fortunately this is very easy to achieve with today's accurate bit or baud rate generators.

Lines and their usage

There are four types of line defined in the RS232 specification. They are Data, Control, Timing and Ground. Not all of them are required all the time. It is possible to set up a very simple communication using very few lines. When looking at the lines and their functions it is necessary to remember that they are defined for a connection between a modem (the data set or communications equipment) and a terminal or computer (data terminal equipment) in mind. All the lines have directions, and when used in this way a one to one cable operates correctly.

The most obvious lines are the data lines. There are two of these, one for data travelling in each direction. Transmit data is carried on pin 2 and the receive data is carried on line three.

The most basic of the control circuits is Data Carrier Detected (DCD). This shows when the modem has detected a carrier on the telephone line and a connection appears to have been made. It produces a high, which is maintained until the connection is lost.

Data Terminal Ready (DTR) and Data Set Ready (DSR) are the main control circuits. They convey the main information between the terminal and modem. When the terminal is ready to start handling data it flags this on the DTR line. If the modem is also ready then it returns its signal on the DSR line. These circuits are mainly used for telephone circuits. After a connection has been made the modem will be connected to the line by using DTR. This connection will remain until the terminal is switched off line when the DTR line is dropped. The modem will detect this and release the telephone line.

Sometimes pin 20 is not assigned to DTR. Instead another signal named, Connect Data Set To Line (CDSTL) is used. This is virtually the same as DTR, but differs in that DTR merely enables the modem to be switched onto the telephone line. CDSTL commands the modem to switch, despite anything else it may be doing.

A further two circuits, Request To Send (RTS) and Clear To Send (CTS) are also used. This pair of circuits are used together. The terminal equipment will flag that it has data to send. The modem will then return the CTS signal to give the all clear after a short delay.

This signalling is used particularly when switched carriers are used. It means that the carrier is only present on the line when there is data to send. It finds its uses when one central modem is servicing several others at remote locations.

Secondary lines

There are two types of lines that are specified in the RS-232 specification. There are the primary channels that are normally used, and operate at the normal or higher data rates. However, there is also provision for a secondary channel for providing control information. If it is used it will usually send data at a much slower rate than the primary channel.

As the secondary lines are rarely used or even implemented on equipment, manufacturers often use these connector pins for other purposes. In view of this it is worth checking that the lines are not being used for other purposes before considering using them. When the secondary system is in use, the handshaking signals operate in the same way as for the primary circuit.

Grounding

The ground connections are also important. There are two. First the protective ground ensures that both equipments are at the same earth potential. This is very useful when there is a possibility that either equipment is not earthed. The signal ground is used as the return for the digital signals travelling along the data link. It is important that large currents that are not part of the signalling do not flow along this line otherwise data errors may occur.


RS232 / V24 is still used in some areas, but it has been eclipsed by faster and more convenient forms of data communications like Ethernet, USB and many more. Despite that, its use is still maintained in some applications.

Ian Poole   Written by Ian Poole .
  Experienced electronics engineer and author.



Wireless & Wired Connectivity Topics:
Mobile Communications basics     2G GSM     3G UMTS     4G LTE     5G     Wi-Fi     Bluetooth     IEEE 802.15.4     DECT cordless phones     Networking fundamentals     What is the Cloud     Ethernet     Serial data     USB     LoRa     VoIP     SDN     NFV     SD-WAN
    Return to Wireless & Wired Connectivity