You are on page 1of 3

Technical Notes: RS232 Serial Port

What is RS232?
RS232 is a popular communications protocol for connecting modems and data acquisition devices to computers. RS232 devices can be plugged straight into the computer's serial port (also known as the COM or Comms port). Examples of data acquisition devices include GPS receivers, electronic balances, data loggers, temperature interfaces and other measurement instruments.

RS232 Software
To obtain data from your RS232 instruments and display it on your PC you need some software. Version 4.3 of the Windmill RS232 software is now free from their web site. They also offer free serial trouble-shooting software.

The RS232 Standard


RS stands for recommended standard. In the 60's a standards committee now known as the Electronic Industries Association developed an interface to connect computer terminals to modems. Over the years this has been updated: the most commonly used version of the standard is RS232C (sometimes known as EIA232); the most recent is RS232E. The standard defines the electrical and mechanical characteristics of the connection - including the function of the signals and handshake pins, the voltage levels and maximum bit rate. If RS232 is a standard why can't I just use a standard lead to connect together two RS232 ports and expect them to talk to one another? That's a good question. The answer is that the RS232 standard was created for just one specific situation and the difficulties come when it is used for something else. The standard was defined to connect computers to modems. Any other use is outside of the standard. The authors of the standard had in mind the situation below:

The standard defines how computers ( it calls them Data Terminal Equipment or DTEs) connect to modems ( it calls them Data Communication Equipment or DCEs). The standard says that computers should be fitted with a 25 way plug whilst modems should have a 25 way D socket. The interconnecting lead between a computer and a modem should be simply pin1pin1, pin2pin2, etc. The main signals and their direction of flow are described below. It is important to note that a signal which is an output from a computer is an input to a modem and vice versa. This means that you can never tell from the signal name alone whether it is an input or an output from a particular piece of equipment. Also, instead of being a DCE device, a data acquisition device might be configured as DTE. In this case you need an adaptor or the RS232 cable wired differently to normal. When the PC is connected to a DTE instrument, some of the cable wires must cross over.

TXD Transmitted Data, Pin 2 of 25 way D This is the serial encoded data sent from a computer to a modem to be transmitted over the telephone line. RXD Received Data, Pin 3 of 25 way D This is the serial encoded data received by a computer from a modem which has in turn received it over the telephone line. DSR Data Set Ready, Pin 6 of 25 way D This should be set true by a modem whenever it is powered on. It can be read by the computer to determine that the modem is on line. DTR Data Terminal Ready, Pin 20 of 25 way D This should be set true by a computer whenever it is powered on. It can be read by the modem to determine that the computer is on line. RTS Request to Send, Pin 4 of 25 way D This is set true by a computer when it wishes to transmit data. CTS Clear To Send, Pin 5 of 25 Way D This is set true by a modem to allow the computer to transmit data. The standard envisaged that when a computer wished to transmit data it would set its RTS. The local modem would then arbitrate with the distant modem for use of the telephone line. If it succeeded it would set CTS and the computer would transmit data. The distant modem would use its CTS to prevent any transmission by the distant computer. DCD Data Carrier Detect, Pin 8 of 25 Way D This is set true by a modem when it detects the data carrier signal on the telephone line.. PC Serial Ports A nine pin D plug has become the standard fitting for the serial ports of PCs, although it's nothing to do with the RS232 standard. The pin connections used are: Pin 1 2 3 4 5 6 7 8 9 Direction Input Input Output Output Input Output Input Input Signal DCD Data Carrier Detect RXD Received Data TXD Transmitted Data DTR Data Terminal Ready Signal Ground DSR Data Set Ready RTS Request To Send CTS Clear To Send RI Ring Indicator

How Fast Can Instruments send data over RS232?


The speed of RS232 communications is expressed in Baud. The unit is named after Jean Maurice-Emile Baudot (1845-1903), a French telegraph engineer and the inventor of the first teleprinter. It was proposed at the International Telegraph Conference of 1927. The maximum speed, according to the standard, is 20000 Baud. However, modern equipment can operate much faster than this. No matter how fast (or slow) your connection - the maximum number of readings per second you can take from your instrument depends on the software. For example, with Windmill software, speeds of up to 35 readings per second are achievable whilst with Streamer software this rises to 700 readings per second.

The length of the cable also plays a part in maximum speed. The longer the cable, the greater the cable's capacitance and the slower the speed at which you can obtain accurate results. A large capacitance means voltage changes on one signal wire may be transmitted to an adjacent signal wire. Fifty feet is commonly quoted as the maximum distance, but this is not specified in the standard. We generally recommend a maximum distance of 50 metres, but this depends on the type of hardware you are connecting and characteristics of the cable.

More Information
For more details of RS232 communications, please send for a free copy of the Microlink Measurement and Control Systems catalogue. Windmill's web site offers free Windows software to collect data from instruments with RS232 ports and send it directly to Windmill's logging and charting software, Excel or other Windows software. Windmill also offer free serial trouble-shooting software for solving comms problems and quickly checking that you can communicate with your instrument before starting to automatically acquire data.

Home Index Previous Search Copyright Biodata Ltd 2001-2005 10 Stocks Street, Manchester, M8 8QG, UK Tel: +44 161-834 6688 Fax: +44 161-833 2190 E-mail: info@microlink.co.uk http://www.microlink.co.uk/rs232.html Related Topics:

You might also like