Linux

  1. Home
  2. Computing & Technology
  3. Linux

Text-Terminals on Linux

From Authors, for About.com

11.3 Direct Serial Cable Connection.

The simplest way to connect a terminal to a host computer is via a direct connection to a serial port on the computer. You may also use some the info in this section for connecting one computer to another (via the serial port). Most desktop PC's come with a serial port or two, one of which may be used by a mouse. For the EIA-232 port, you need a null modem cable (PC-to-PC cable) that crosses over the transmit and receive wires. In ethernet terminology it would be called a "crossover cable" (but the ethernet cable will not work for the serial port). If you want hardware flow control, you will probably use the DTR pin (or both the DTR and DSR pins).

Make sure you have the right kind of cable. A null modem cable bought at a computer store may do it (if it's long enough), but it probably will not work for hardware flow control. Such a cable may be labeled as a serial printer cable. Only larger computer stores are likely to stock such cables. A "modem cable" will not work since the wires go straight thru (and don't cross over). See Buy or Make your own cable. Make sure you are connecting to your PC's serial port at the male DB25 or the DB9, and not to your parallel port (female DB25).

Pin numbering

Pin numbers are often printed on the plastic right next to the pins. You may need a bright light and/or a magnifying glass to read them. Looking at the male pins of a DB connector with the wider row up, the pin in the upper left is 1 (there is no pin 0). Then the next pin in this row is 2, etc. At the end of this row is pin 5 or 13. Then the next pin (6 or 14) is in the next row all the way to the left and below pin 1. If you look at the female connector with the wider row up, then pin 1 is in the upper right corner.

Null Modem cable pin-out (3, 4, or 5 conductor)

These 3 diagrams are for real text-terminals. But you could use them to connect up 2 PCs if you substitute RTS for DTR and CTS for DSR. (Don't use 4-conductors for PC-to-PC). For terminals, if you only have DTR flow control (one-way) you may eliminate the RTS-to-DSR wire. If you have no hardware flow control, then you may also eliminate the CTS-to-DTR wire. Then if you have 2@ twisted pairs, you may then use 2 wires for signal ground per A Kludge using Twisted-Pair Cable. For a DB25 connector on your PC, you need:

[blockquote shade=yes]
PC male DB25 Terminal DB25
TxD Transmit Data 2 --> 3 RxD Receive Data
RxD Receive Data 3 <-- 2 TxD Transmit Data
SG Signal Ground 7 --- 7 SG Signal Ground
CTS Clear To Send 5 <--20 DTR Data Terminal Ready
RTS Request To Send 4 --> 6 DSR Data Set Ready
[/blockquote]

If you have a DB9 connector on your PC, try the following:

[blockquote shade=yes]
PC DB9 Terminal DB25
RxD Receive Data 2 <-- 2 TxD Transmit Data
TxD Transmit Data 3 --> 3 RxD Receive Data
SG Signal Ground 5 --- 7 SG Signal Ground
CTS Clear To Send 8 <--20 DTR Data Terminal Ready
RTS Request To Send 7 --> 6 DSR Data Set Ready **
[/blockquote]

If you have a DB9 connector on both your serial port and terminal:

[blockquote shade=yes]
PC DB9 Terminal DB9
RxD Receive Data 2 <-- 3 TxD Transmit Data
TxD Transmit Data 3 --> 2 RxD Receive Data
SG Signal Ground 5 --- 5 SG Signal Ground
CTS Clear To Send 8 <-- 4 DTR Data Terminal Ready
RTS Request To Send 7 --> 6 DSR Data Set Ready **
[/blockquote]

The above don't have modem control lines so be sure to give a "local" option to getty (which is equivalent to "stty clocal").

* License

* Text Terminal How-To Index

Explore Linux

About.com Special Features

Linux

  1. Home
  2. Computing & Technology
  3. Linux
  4. Linux HowTos
  5. Text-Terminals How-To
  6. Text-Terminals on Linux - 11.3 Direct Serial Cable Connection.

©2009 About.com, a part of The New York Times Company.

All rights reserved.