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 RS232 standards include defined levels for the lines along with a mode of operation for the handshaking.
In this way any RS232 system can be assured of its correct operation. If the voltages fall within the defined levels, then the receivers are able to correctly detect the data that is being transmitted, or the state of the other lines.
If the lines fall outside the required limits, then there can be uncertainty and data errors.
RS 232 voltage levels
In order that the RS 232 transmitters and receivers can be designed to a common standard, it is necessary to define the voltage levels that constitute the two logical states required for data transmission. The two states are defined as in the table below.
|RS232 Signal Line Voltage Levels
|-3 to -25||1|
|+3 to +25||0|
It is also necessary to define the voltage states for the control signals as these are widely used within RS 232.
|RS232 Control Line Voltage Levels
|-3 to -25||OFF|
|+3 to +25||ON|
RS232 serial data transmission
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.
In order that data can be exchanged on an RS232 link, the control signals must indicate that the equipment at either end of the link is ready to send the data and ready to receive the data. This can be achieved in a number of ways, but one of the more common is to use the RTS , CTS, and DTR lines.
These lines are found in the Data Terminal Equipment, DTE and Data Communications Equipment, DCE as follows:
|RS232 Handshaking Line Definitions
|Line abbreviation||Line Name||Equipment|
|RTS||Request to Send||DTE|
|CTS||Clear to Send||DCE|
|DTR||Data Terminal Ready||DTE|
The handshaking exchange to start the data flow is quite straightforward and can be seen as a number of distinct stages:
- RTS is put in the ON state by the DTE
- The DCE then puts the CTS line into the ON state
- The DTE then responds by placing the DTR line into the ON state.
- The DTR line remains on while data is being transmitted.
At the end of the transmission, DTR and RTS are pulled to the OFF state and then the DCE pulls the CTS line to the OFF state. This series of handshake controls was devised to allow the DTE to request control of the communications link from the related modem, and then to let the modem inform the terminal equipment that the control has been acquired. In this way the communications will only take place when both ends of the link are ready.
The RS-232 voltage levels are important because they enable system to be designed to ensure that data errors are minimise. By assigning levels to the mark and Space conditions, with a band in between it ensures that data errors are minimised. In addition to this the operation of the handshaking with lines including RST, CTS and DTR, the operation of the system can be reliable and only send data when all equipment is ready.
Wireless & Wired Connectivity Topics:
Mobile Communications basics 2G GSM 3G UMTS 4G LTE 5G WiFi IEEE 802.15.4 DECT cordless phones NFC- Near Field Communication Networking fundamentals What is the Cloud Ethernet Serial data USB SigFox LoRa VoIP SDN NFV SD-WAN
Return to Wireless & Wired Connectivity