Previous Section  < Day Day Up >  Next Section

Hack 13 Configure Serial Ports

figs/beginner.gif figs/hack13.gif

Starting with a clean, industry-standard serial port configuration can save hours of headaches when you're ready to add more devices.

If you currently or eventually will have to connect your PDA, a modem, a GPS unit, an uninterruptible power supply to protect your PC, or something else to a COM port, leave the COM port(s) enabled with a known configuration. If you know for sure how your ports are configured, it makes using them much easier.

There are several ways to tell if you have one or more COM ports on your system:

  • Look at the back (sometimes the front for some COMPAQ and HP systems) of your PC to see if there is a connector with nine small male pins in two rows—one of five pins, the other of four pins, surrounded by a trapezoidal or D-shaped metal shell—or a connector with 25 male pins in two rows of 13 and 12, respectively. These are known as DB-9 male and DB-25 male connectors, respectively. Only serial ports have this style of male connectors.

    The presence of these connectors does not tell you specifically that there are COM port electronics wired between the connectors and your system board—these may be fillers for the addition of COM ports to a system that does not have them.

    The presence of these connectors also does not tell you if they are connected to an add-in card plugged into an ISA or PCI slot or directly to COM port electronics on the system board. Only a physical inspection of the inside of your PC can tell you for sure if the connectors go anyplace and where they go.

  • Look into the BIOS setup program for references to serial/COM ports in the I/O port menu sections. If setup refers to COM ports and the system contains the 9- or 25-pin external connectors, chances are you do have COM ports.

    It is possible your BIOS could report the existence of COM ports although you have no physical connectors for them, indicating that you are missing some cables to connect to the system board or the manufacturer never intended the ports to be used.

    If you have the connectors but do not see any references to COM ports in your BIOS, then it's likely the COM ports are provided by an add-in card.

  • In Windows go to the Device Manager to see if any COM ports are present. This will not tell you how the COM ports are provided, by system board or add-in card, but will tell you if a port exists and provide details about its configuration.

  • Use a system information or diagnostic program like SiSoft's Sandra (http://www.sisoftware.net), Windows Device Manager [Hack #12], or a similar program to detect and reveal the port information. These programs will not tell you how the COM ports are provided—by system board or add-in card—but will tell you if a port exists and provide details about its configuration.

If you've determined that you have COM port connectors and the ports are configured in the BIOS, you'll want to set their configuration to known values so that other Plug and Play devices don't try to use their resources later on. The proper address and IRQ settings for COM ports are listed in Table 2-1.

Table 2-1. Standard COM port addresses and IRQs

Port number

Address

IRQ

COM 1

3F8

4

COM 2

2F8

3

COM 3

3E8

4

COM 4

2E8

3


Figure 2-4 shows the BIOS screens for typical Plug and Play COM ports. Auto is not the setting you want if you are concerned about establishing and maintaining a proper, known PC configuration.

Figure 2-4. Default Plug and Play serial port configuration settings
figs/pchk_0204.gif


You might add other COM ports to the system configuration in the future, so you want the built-in or first serial ports in the system to be set properly for COM1 and COM2, as shown in Figure 2-5. In this example, "Serial Port A" and "Serial Port B" refer to the labeling of the physical plugs at the back of the system board. Your system board labels and settings may differ slightly. To avoid a headache in the future, change your serial port settings to those shown.

Figure 2-5. The desirable settings for the COM1 and COM 2 ports on the system board
figs/pchk_0205.gif


The Mode parameter typically refers to whether or not this serial interface should use a true serial I/O port or consider an available Infrared receiver/transmitter as this specific COM port. Infrared (IR) ports are rare on desktop and server systems but are quite common on circa 1995-2000 laptops. This setting should be set to Normal for most of us, unless you have a built-in IR device acting as a COM port and intend to use it. If you never intend to use your COM ports, disable or remove them entirely to leave the resources free for other devices that may need them.

    Previous Section  < Day Day Up >  Next Section