Serial Ports

 < Day Day Up > 

The serial port , also known as RS-232 or COM (communication) ports (see Figure 8.4), historically has rivaled the parallel port in versatility. Serial ports have been used to connect

  • External modems

  • Serial mouse or pointing devices such as trackballs or touchpads

  • Plotters

  • Label printers

  • Serial printers

  • File transfer programs such as Direct Cable Connection, LapLink, and Interlink

Figure 8.4. A 9-pin serial port (DB-9M connector, top) and a 25-pin serial port (DB-25M connector, bottom) on a typical extension bracket from an ISA multi-I/O card. The ribbon cables used to connect the ports to the card can be seen in the background.

graphics/08fig04.gif

How do serial ports compare in speed with parallel ports? Serial ports transmit data one bit at a time (parallel ports send and receive data eight bits at a time), and their maximum speeds are far lower than parallel ports. However, serial cables can carry data reliably at far greater distances than parallel cables. Serial ports, unlike parallel ports, have no provision for daisy-chaining; only one device can be connected to a serial port. It's no wonder that a lot of devices that formerly plugged into the serial port are now calling the USB port "home port."

Serial ports come in two forms:

  • DB-9M (male)

  • DB-25M (male)

Either type can be adapted to the other connector type with a low-cost adapter (see Figure 8.5). The difference is possible because serial communications need only a few wires. Unlike parallel printers, which use a standard cable, each type of serial device uses a specially wired cable. DB-9M connectors are used on all but the oldest systems.

Figure 8.5. A typical DB-25F to DB-9M serial port converter. The DB-25F connector (lower left) connects to the 25-pin serial port and converts its signals for use by devices attaching to the DB-9M port at the other end (upper right).

graphics/08fig05.jpg

graphics/note_icon.gif

The DB-9 (9-pin male) connector is the more common of the two serial port connector types. The 25-pin serial port has many additional pins but is seldom used today. The major difference between it and the 9-pin serial interface is the 25-pin port's support for current loop data, a type of serial communication primarily used for data collection in industrial uses.


Serial Port Pinouts

At a minimum, a serial cable must use at least three wires, plus ground:

  • A transmit data wire

  • A receive data wire

  • A signal wire

Tables 8.3 and 8.4 can be used to determine the correct pinout for any specified serial cable configuration. Unlike parallel devices, which all use the same standard cable wiring, serial devices use differently wired cables. A modem cable, for example, will be wired much differently than a serial printer cable. And different serial printers might each use a unique pinout.

Table 8.3. 9-Pin Serial Port Pinout

Use

Pin

Direction

Carrier Detect

1

In

Receive Data

2

In

Transmit Data

3

Out

Data Terminal Ready

4

Out

Signal Ground

5

Data Set Ready

6

In

Request to Send

7

Out

Clear to Send

8

In

Ring Indicator

9

In

Table 8.4 lists the pinouts for the 25-pin connector; unused pins are omitted.

Table 8.4. 25-Pin Serial Port Pinout

Use

Pin

Direction

Transmit Data

2

Out

Receive Data

3

In

Request to Send

4

Out

Clear to Send

5

In

Data Set Ready

6

In

Signal Ground

7

Received Line Signal Indicator

8

In

+ Transmit Current Loop Data

9

Out

- Transmit Current Loop Data

11

Out

+ Receive Current Loop Data

18

In

Data Terminal Ready

20

Out

Ring Indicator

22

In

- Receive Current Loop Return

25

In

When a 9-pin to 25-pin serial port adapter is used (see Figure 8.5), the pins are converted to the more common 25-pin connector (see Table 8.5).

Table 8.5. 9-Pin to 25-Pin Serial Port Converter/Serial Modem Pinout

Use

Pin # (9-Pin)

Pin # (25-Pin)

Carrier Detect (CD)

1

8

Receive Data (RD)

2

3

Transmit Data (TD)

3

2

Data Terminal Ready (DTR)

4

20

Signal Ground (SG)

5

7

Data Set Ready (DSR)

6

6

Request to Send (RTS)

7

4

Clear to Send (CTS)

8

5

Ring Indicator (RI)

9

22

Serial ports assume that one end of the connection transmits and the other end receives.

Types of Serial Cables

Serial cables, unlike parallel cables, can be constructed in many different ways. In fact, cables for serial devices are usually specified by device type rather than port type. This is because different devices use different pinouts.

Some of the most common examples of serial cables include

  • Null-modem (data transfer) cable

  • Modem cable

A null-modem cable enables two computers to communicate directly with each other by crossing the receive and transmit wires (meaning that two computers can send and receive data, much like a computer network, though much slower). The best known of these programs is LapLink, but the Microsoft MS-DOS Interlink and Windows Direct Cable Connection/Direct Serial Connection utilities can also use this type of cable. Although these programs support serial cable transfers, parallel port transfers are much faster and are recommended with MS-DOS and most versions of Windows. However, Windows NT 4.0 and earlier do not support using the parallel port for file transfers, so you must use a null-modem cable such as the one shown in Figure 8.6.

Figure 8.6. A LapLink serial cable with connectors for either 25-pin or 9-pin serial ports. Only three wires are needed, enabling the cable to be much thinner than the 9-pin serial extension cable also shown.

graphics/08fig06.jpg

A modem cable is used to connect an external modem to a serial port. Some modems include a built-in cable, but others require you to use a DB-9F to DB-25M cable from the 9-pin connector on the serial port to the 25-pin port on the modem. This cable typically uses the same pinout shown in Table 8.5.

What about serial printers? These printers are used primarily with older terminals rather than with PCs, and because different printers use different pinouts, their cables must be custom made. In fact, I've built a few myself . Fortunately, most recent terminals use parallel printers.

Standard IRQ and I/O Port Addresses

Serial ports require two hardware resources: IRQ and I/O port address. Table 8.6 lists the standard IRQ and I/O port addresses used for COM ports 14. Some systems and add-on cards enable alternative IRQs to be used.

Table 8.6. Standard Settings for COM (Serial) Ports 14

COM Port #

IRQ

I/O Port Address

1

4

3F8-3FFh

2

3

2F8-2FFh

3

4

3E8-3EFh

4

3

2E8-2EFh

Note that serial ports never require a DMA channel (and thus can't have DMA conflicts with other devices). However, there's another way to stumble when working with serial ports: IRQ conflicts. IRQ 4 is shared by default between COM 1 and COM 3 ; IRQ 3 is shared by default between COM 2 and COM 4 . However, with ISA serial ports (including those on the motherboard), sharing does not mean that both serial ports can be used at the same time. If a device on COM 1 and a device on COM 3 that share the same IRQ are used at the same time, both devices will stop working and they might shut down the system.

The most common situation that causes such a conflict is the use of a mouse connected to COM 1 and a modem connected to COM 3. Use the modem, and the mouse quits working (and so does Windows).

As you saw in Chapter 2, "PC Anatomy 101," this happens because computers are interrupt driven ; they use IRQs to determine which device needs to be listened to. When one device (the mouse) is already using the IRQ, the other device (the modem) gets a busy signal.

tip

graphics/tip_icon.gif

You can avoid IRQ conflicts between COM ports by

  • Using only two COM ports in your system

  • Not using devices connected to COM 1 and COM 3 or COM 2 and COM 4 at the same time


Just as the only solution to busy signals is a second phone line, the preferred solution to IRQ conflicts is to move the second device using an ISA IRQ to a different IRQ. Your ability to do this depends on the serial port.

How to Configure or Disable Serial Ports

Depending on the location of the serial port, there are several ways to configure the port settings to select different IRQ and I/O port addresses for a serial port, or to disable the serial port. These include

  • BIOS setup program for built-in ports

  • Mechanical ( jumper blocks or DIP switch) or software configuration for I/O cards in expansion slots

  • Plug and Play (PnP) mode for use with Windows 9x/Me/2000/XP

To adjust the configuration of a serial port built into the system's motherboard

  1. Start the BIOS setup program.

  2. Go to the peripherals configuration screen.

  3. Select the serial port you want to adjust.

  4. To change the port's configuration, choose the IRQ and I/O port address you want to use, or select Disabled to prevent the system from detecting and using the serial port (see Figure 8.7).

    Figure 8.7. A typical BIOS I/O device configuration screen with the first serial port enabled, the second port disabled, and IR (infrared) support disabled.

    graphics/08fig07.gif

  5. Save changes and exit; the system reboots.

To adjust the configuration of an old-school serial port on an I/O card that uses jumper blocks or DIP switches

  1. Turn off the system's power.

  2. Remove the serial port or multi-I/O card.

  3. Locate the jumper blocks or DIP switches for the serial port you want to adjust.

  4. Move the jumper blocks or DIP switches to select the IRQ and I/O port address you want to use, or adjust the jumper blocks or DIP switches to disable the port. See the card's manual for details, or look for settings silk-screened on the card.

  5. Reinsert the card into the expansion slot.

  6. Restart the system.

Many recent systems will display the new port or new configuration during the initial bootup process.

graphics/arrow_icon.gif

To learn more, see "How the BIOS Displays Your PC's Components," p. 73 .


To adjust the configuration of a serial port using a configuration program, start the configuration program, select the serial port, select the IRQ and I/O port address desired or select the Disable Port option, save the changes, and exit.

Serial ports on PCI cards are configured by the PnP BIOS. In some cases, you can use the Windows Device Manager to change the port configuration (see Chapter 19 for details).

Serial Port Software Configuration

Unlike parallel ports, serial ports have many different configuration options, making successful setup more challenging. Through software settings at the computer end, and by hardware or software settings at the device end, serial devices can use

  • A wide variety of transmission speeds, from as low as 300bps to as high as 115,200bps or faster

  • Different word lengths (7 bit or 8 bit)

  • Different methods of flow control (XON/XOFF or DTR/DSR)

  • Different methods of ensuring reliable data transmission (even parity, odd parity, no parity, 1-bit or 2-bit parity length)

Although simple devices such as a mouse or a label printer don't require that these settings be made manually (the software drivers do it), serial printers used with PCs running terminal-emulation software, PCs communicating with mainframe computers, serial pen plotters, serial printers, and PCs using modems often do require that these options be set correctly. Both ends of a serial connection must have these configurations set to identical values, or the communications between your computer and the other device will fail.

Figure 8.8 illustrates how Windows XP configures the port speed, flow control, and hardware settings for a serial port connected to an external modem.

Figure 8.8. General (left) and Advanced (right) dialog boxes used in Windows XP to configure a serial port connected to an external modem.

graphics/08fig08.jpg

Serial Port UARTs

All serial ports are connected to a UART (Universal Asynchronous Receive Transmit ) chip or a multifunction chip that emulates a UART. The UART chip is the "heart" of the serial port because it does the actual transmitting and receiving of data. If you've ever wondered why some serial ports are faster than others, the UART chips used by the serial ports may be the most likely reason. Problems with serial ports that cannot run fast enough to reliably receive and transmit to a particular device, or are unable to run in a multitasking environment such as Windows, can often be traced back to an obsolete UART chip. There are several major types of UART chips:

  • 8250 series The 8250 series of UARTs are not fast enough to support modems running faster than 9,600bps. They have no means to buffer received data, and will drop characters if used with Windows. This chip was used primarily in IBM PC and PC/XT-type computers. The 8250B is the best chip of this series, but it's long out of date.

  • 16450 The 16450 UART will run reliably at speeds up to 19,200bps. It was introduced with the IBM AT, but it's also pass.

  • 16550A This series of UARTs has a 16-byte FIFO (first in, first out ) buffer for reliable multitasking without data loss and can run at speeds of up to 115,200bps. This is the standard UART used in the serial ports included on virtually all Pentium-class or better motherboards.

  • 16650, 16750, 16850, 16950 These UARTs have 32-byte or larger FIFO buffers (16750 has 64-byte FIFO, 16850/16950 have 128-byte FIFO buffers) and support speeds of 230,400bps up to 921,400bps; special serial port and multi-I/O cards often include one or more of these UARTs.

You can use the Windows 9x/Me (but not Windows 2000/XP) Modem Diagnostics to determine the UARTs installed in a system. Follow this procedure:

  1. Open the Control Panel icon.

  2. Open the Modems icon.

  3. Click the Diagnostics tab (see Figure 8.9).

    Figure 8.9. You can determine the IRQ, I/O port address, and UART type for any COM port or modem in your Windows 9x/Me system with the Diagnostics tab for modems.

    graphics/08fig09.gif

  4. Select a serial port or modem.

  5. Click the More Info button.

  6. The port or modem's IRQ, starting I/O port address, and UART type will be displayed. Additional information will be displayed if you selected a modem.

In such cases, you can replace obsolete UARTs by disabling the existing serial ports (see "How to Configure or Disable Serial Ports," earlier in this chapter), and then add a faster serial port card containing a fast UART. Systems built since the late 1990s (such as those running Windows 2000 or Windows XP) already have 16550A or faster UARTs (or equivalents) installed so you don't need to worry about having outdated UARTs installed.

Don't like the UART in your system? If a system or I/O card uses a socketed 16450 chip, you can replace it with a 16550A or better chip to upgrade the UART. However, most recent computers and I/O cards use a Super I/O chip that contains a UART equivalent and LPT port inside a custom chip, rather than using a standard UART chip. Some recent motherboards don't even have a separate Super I/O chip; the South Bridge chip on the motherboard contains the Super I/O features plus ATA/IDE ports, USB ports, and other functions. To upgrade these systems, disable the serial port function in the system BIOS and install a serial or multi-I/O card that uses a faster UART. Virtually all serial or multi-I/O cards on the market today use 16550A or faster UARTs or UART equivalents.

Adding Additional Serial Ports

You can add additional serial ports to a system with any of the following:

  • ISA-based serial or multi-I/O card

  • PCI-based serial or multi-I/O card

  • USB-to-parallel-port adapter

Install a PCI card in a PCI slot and an ISA card in an ISA slot. ISA cards that are not PnP should be manually configured to use available IRQ, I/O port address, and DMA channel resources. Use the Windows Device Manager to determine available resource settings (see Chapter 19 for details).

A USB-to-serial-port adapter has a USB Type A connection at one end and a 9-pin serial port at the other end. This adapter enables you to connect a serial device to your USB port so you can use the serial port for other devices.

 < Day Day Up > 


Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 310

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net