Computer Serial Port Pinout



The background of the 9 pin serial port First introduced in the 60s, RS-232 is a protocol that defines how the data is transferred, bit by bit from a Data Terminal Equipment (DTE) such as a computer terminal, to Data Communication Equipment (DCE) such as a modem. RS-232 is the common standard used in serial ports. Computer Serial Port Pinout On 172jnn21032 A DB-25 connector as described in the RS-232 standard Data circuit-terminating equipment (DCE) and data terminal equipment (DTE) network. Telefonnetz refers to a telephone network; EIA-232 is an old name for RS-232, the serial communication standard.

At one point, the RS-232 9-pin Serial Port used to be a common connector on the back of every computer. But with USB being a much better protocol and easier to use, the serial port has just about disappeared from modern desktop computers. With servers, however, the serial port is still in use, but sometimes it’s only available as an IDC COM header connector on the motherboard. If you have a need for a serial port, then an IDC10-to-DB9 serial adapter might be required. I had just such a need recently and discovered that there are two industry standard pinout conventions in use, the AT/Everex and the DTK/Intel. If you want to know more about how I discovered this and the differences, then continue reading.

I’m in the process of building a server with Ubuntu 12.04, and I needed a serial connector to communicate with an APC Smart-UPS RT 1500VA RM. Although this UPS is capable of USB communication, APC uses a RJ45 connector on the back of the unit, and I didn’t own one the correct cable. I did, however, own one of their proprietary serial cables, part number 940-0024C, so that’s how I set things up.

Initially, I had communication problems as a result of purchasing the wrong IDC10-to-DB9 serial adapter. So before discovering and solving this problem, I setup the UPS with a Keyspan USA-19HS USB-to-serial adapter, which I thought would be an easy fix. This wasn’t the case, so let me explain.

I’m using apcupsd to monitor the UPS and control the server during a power outage. When using the Keyspan adapter, the only caveat is that communication with the UPS is configured as using a serial cable instead of a USB cable. This caused a bit of a problem for me. For a typical USB configuration, apcupsd.conf would be setup as follows. Note that UPSCABLE and UPSTYPE are configured as usb and DEVICE is not defined at all. This is because apcupsd will try all the known USB ports until it succeeds.

However, when using the Keyspan USB-to-serial adapter, apcupsd.conf needed to be configured differently. In the following configuration, notice that UPSCABLE and UPSTYPE are not configured as usb. Instead, I define UPSCABLE as the model number of the proprietary APC serial cable I’m using, 940-0024C, and UPSTYPE as smartups. I also explicitly define DEVICE as /dev/ttyUSB0.

The problem with this setup was that I couldn’t rely on the device always being ttyUSB0. The next time the server rebooted, it could have been ttyUSB1. This was unreliable, so I wanted to figure out what the problem was with my serial connection.

Laptops with serial port rs232

After a bit of research, I learned that there were two pinout conventions used for the IDC10 header on motherboards. They were known as AT/Everex and DTK/Intel. AT/Everex was known as Straight Through Wiring, and DTK/Intel ws known as Cross Over Wiring.

The following tables detail the differences:

Pinout
DB9 ConnectorIDC10 Connector
DE-9 PinSignal NameDIRDescriptionIDC10
AT-Everex
IDC10
DTK/Intel
1DCD<----Data Carrier Detect11
2RXD<----Receive Data23
3TXD---->Transmit Data35
4DTR---->Data Terminal Ready47
5GND-----System Ground59
6DSR<----Data Set Ready62
7RTS---->Request to Send74
8CTS<----Clear to Send86
9RI<----Ring Indicator98

Once I discovered that there were two industry standard conventions in use for the IDC COM header connector pinout, my problem was solved. A quick fix was to buy the correct adapter. Even quicker, I warmed up the soldering iron and re-wired my adapter in less than ten minutes. Finally, the server was powered through the UPS and accurately monitored via apcupsd. I’m a happy administrator.

And just to be complete, here was the final configuration settings I used in apcupsd.conf:

If you would like to learn more about RS-232, check out this Wikipedia page.

If you’re in need of purchasing an IDC10-to-DB9 serial adapter, ether model can be purchased at www.pccables.com: AT/Everex and DTK/Intel.

If you would like to buy the Keyspan USA-19HS USB-to-Serial adapter, you can get it at Amazon.

Here we examine the history of the 3 serial interfaces used today and explore the common issues found with them and the benefits of each of the 3 different connections.

RS232: Down but not out

Once a standard feature on personal computers, the RS232 serial port was one of the first used to connect data terminals to mainframe computers. It remained in widespread use for serial communications between PCs, printers and other peripherals until the late 1990's, after which it was superseded by USB. However, RS232 ports remain in use today in the industrial sector.

RS232 Connection and Configuration

Connecting a RS232 port to a laptop usually requires a RS232 to USB converter like our Define Multicom. Typically they are used as programming ports to configure instruments and controllers, and are also used in SCADA (Supervisory Control and Data Acquisition) systems. SCADA systems gather data from RTU’s (Remote Terminal Units) like controllers or meters, and then display the results on a PC. Here, RS232 ports are used for several reasons:

  • There are many reported problems with RS485 cards.
    Instabilities caused by the Windows operating system controlling the flow of data leads to unreliability across many SCADA programs. To get around this, SCADA systems prefer an RS232 card (which does not have any flow issues) coupled with an external RS485 to RS232 converter like the Multicom.
  • RS232 cards are more readily available than RS485 cards.

Another common application for an RS232 port is in small printer applications. Typically an instrument like a panel meter can drive a printer to print items such as weigh bridge dockets or to drive a cell phone modem.

Too busy to read all this now?

Save this for later
Serial

Issues with RS232

Connect what to what?

There are three pins used for signaling on a RS232 system:

  • Rx - Receiver
  • Tx - Transmitter
  • Gnd - Signal ground

(There are other signals in the specification used for hardware handshaking such as RTS and DTR, but these are not used in Define Instruments products.)

The original standard makes a distinction between a computer (master device) known as DTE (Data Transmission Equipment) and a slave device known as DCE (or Data Communications Equipment). The labeling of the DCE becomes an issue, in that the Rx of the computer must be connected to the Tx of the DCE, and vice versa. As many instruments now can act as both master and slave (e.g. driving a printer), this leaves the quandary of how to label the device: DTE or DCE?

Over the years, manufacturers have not shown consistency on this point. This has been further complicated by manufacturers of devices that are limited by their size opting to not use the official connectors of the standard (as they are too bulky). As a result, the system cannot be identified from the connector as DTE or DCE. Thus one is left without knowing which way to connect: Rx from the device to the Rx of the computer, or the Tx of the computer to the Tx line on the device. Employing trial and error is all that remains.

Fortunately, incorrect connection of the pins is not damaging. If wrongly connected, the driver chips simply won’t work. Cross over cables are so named as they perform the cross over in the cable, and are a very handy addition to a technician’s toolkit.

Caution is required when grounding the RS232 signal

Most desktop computers ground of the RS232 ports are internally connected to earth. This presents problems if the DCE’s serial port is not isolated from all other signals.

For example: a DCE serial port ground maybe referenced to another signal in a system which is not grounded. Connecting the grounds together in this case will short points together which are at different potentials, and more than likely cause damage to the PC or device.

To get around this, the device’s serial port must be verified as a fully isolated design. All Define Instruments RS232 ports are fully isolated. If the port is not isolated, then one must use an external device that isolates the serial ports. (The Define Multicom can be used to galvanically isolate two RS232 ports.)

Variable protocols

The RS232/RS485/RS422 standards only relate to the hardware interface, not the software protocol required to make the buses communicate. There are numerous protocols (both open standards and proprietary) that exist in the market place. Hence one cannot assume interoperability between different manufacturers of 'RS232' ports.

Define Instruments supports a mixture of industry standard and proprietary protocols:

  • Modbus RTU
    This protocol is widely used in industry and most SCADA packages and PLC’s have drivers for it. However a word of warning using Modbus: although the Modbus protocol is well published, every manufacturer can and does determine its own addressing scheme. This means the manufacturer must supply the addressing scheme, register type, and Modbus commands supported, for successful integration into a Modbus system.
  • ASCII protocol
    The reason ASCII is popular is that it is easier than Modbus to write your own driver in a PLC or a PC. Define has its own protocol based on ASCII characters. Again, every manufacturer’s protocols – although similar – are not usually compatible.
  • String outputs
    Define supports two streaming string outputs. In these modes every new sample is streamed out in ASCII to the serial port. A computer on the other end can easily disseminate the reading in between start and stop characters. This type of output is very popular in the weighing industry as it is used to drive computers, large displays and summing units.

Download this whitepaper for later

Get this whitepaper

RS485: Still popular

The RS485 port has been used successfully for many years, and while RS232 installations are in decline, the RS485's popularity shows no signs of abating.

The RS485 has many advantages over both RS232 and USB when it comes to applications in noisy industrial environments. It was designed from the beginning to be tolerant of noise and forgiving of long cable runs. It achieves this by using a differential current drive output which has high immunity to noise.

While RS232 installations are in decline, the RS485's popularity shows no signs of abating.

Another major advantage is that users can have more than one slave on the BUS. The original specification stated a maximum of 32 slaves, due to the leakage of the then driver chips. These days the chips have improved, and many can support up to 256 slave devices.

The slave units are simply wired in a daisy chain configuration, meaning one port can talk to 256 slaves. This is great for large SCADA systems and comes at a very low cost to implement.

Issues with RS485

Timing of the controlling BUS

The RS485 signaling system uses two wires to achieve its drive: A+ and A- sometimes referred to as A and B, or D+ and D-. These two signals, along with a ground signal for reference, become the BUS. To achieve bi-directional communications like most protocols require, the BUS is shared between transmitting and receiving. So when one end of the BUS is transmitting it must take control, and the other end must release control and enter a listening mode.

Laptop Serial Port Pinout

The timing of controlling the BUS is critical for a successful installation. If the transmitting side takes too long to release the BUS, the other side may start transmitting before the first has finished, causing the message to be corrupted.

Many computer RS485 cards use the RTS signal in a standard PC UART to control the BUS. Unfortunately Windows then has to control this signal. Since Windows is not a Real Time Operating System (RTOS), the signal may be delayed (for a multitude of other operating system demands), resulting in garbled messages.

The best way to eliminate this issue is to use an external RS485 to RS232, or RS485 to USB converter, like the Define Multicom. Embedded devices like the Multicom take care of this issue.

Misconceptions around the necessity of the ground connection

A common misconception is that only the two signaling wires are required for a RS485 system and the ground connection can be omitted. This is incorrect. Even though the system may appear to work without the ground, its noise rejection and reliability is significantly degraded.

When to use RS485 terminating resistors

The RS485 standard is designed to work up to 10Mbits/s, while most industrial systems tend to work up to 115Kbits/s max (or a 100th of the maximum).

Terminating resistors are required if using very high baud rates, as transmission line reflections from un-terminated ends can come back to be read mistakenly as a valid signals. A good rule of thumb is if the system runs up to 115K, one need not worry about terminating resistors.

Labeling of the terminals

The standard shows A and B. Unfortunately, early in the RS485's history, a semiconductor maker mislabeled these pins on a RS485 driver IC datasheet. This caused mass confusion for manufacturers who referenced this datasheet and incorrectly transposed the pin labels. Some manufacturers noticed the error and amended their labeling.

The consequence of this is that there are many products which have incompatible labeling. The solution is to swap the wiring around (the same workaround as for the RS232). Define labels all its products as D+, D- and Sgnd. For wiring a system together, simply connect all D+ together as with D- and Sgnd.

RS422: In decline

See Full List On Usconverters.com

The RS422 port was the predecessor to the RS485 port and is becoming less and less common today. The main difference is that the RS422 port has separate drivers for Transmit and Receive. Hence instead of 3 wires, 5 wires are required for a RS422 bus. Many of the same advantages of the RS485 BUS are retained in the RS422 BUS.

Db9 Serial Port

READ: How Engineers Find Information to Decide what to Specify and Buy for their Engineering Solution

Conclusion

Pc Db9 Pinout

This paper gives a bit of history of the three different serial interfaces commonly used today. It explains common issues found in setting up such a system and the benefits of the three different connections. Although both the RS232 and RS422 connections are in decline today, the many benefits of the RS485 connection will ensure that it will remain relevant for many years to come.

See Full List On Pinoutguide.com

The many benefits of the RS485 connection ensure that it will remain relevant for many years to come.