You are on page 1of 16

40

SERIAL (RS232) PORT TROUBLESHOOTING

CONTENTS AT A GLANCE Understanding Asynchronous Communication


The data frame Signal levels Baud vs. bps

IrDA Port Issues


Installing the IrDA driver(s) Removing the IrDA driver(s) IrDA tips

Troubleshooting the Serial Port Understanding the Serial Port


Addresses and interrupts DTE vs. DCE Serial-port conflicts Match the settings Frame it right Finding a port address with debug General symptoms

Serial-Port Signals
TX and RX RTS and CTS DTR and DSR DCD RI

Further Study

Although the parallel port is slowly gaining acceptance as a peripheral communication


port, early PCs used the parallel port almost exclusively for local printers. As more and more peripherals became available for the PC, alternative methods of communication were required that were ill-suited for parallel connections at the time. The Electronics In1176

UNDERSTANDING ASYNCHRONOUS COMMUNICATION

1177

dustry Association (EIA) developed a standard for serial communication. Instead of sending eight bits at a time over a set of data lines, only two data lines were used: one to transmit data and one to receive data. The EIA denoted its serial standard as RS-232 (or simply the serial port). A serial port offers several distinct advantages over early parallel ports. First, the serial port was designed to be bi-directional, right from the start. This made serial the preferred method for interactive devices, such as modems, mice, etc. Second, the serial port used fewer physical signal lines than the parallel port. This made cabling less expensive and reduced potential connector problems. Where a printer cable is generally limited to two meters in length, a serial cable can easily exceed 60 meters. This difference opened the way for basic local networking. This chapter shows you the essential concepts of serial communication and port operation, then guides you through a series of troubleshooting procedures.

Understanding Asynchronous Communication


The serial port is not terribly difficult to grasp, but its operation is a bit more involved than that of a parallel port. To appreciate the operations and signals of a typical serial port, you should be familiar with a variety of concepts. When a parallel port strobes a printer, the printer knows that all eight bits of data are available and valid. However, a serial port must send or receive eight data bits one at a time over a single data line. As you might imagine, this presents some serious challenges for the receiving device which must determine where the data stream starts and endshardly a simple task. It is certainly possible to send a synchronizing clock signal along with the data wire. The receiving device could easily use the clock to detect each data bit. This technique is known as synchronous serial communication. It is reliable, but rarely used in PCs (other than the keyboard interface). Instead of using a discrete clock signal to accompany the data, it is possible to eliminate the clock by embedding synchronization information along with the data bits. Thus, when a data stream reaches a receiving device, it can strip away the synchronization bits, leaving the original data. As a result, serial communication is not constrained by a clock. This is asynchronous communicationa popular and inexpensive serial technique. The remainder of this chapter deals with asynchronous communication.

2
SYSTEM DATA AND TROUBLESHOOTING

THE DATA FRAME


Asynchronous communication requires that data bits be combined with synchronization bits before transmission. Synchronization bits provide three important pieces of information to the receiving device: where the data starts, where the data ends, and if the data is correct. These bits, combined with the data byte, form the data frame (Fig. 40-1). The first thing you should notice about serial data is that it is bi-polarthat is, there are both positive and negative voltages. Contrary to what you might guess, a + voltage represents a logical 0 (called a space), and a -voltage represents a logical 1 (called a mark). The next thing you should note is that the serial signal line is normally idle in the logic 0 (space) state.

1178

SERIAL (RS232) PORT TROUBLESHOOTING

V Logic 0 (space)

1 V Logic 1 (mark)

0 S t a r t b i t

1 P a r i t y b i t

0 S t o p b i t (s)

Data bits

FIGURE 40-1

A typical data frame.

The first element of all asynchronous data frames is a single start bit, which is always a logic 1 (mark). When the receiver detects a logic 1, it knows the data frame has started. The next five to eight bits are always the data bits. The exact number of bits (usually eight) can be set by the communication software, but must be the same at both the transmitting and receiving ends. After data, a single error-checking bit (called a parity bit) can be included, if desired. Parity is calculated at the sending device and sent with the word. Parity is also calculated at the receiving device and checked against the received parity bit. If the two match, the data is assumed to be correct. If the two do not match, an error is flagged. There are five classes of parity:
s None No parity bit is added to the word. This is typical for much of todays serial com-

munication.
s Even If the number of 1s in the data word is odd, parity is set to 1 to make the number

of 1s even.
s Odd If the number of 1s in the data word is even, parity is set to 1 to make the number

of 1s odd.
s Mark Parity is always set to 1. s Space Parity is always set to 0. Many communication connections today abandon the use of parity in favor of the more reliable and sophisticated Cyclical Redundancy Check (CRC). A CRC has the same effect as a parity check, but instead of checking one byte at a time, an entire block of data is checked.

The last part of the data frame is the stop bit(s)typically only one, but two can be used. Stop bits are always logic 0 (space). After the receiving device detects the stop bit(s), the line remains idle in the space condition, awaiting the next subsequent start bit. Framing is

UNDERSTANDING ASYNCHRONOUS COMMUNICATION

1179

usually denoted as data/parity/stop. For example, the connection to a BBS typically uses 8/N/1 framing (8 data bits/no parity bit/1 stop bit).
One of the most important aspects of serial communication is that both the receiving and transmitting ends must be configured for the exact same data frame. If both ends are not configured identically, serial data will misinterpreted as meaningless garbage.

SIGNAL LEVELS
Where the parallel port uses TTL-compatible logic signals in its communication, a serial port uses bi-polar signaling (both positive and negative voltages). The advantage of bi-polar signaling is that it supports very long cabling with minimum noise. A logic 0 (space) condition is represented by a positive voltage between +3 Vdc and +15 Vdc. A logic 1 (mark) condition is represented by a negative voltage between 3 Vdc and -15 Vdc. On the average, you can expect to see serial ports using 5 Vdc or 12 Vdc because those voltages are already produced by the PC power supply.

2
SYSTEM DATA AND TROUBLESHOOTING

BAUD VS. BPS


Another key concept of asynchronous communication is the idea of rate. Because data is traveling across a serial link versus time, the rate at which that data passes becomes an important variable. Although rate is not a literal part of the data frame, it is every bit as important. Simply stated, data rates are measured in Bits Per Second (bps). This is a simple and intuitive measurement. If the serial port is delivering 2400bits in one second, it is working at 2400bps. At that rate, the average bit is (1/2400bps) = 417 s. When you are dealing with a serial port, you are dealing with bps. Traditionally, when the bits from a serial port are processed through a modem, a modem will modulate the data through a series of phase, frequency, or amplitude transitions. A transition is referred to as a baud (named for French mathematician J.M.E. Baudot). Older modems that were designed to operate with signal rates of 2400bps or less could modulate the telephone line at the bit ratethus, baud would be the same as bps. However, this is a faulty comparison. Because later modems were restricted by the limited bandwidth of a telephone line, modems had to encode more than one bit in every transition. As a result, the effective bps of a modern modem usually exceeds its baud rate by several times. For example, a modem that can encode 4bits in every transition can work at 2400baud, yet be sending the equivalent of 9600bps. See the difference? As modems evolved to encompass data compression standards, effective bps has been increased even more (yet the modem still only works at a relatively low baud rate). When you are dealing with modems, you are usually talking about baud rates. You need to be aware of another catch. Because baud refers to any transition (Baudot never said a word about modems), it is technically valid to measure serial port speed in baud, although it can be terribly confusing. For example, todays serial-port circuits can sustain data rates of 115,200bps. Now, because every bit from the serial port is treated as a transition by local devices, such as printers, it becomes just as correct to say 115,200baud. The thing to remember here is that most modems dont operate over

1180

SERIAL (RS232) PORT TROUBLESHOOTING

2400baud. The telephone line just cannot handle faster signal rates. So, if you see high baud rates quoted in books or specifications, it probably refers to the performance of the serial port, not the modem.

Understanding the Serial Port


A serial port must be capable of several important operations. It must convert parallel data from the PC system bus into a sequence of serial bits, add the appropriate framing bits (which might be changed for different serial connections), then provide each if those bits to the data line at the proper rate. The serial port must also work in reverse, accepting serial data at a known rate, stripping off the framing bits, converting the serial data bits back into bus form, and checking blocks of data for accuracy. The heart of the serial port is a single ICthe Universal Asynchronous Receiver/Transmitter (UART). A simplified block diagram for a serial port is illustrated in Fig. 40-2. The UART connects directly to the PC bus architectureeither added to the motherboard or incorporated on an expansion board. A UART IC contains all of the internal circuitry necessary to process, transmit, and receive data between the serial line and the PC bus. Since the UART is programmable, its configuration (i.e., framing format and baud rate) can be set through DOS or Windows communication software. All data output, data input, and handshaking signals needed by the serial port are generated within the UART itself. It is interesting that the UART is powered by +5 Vdc only, just like any other ASIC in the system. This means that data and handshaking signals entering and leaving the UART are all TTLcompatible. Transmitted data is converted to bi-polar signals through a line-driver IC. BiPC bus Address decoder Control logic Line drivers and receivers IRQ RTS CTS DTR DSR DCD RI

Tx buffer Data bus buffer

Tx logic

Tx shift reg.

Line driver

Tx

Rx buffer

Rx logic

Rx shift reg.

Line receiver

Rx

UART registers FIGURE 40-2 Block diagram of a UART.

UNDERSTANDING THE SERIAL PORT

1181

polar data that appears on the receive line is converted back to TTL levels through a linereceiver IC. All that remains is the port connector itself. The original serial-port design used a 25-pin male sub-miniature D-type connector, but newer ports have abandoned the extra handshaking signals to accommodate a 9-pin male sub-miniature D-type connector.

ADDRESSES AND INTERRUPTS


The UART is controlled through a series of important registers that allow the serial-port characteristics to be programmed, channel transmitted, and received data, as required. Older BIOS versions supported only two serial (or COM) ports, but newer BIOS releases support four COM ports (designated COM1, COM2, COM3, and COM4). MicroChannel bus systems can support up to eight COM ports (COM1 through COM8). The typical base addresses for the COM ports are shown in Table 40-1. When a new COM port is installed in the system, it must be assigned to a valid base address and interrupt (IRQ). During actual operation, communication software deals with each port register individually. Table 40-2 lists the standard base address offsets for UART registers. With no offset, both transmit and receive registers are available. During system initialization, COM ports are checked in the following order: 03F8h, 02F8h, 03E8h, 02E8h, 03E0h, 02E0h, 0338h, and 0238h (MicroChannel systems use a different order), and COM designations are assigned, depending on what ports are actually found. The COM addresses might be exchanged, depending on your particular system. In virtually all cases, COM1 is available at 03F8h. The specific I/O addresses for each COM port are kept in the BIOS data area of RAM, starting at 0400h. As you might expect, only one COM port can be assigned to a base address. If more than one COM port is assigned to the same base address, system problems will almost certainly occur.
TABLE 40-1 TYPICAL SERIAL PORT ADDRESSES AND IRQ ASSIGNMENTS BUS ARCHITECTURE All Systems All Systems ISA* ISA ISA ISA ISA ISA MCA MCA MCA MCA MCA MCA PORT COM1 COM2 COM3 COM4 COM3 COM4 COM3 COM4 COM3 COM4 COM5 COM6 COM7 COM8 ADDRESS 03F8h 02F8h 03E8h 02E8h 03E0h 02E0h 0338h 0238h 3220h 3228h 4220h 4228h 5220h 5228h IRQ IRQ4 IRQ3 IRQ4 IRQ3 IRQ4 IRQ3 IRQ4 IRQ3 IRQ3 IRQ3 IRQ3 IRQ3 IRQ3 IRQ3

2
SYSTEM DATA AND TROUBLESHOOTING

* Systems with DOS 3.3 and later

1182

SERIAL (RS232) PORT TROUBLESHOOTING

TABLE 40-2 TYPICAL UART REGISTER ADDRESS OFFSETS REGISTER Receive register Transmit register Interrupt enable register Interrupt ID register Data frame register UART control register Serialization status register UART status register General-purpose register OFFSET 00h 00h 01h 02h 03h 04h 05h 06h 07h

The use of interrupts in conjunction with COM ports can easily be confusing. Unlike parallel ports, which can be polled by BIOS, a serial port demands the use of interrupts. Because early PCs allocated space for two COM ports, only two IRQ lines were reserved (IRQ4 for COM1 and IRQ3 for COM2). Unfortunately, when PC BIOS expanded its support for additional COM ports, no extra IRQ lines were available to assign. Thus, COM ports had to share interrupts. For example, COM1 and COM3 must share IRQ4, while COM2 and COM4 must share IRQ3. The problem is that no two devices can use the same IRQ at the same timeotherwise, a system conflict will result. Ultimately, though, a typical PC can use four COM ports, only two of the four can be used at any one time (i.e., COM1 and COM2, COM3 and COM4, COM1 and COM4, or COM2 and COM3). Further, the assignment of COM port address and IRQ lines must match. Although COM3 and COM4 can be polled by BIOS, the speed and asynchronous nature of contemporary data transmission make polling very unreliable for serial ports. Always begin a service examination by checking the number of serial ports in your system. Serial ports are so simple and easy to add to various expansion cards that you might exceed the maximum number of ports or allow two ports to conflict without even realizing it. Be sure to remove or disable any unused or conflicting COM ports by removing the offending port or disabling it through jumpers or DIP switches.

DTE VS. DCE


As you work with serial ports and peripherals, you will often see the acronyms DTE and DCE used very frequently. DTE represents Data Terminal Equipment, which is typically the computer containing the serial port. The modem, serial printer, or other serial peripheral is referred to as the Data Carrier Equipment (DCE). The distinction becomes important because the data and handshaking signals are swapped at the DCE end. For example, the Tx pin (usually on pin 3 of a 9-pin DTE) cannot connect directly to the same pin on the DCEit must route to the Rx pin instead. The DCE connector makes those swaps, so pin 3 of the DCE would be the Rx pin, and a straight-through cable can be used without difficulty.

SERIAL-PORT SIGNALS

1183

However, suppose that two DTEs had to be connected. Because both devices carry the same signals on the same pins, a straight-through cable would cause confusion (e.g., the Tx line would connect to the Tx line on the other device, Rx would connect to Rx, etc.). As you can imagine, two DTEs can not be connected with a straight-through cable. Of course, a specialized cable can be built containing the proper wire swaps, but an easier alternative is simply to use a null-modem, which plugs into one end of the straight-through cable. The null-modem is little more than a jumper box that contains all of the proper swaps. This allows two DTEs to work as if one were a DTE and one were a DCE.

Serial-Port Signals
IBM and compatible PCs implement a serial port as either a 25-pin or 9-pin sub-miniature D-type connector (Fig. 40-3). Both ends of the serial cable are identical. Be concerned with three types of signals in a serial connection: data lines, control (or handshaking) lines, and ground lines. Table 40-3 identifies the name and description of each conductor for both 25-pin and 9-pin serial connections. Remember that all data and control signals on the serial port are bi-polar.

2
SYSTEM DATA AND TROUBLESHOOTING

25-pin M

9-pin M

FIGURE 40-3

Serial port connectors.

TABLE 40-3 SERIAL PORT CONNECTOR PINOUTS (AT THE PC END) 25-PIN CONNECTOR 1 2 3 4 5 6 7 8 9 11 18 20 22 23 25 9-PIN CONNECTOR n/a 3 2 7 8 6 5 1 n/a n/a n/a 4 9 n/a n/a

SIGNAL Protective ground Tx Transmit data Rx Receive data RTS Request to send CTS Clear to send DSR Data set ready Signal ground DCD Data carrier detect + Transmit current loop Transmit current loop + Receive current loop DTR Data terminal ready RI Ring indicator DSRD Data signal-rate indicator Receive current loop

DIRECTION n/a Output Input Output Input Input n/a Input Output Output Input Output Input I/O Input

1184

SERIAL (RS232) PORT TROUBLESHOOTING

TX AND RX
Rx and Tx are simply the data lines into and out of the port. Tx is the Transmit line, which outputs serial data from the PC, and Rx is the Receive line, which accepts serial data from the serial peripheral.

RTS AND CTS


The RTS (Request to Send) signal is generated by the DTE. When asserted, it tells the DCE (i.e., the modem) to expect to receive data. However, the DTE cant just dump data to DCE. The DCE must be ready to receive the data, so after the RTS line is asserted, the DTE waits for the CTS (Clear to Send) signal back from the DCE. Once the DTE receives a valid CTS signal, it can begin transferring data. This RTS/CTS handshake forms the basis for data flow control.

DTR AND DSR


When the DTE is turned on or initialized and ready to begin serial operation, the DTR (Data Terminal Ready) line is asserted. This tells the DCE (i.e., modem) that the DTE (i.e., computer) is ready to establish a connection. When the DCE has initialized and is ready for a connection, it will assert the DSR (Data Set Ready) line back to the DTE. Once the DTE is ready and recognizes the DSR signal, a connection is established. This DTR/DSR handshake is established only once when the DTE and DCE devices are first initialized, and it must remain active throughout the connection. If either the DTR or DSR signal should fall, the communication channel will be interrupted (and the RTS/CTS handshake will no longer have any effect).

DCD
The DCD (Data Carrier Detect) signal is particularly useful with modems. It is produced by the DCE when a carrier is detected from a remote target, and the DCE is ready to establish a communications pathway. The DCD signal is then sent back to the DTE. Once the DCD line is asserted, it will remain so as long as a connection is established.

RI
The RI (Ring Indicator) signal is asserted by the DCE, and is also particularly useful with modems. It is produced by the DCE when a telephone ring is detected. This becomes a vital signal if it is necessary for a remote user to call in and access your computer (i.e., a BBS configuration).

IrDA Port Issues


A growing number of desktop and laptop PCs (and their peripherals) are being equipped with infrared ports (dubbed IrDA by the Infrared Desktop Association). IrDA ports allow PCs and peripherals to communicate serially over an infrared link, rather than going

IrDA PORT ISSUES

1185

through the hassle of using cables. For example, you can type a document on a laptop, then move the laptop into the vicinity of an IrDA printer and print the document without ever attaching a cable. Although IrDA ports offer some real connectivity benefits to PC users, they also present some problems with installation and configuration. Windows 95 requires IrDA drivers to be loaded on the system.

INSTALLING THE IRDA DRIVER(S)


If you already have a PC fitted with IrDA support, you simply need to use the Add new hardware wizard to install a new set of drivers, or use the Add infrared device wizard from the IR icon in the Control panel. If youll be installing IrDA support for the first time, download the newest IR drivers from the Microsoft Web site (http://www.microsoft.com), and run SETUP.EXE:
s When the Add infrared device wizard prompts to choose a manufacturers name for the

IR device, choose Standard infrared devices if the computer has a built-in device or choose the name of the manufacturer and the model of the adapter if an IR adapter is attached to the computer. Click the Next button. When the Add infrared device wizard prompts to choose the communications port that the IR device is physically connected to, click the port from the list. If youre uncertain which physical communications port the IR device is using, select the first COM port in the list (for example, COM1), then click the Next button. When the Add infrared device wizard prompts to select the virtual COM and LPT ports, accept the default values by clicking the Next button. After the wizard copies the IR communications driver files to the hard disk, watch for the wizard to display two New hardware found messages. When prompted by the Add infrared device wizard, click the Finish button to complete the IR device installation (if the wizard did not display New hardware found messages, then restart the computer). Activate the IR device by doubleclicking the Infrared icon in the Control panel. If no Infrared icon is in the Control panel, select the Refresh option from the Control panel view menu (or press the <F5> function key) to make the Infrared icon appear.

2
SYSTEM DATA AND TROUBLESHOOTING

The next step is to test the IR device. The easiest and quickest way to do this is to print over an IrDA link to an IR printer or exchange data between two computers using the IR link (and a communications application, such as LapLink).
You must always remove any previously installed version of the IrDA communications driver before installing a new driver. For example, if an early beta release of the version 2.0 driver is installed, it must be removed before installing the current Version 2.0 release.

REMOVING THE IRDA DRIVER(S)


In some instances, it might be necessary to remove the IR communication drivers (most often when upgrading the drivers or IR adapter hardware). The IR communication drivers

1186

SERIAL (RS232) PORT TROUBLESHOOTING

can be removed either by using Add/remove programs in the Control panel or by using the Device manager. Using Add/remove programs in the Control panel:
s Click the Start button and select the Settings option, then select Control panel. s Doubleclick Add/remove programs in the Control panel. s When a list of software components is displayed, select the Infrared support for Win-

dows 95 entry and click the Add/remove button.


s Restart the system when prompted to do so.

Using Device manager:


s Right-click on the My computer icon, select the Properties option from the popup

menu, then click the Device manager tab in the System properties dialog.
s To display the name of the infrared device installed on the computer, be sure that the

View devices by type option is selected in the System properties dialog. Then click the plus sign to the left of the Infrared device class label. Select the infrared device name, then click the Remove button. s Click OK to confirm the device removal. After the Device manager has successfully removed the infrared device installation from the computer, the Infrared device class label will disappear from the System properties dialog. s Click the Close button.
The Infrared monitor icon might still be displayed in the Windows 95 status bar (even after the infrared device is removed). Ignore itthe infrared monitor cannot be used to establish an IR link after the infrared device is removed.

IRDA TIPS
Although IR support is reasonably automatic under Windows 95, a number of tips can make your troubleshooting a bit easier:
s Always remove the existing IR drivers before installing new IR drivers (or upgrading the

IR adapter hardware). Pre-existing drivers can sometimes interfere with new IR drivers.
s If you upgrade the IR adapter hardware on your system, you must remove the IR dri-

vers and install new drivers.


s Be sure to select the proper COM port for the IR adapter. If you select the wrong COM

port during installation, the system will be unable to use the IR adapter.
s IR communication problems might require you to realign the IR devices so that they are

closer together (usually 3' or less), and in a direct line of sight. You might need to try new batteries in the IR adapter. s If an IR adapter is attached to a COM port that is using an older 8250 UART instead of a 16550A UART (or if an IR adapter is connected to a relatively slow computer, such as a 386 running at 20MHz), you might need to use the Limit connection speed to option in the Infrared monitor options tab to limit the connection speed to 19.2kbps. After establishing a successful IR connection at this speed, you can use the Limit connection speed to option to experiment with higher-speed connections.

TROUBLESHOOTING THE SERIAL PORT

1187

s Communication over a virtual COM port link between two computers might not be re-

liable if a printers IR adapter is also within range. Be sure to move the printers IR adapter (or any other non-essential IR adapter) out of range. s Do not suspend a Windows 95 computer while an IR connection is established. Wait until the IR link is disconnected (or force a disconnection) before putting the computer in suspend mode. For example, if an IrLan connection is established on a laptop, you must always move the laptop out of range of the IrLan access point before suspending the system or closing the laptop lid. Otherwise, the connection remains active and can drain the battery over time. s Connecting and disconnecting over a low-speed IR link (or over a poor-quality link) can take a few secondsduring which time the screen will appear to be frozen. To work around this, you should use a higher-speed connection and take steps to improve the quality of the connection.

Troubleshooting the Serial Port


Although the typical serial port is a rather simple I/O device, it presents some special challenges for the technician. Older PCs provided their serial ports in the form of 8-bit expansion boards. When a port failed, it was a simple matter to replace the board outright. Today, however, virtually all PCs provide at least one serial port directly on the motherboardusually integrated into a component of the main chipset. When a problem is detected with a motherboard serial port, a technician often has three choices:
s Replace the UART (responsible for virtually all serial port failures) on the mother-

2
SYSTEM DATA AND TROUBLESHOOTING

board. This requires access to surface-mount soldering tools and replacement ICs, and can be quite economical in volume. s Set the motherboard jumpers (if possible) to disable the defective serial port, and install an expansion board (such as a multi-I/O board) to take the place of the defective port. This assumes that there is an available expansion slot. s Replace the motherboard outright. This simple tactic requires little overhead equipment, but can be rather expensive. Virtually all commercial diagnostics are capable of locating any installed serial ports, and testing the ports thoroughly through a loopback plug. Now that you have reviewed the layout, signals, and operation of a typical serial port, you can take a clear look at porttroubleshooting procedures.

SERIAL-PORT CONFLICTS
Hardware and software conflicts with a systems serial ports are some of the most recurring and perplexing problems in PC troubleshooting. Although PC purists are pleased that current operating systems and BIOS supports four COM ports, they cannot overcome the fact that there are still only two interrupts available to run the ports from. Technicians trying to upgrade a PC often encounter problems adding I/O adapters because many current PC motherboards already provide two COM ports right out of the factory. If a PC offers

1188

SERIAL (RS232) PORT TROUBLESHOOTING

only one COM port (e.g., COM1) and another serial port is placed in the system (by accident or on purpose), be aware that you must choose a port and IRQ that does not conflict with the existing port (i.e., COM 2 or COM4). If the PC already provides two COM ports (i.e., COM1 and COM2), adding a third COM port to the system will cause a hardware conflict. You can rectify the conflict by disabling the new COM port, or by disabling one of the two existing COM ports and jumpering the new COM port to those settings. Serial device drivers can also be a source of problems for COM ports. Incorrectly written mouse drivers, printer drivers, or third-party interrupt handlers can leave a port inoperative or erratic. If problems develop after a new driver is installed, disable the drivers reference in CONFIG.SYS or install an updated protected-mode driver under Windows 95 using the Add new hardware wizard. TSRs (often loaded in AUTOEXEC.BAT) can cause problems as well. If problems develop after a new TSR is installed, disable the offending TSR and try the system again. Remember that drivers and TSRs can easily be disabled by adding the REM statement before the command line in CONFIG.SYS or AUTOEXEC.BAT. If the communication trouble is under Windows 95, strongly suspect the Windows communication package, or the Registry might need to be adjusted for an optimum modem-initialization string.

MATCH THE SETTINGS


Its bad enough that you can only (practically) use two COM ports, but you also have to be sure that the port addresses and IRQ assignments match (Table 40-1). For example, suppose that no COM1 is at 03F8h, but a COM port is at 02F8h. During system initialization, BIOS locates each available port and assigns a COM designation, so because no port is at 03F8h, the port at 02F8h (normally COM2) is the first port detected, and is assigned as COM1. However, DOS and BIOS expect COM1 to use IRQ4, but the port at 02F8h uses IRQ3. If you attempt to use BASIC or DOS for COM1, the standard interrupt handlers will not work. You would have to use communication software that talks to the port directly (thus avoiding using DOS-interrupt handlers) and can be assigned with the address and IRQ setting of your choosing. As an alternative, you can switch the COM port to 03F8h and set the interrupt to IRQ4that should restore normal COM1 operation through DOS.

FRAME IT RIGHT
The data frame and rate play very important roles in serial communication. The sending and receiving ends of the serial link must be set to the same configuration. Otherwise, the received data will be interpreted as garbage. If you encounter such troubles, be sure to check the settings for data bits, parity bit, stop bits, and baud rate. Change the data frame at either end of the serial link so that all devices are running with the same parameters.

FINDING A PORT ADDRESS WITH DEBUG


You can use the DOS Debug utility to determine the I/O addresses of a serial port. Be sure that you boot the computer in the DOS mode, then switch to the directory containing the Debug utility (such as C:). Type:
C: debug <Enter>

TROUBLESHOOTING THE SERIAL PORT

1189

A hyphen will appear. This is the Debug prompt. At the debug prompt, type:
D 40:00 09

A single line of text appears, such as:


0040:0000 F8 03 F8 02 00 00 00 00-78 03

To exit Debug, press Q (to quit), then press <Enter> to leave Debug and return to the DOS prompt. The line of interest begins 0040:0000. In this example, the F8 03 (read 03F8h) and F8 02 (read 02F8h) indicate two serial ports (COM1 and COM2). Other possibilities include E8 03 (read 03E8) and E8 02 (read 02E8)these are COM3 and COM4, respectively. A machine with four serial ports should read:
0040:0000 F8 03 F8 02 E8 03 E8 02-78 03

A machine with no serial ports should read:


0040:0000 00 00 00 00 00 00 00 00-78 03

2
SYSTEM DATA AND TROUBLESHOOTING

The 78 03 entry is the address of the first parallel port (read 0378h).

GENERAL SYMPTOMS
Your companion CD contains a variety of tools for identifying and diagnosing COM ports. The BBX201.ZIP utility offers a breakout box type of display, and you will find CTSSPU22.ZIP to be an excellent all-around utility. Other serial utilities include: COMPRT25.ZIP, COMRESET.ZIP, COMTAP21.ZIP, COMTEST.ZIP, SIMTRM.ZIP, and UARTTS.ZIP. Symptom 40-1. You hear a beep code or see a POST error, which indicates a serial-port fault The system initialization might or might not halt, depending

on how the BIOS is written. Low-level initialization problems generally indicate trouble in the computers hardware. If the computers beep code sequence is indistinct, you could try rebooting the computer with a POST analyzer card installed. The BIOS POST code displayed on the card could be matched to a specific error explanation in the POST cards documentation. Once you have clearly identified the error as a serial-port fault, you can proceed with troubleshooting. Start with the system as a whole and remove any expansion boards that have serial ports available. Retest the computer after removing each board. If the error disappears after removing a particular card, then that card is likely at fault. You can simply replace the card with a new one or attempt to repair the card to the component level. If only one serial port is in the system, it is most likely built into the motherboard. Again, you can replace the defective UART, replace the motherboard or disable the defective motherboard port.
Symptom 40-2. An 11xx or 12xx serial adapter error is displayed A hardware fault has been detected in one of the COM ports. The 11xx errors typically indicate

1190

SERIAL (RS232) PORT TROUBLESHOOTING

a fault in COM1, while 12xx errors suggest a problem with COM2, COM3, or COM4. In most cases, the fault is in the UART. You have the option whether to replace the UART IC, replace the motherboard, or disable the defective COM port and replace it with an expansion board.
Symptom 40-3. The computer initializes properly, but the serial peripheral does not work Your applications software might indicate that no device is con-

nected. Before you even open your tool kit, you must determine whether the trouble lies in your computer or your peripheral. When your modem or printer stops working, run a self test to ensure the device is at least operational. Check all cables and connectors (perhaps try a different cable). Also be sure to check the software package being used to operate the serial port. Ensure that the software is configured properly to use the appropriate COM port and that any necessary drivers are selected. Disconnect the peripheral at the computer and install a serial loopback plug. Run a diagnostic to inspect each available serial port. Take note of any port(s) that register as defective. Locate the corresponding serial port. If the port is installed as an expansion board, replace the defective expansion board. If the port is on the motherboard, you can replace the defective UART IC, install an alternate expansion board or replace the motherboard outright.
Symptom 40-4. Data is randomly lost or garbled Your first step should be to check the communication cable. Be sure that the cable is intact and properly secured at both ends. Try a different cable. If the cable checks properly, either the port or peripheral is at fault. Start by suspecting the serial port. Be sure that the DTE and DCE are both set to use the same data frame and data rate. Incorrect settings can easily garble data. If problems persist, disconnect the printer at the computer and install a serial loopback plug. Run a diagnostic to inspect each available serial port. Take note of any port(s) that register as defective. Locate the corresponding serial port(s). If the port is installed as an expansion board, replace the defective expansion board. If the port is on the motherboard, you can replace the defective port-controller IC, install an alternate expansion board, or replace the motherboard outright. If you can not test the computers serial port directly, test the port indirectly by trying the peripheral on another known-good computer. If the peripheral works properly on another computer, the trouble is probably in the original computers serial-port circuitry. Replace any defective circuitry or replace the motherboard. If the peripheral remains defective on another computer, the peripheral itself (i.e., printer or modem) is probably faulty. Symptom 40-5. LapLink does not recognize the IR COM port When you at-

tempt to use LapLink with virtual COM ports created by an infrared adapter, you might receive the following error message:
This port is unavailable: it might not be physically present in this computer. If no other communications program is currently running, check for a mouse or other serial device on this port.

This problem occurs because LapLink accesses the hardware directly to determine the status of the COM port and does not recognize virtual COM ports created using the infrared

FURTHER STUDY

1191

adapter. To work around this problem, youll need to contact Traveling Software for a possible patch for LapLink or discard the use of LapLink in favor of the Direct Cable Connection (DCC) tool included with Windows 95.
Symptom 40-6. Problems occur when maintaining an IR connection in the daylight This problem is common with all infrared devices, and is usually caused by in-

terference from the natural IR component of ordinary sunlight. Try shortening the transmission distance between the transmitter and receiver, and be sure that the path between the two is as straight as possible.

Further Study
This concludes the material for Chapter 40. Be sure to review the glossary and chapter questions on the accompanying CD. If you have access to the Internet, take a look at some of these serial-port resources: Adaptec: http://www.adaptec.com ActiSys: http://www.actisys.com TI: http://www.ti.com Sharp: http://www.sharp.com HP: http://www.hp.com

2
SYSTEM DATA AND TROUBLESHOOTING