Serial Ports


The asynchronous serial interface was designed as a system-to-system communications port. Asynchronous means that no synchronization or clocking signal is present, so characters can be sent with any arbitrary time spacing.

Each character that is sent over a serial connection is framed by a standard start-and-stop signal. A single 0 bit, called the start bit, precedes each character to tell the receiving system that the next eight bits constitute a byte of data. One or two stop bits follow the character to signal that the character has been sent. At the receiving end of the communication, characters are recognized by the start-and-stop signals instead of by the timing of their arrival. The asynchronous interface is character oriented and has an approximate 20% overhead for the extra information that is needed to identify each character.

Serial refers to data that is sent over a single wire, with each bit lining up in a series as the bits are sent. This type of communication is used over the phone system because it provides one wire for data in each direction.

Typical Locations for Serial Ports

Typical systems include one or two serial ports, with connectors typically located at the rear of the system. Some recent consumer-oriented computers label a front-mounted serial port the "digital camera port." This name comes from the use of serial ports for data transfer from low-end digital cameras. On recent systems, these built-in serial ports are controlled by a highly integrated South Bridge chip in the latest motherboard designs.

If you need more serial ports than your system has as standard, you can purchase single- or multiport serial port cards or so-called multi-I/O cards that feature one or two serial ports and one or two parallel ports. Older systems based on the ISA or VL-Bus standard often have the serial ports attached to a multifunction card that also has IDE hard disk and floppy disk interfaces.

Note that card-based modems also incorporate a built-in serial port on the card as part of the modem circuitry. Figure 15.12 shows the standard 9-pin connector used with most modern external serial ports. Figure 15.13 shows the original standard 25-pin version.

Figure 15.12. AT-style 9-pin serial-port connector specifications.


Figure 15.13. Standard 25-pin serial-port connector specifications. NC stands for no connect, which indicates a dead pin.


Serial ports can connect to a variety of devices, such as modems, plotters, printers, PDA docking devices, other computers, bar code readers, scales, and device control circuits.

The official specification recommends a maximum cable length of 50 feet. The limiting factor is the total load capacitance of cable and input circuits of the interface. The maximum capacitance is specified as 2500pF (picofarads). Special low-capacitance cables can effectively increase the maximum cable length greatly, to as much as 500 feet or more. Also available are line drivers (amplifier/repeaters) that can extend cable length even further. Tables 15.7, 15.8, and 15.9 show the pinouts of the 9-pin (AT-style), 25-pin, and 9-pinto25-pin serial connectors, respectively.

Table 15.7. 9-Pin (AT) Serial Port Connector

Pin

Signal

Description

I/O

1

CD

Carrier detect

In

2

RD

Receive data

In

3

TD

Transmit data

Out

4

DTR

Data terminal ready

Out

5

SG

Signal ground

6

DSR

Data set ready

In

7

RTS

Request to send

Out

8

CTS

Clear to send

In

9

RI

Ring indicator

In


Table 15.8. 25-Pin (PC, XT, and PS/2) Serial Port Connector

Pin

Signal

Description

I/O

1

Chassis ground

2

TD

Transmit data

Out

3

RD

Receive data

In

4

RTS

Request to send

Out

5

CTS

Clear to send

In

6

DSR

Data set ready

In

7

SG

Signal ground

8

CD

Carrier detect

In

9

+Transmit current loop return

Out

11

-Transmit current loop data

Out

18

+Receive current loop data

In

20

DTR

Data terminal ready

Out

22

RI

Ring indicator

In

25

-Receive current loop return

In


Table 15.9. 9-Pinto25-Pin Serial Cable Adapter Connections

9-Pin

25-Pin

Signal

Description

1

8

CD

Carrier detect

2

3

RD

Receive data

3

2

TD

Transmit data

4

20

DTR

Data terminal ready

5

7

SG

Signal ground

6

6

DSR

Data set ready

7

4

RTS

Request to send

8

5

CTS

Clear to send

9

22

RI

Ring indicator


Note

Macintosh systems use a similar serial interface, defined as RS-422. Most external modems can interface with RS-232 or RS-422, but it is safest to make sure that the external modem you get for your PC is designed for a PC, not a Macintosh.


UARTs

The heart of any serial port is the Universal Asynchronous Receiver/Transmitter (UART) chip. This chip completely controls the process of breaking the native parallel data within the PC into serial format and later converting serial data back into the parallel format.

Several types of UART chips have been available on the market. The original PC and XT used the 8250 UART, which was used for many years in low-priced serial cards. Starting with the first 16-bit systems, the 16450 UART typically was used. The only difference between these chips is their suitability for high-speed communications. The 16450 is better suited for high-speed communications than is the 8250; otherwise, both chips appear identical to most software. The 16550 UART was the first serial chip used in the IBM PS/2 line. Other 386 and higher systems rapidly adopted it. The 16550 functioned as the earlier 16450 and 8250 chips, but it also included a 16-byte buffer that aided in faster communications. This is sometimes referred to as a FIFO (first in first out) buffer. Unfortunately, the early 16550 chips had a few bugs, particularly in the buffer area. These bugs were corrected with the release of the 16550A. The most current version of the chip is the 16550D, which was released in 1995 and is produced by National Semiconductor.

Tip

The high-speed buffered 16550A (or newer) UART chip is pin for pin compatible with the 16450 UART. If your 16450 UART is socketed, a cheap and easy way to improve serial performance is to install a 16550 UART chip in the socket.


Because the 16550 is a faster, more reliable chip than its predecessors, it is best to ensure that your serial ports have that chip or an equivalent. If you are in doubt about which type of UART you have, use the Microsoft MSD program (provided with MS-DOS 6.x and Windows 9x/Me/2000) to determine the type of UART you have. Note that MSD often reports a 16450 UART as an 8250.

Note

Another way to tell whether you have a 16550 UART in Windows is to click the Start menu and then select Settings, Control Panel. In Windows 9x/Me, double-click Modems and then click the Diagnostics tab. Select the port you want to check in the list and click More Info. Windows communicates with the port to determine the UART type, and that information is listed in the Port Information portion of the More Info box.

In Windows 2000/XP or later, click Phone and Modem Options and then select Modems, Properties, Advanced, Advanced Port Settings. If the option labeled Use FIFO Buffers (Requires 16550 Compatible UART) is not grayed out, you have a 16550-compatible port.


The original designer of these UARTs is National Semiconductor (NS). So many other manufacturers are producing clones of these UARTs that you probably don't have an actual NS brand part in your system. Even so, the part you have is compatible with one of the NS parts, hopefully the 16550. In other words, check to see that whatever UART chip you have does indeed feature the 16-byte FIFO buffer, as found in the NS 16550 part.

See "Super I/O Chips," p. 342.


8250

IBM used this original chip in the PC serial port card. This chip had no transmit/receive buffer, so it was very slow. The chip also had several bugs, none of which were serious. The PC and XT ROM BIOSs were written to anticipate at least one of the bugs. The 8250B replaced this chip.

8250A

Do not use the second version of the 8250 in any system. This upgraded chip fixes several bugs in the 8250, including one in the interrupt enable register, but because the PC and XT ROM BIOSs expect the bug, this chip does not work properly with those systems. The 8250A works in an AT system that does not expect the bug, but it does not work adequately at 9600bps.

8250B

The last version of the 8250 fixes bugs from the previous two versions. The interrupt enable bug in the original 8250, which is expected by the PC and XT ROM BIOS software, has been put back into this chip, making the 8250B the most desirable chip for any non-AT serial port application. The 8250B chip might work in an AT under DOS, but it does not run properly at 9600bps because, like all 8250s, it has no transmit/receive buffer.

16450

IBM selected the higher-speed version of the 8250 for the AT. The higher performance comes mainly from a 1-byte transmit/receive buffer contained within the chip. Because this chip has fixed the aforementioned interrupt enable bug, the 16450 does not operate properly in many PC or XT systems because they expect this bug to be present. OS/2 requires this chip as a minimum; otherwise, the serial ports do not function properly. It also adds a scratch-pad register as the highest register. The 16450 is used primarily in AT systems because of its increase in throughput over the 8250B.

16550 Series

This chip is pin compatible with the 16450 but is much faster due to a built-in 16-character transmit/receive FIFO buffer. It also allows multiple DMA channel access. The original version of this chip did not allow the buffer to work, but all 16550A or later revisions have the bug fixed. The last version produced by National Semiconductor was called the 16550D. Use a version of this UART in your serial port if you do any communications at 9600bps or higher. If your communications program uses the FIFOand all of them do todayit can greatly increase communications speed and eliminate lost characters and data at the higher speeds. Virtually all Super I/O chips contain the equivalent of dual 16550A or later chips. Most 16550 UARTs have a maximum communications speed of 115Kbps.

16650, 16750, and 16850

Several companies have produced versions of the 16550 with larger buffers:

  • The 16550 has a 32-byte buffer.

  • The 16750 has a 64-byte buffer.

  • The 16850 has a 128-byte buffer.

  • The 16950 has a 128-byte buffer and the option to run at normal or 4x normal baud rates.

These chips are not from National Semiconductor, and the designations only imply that they are compatible with the 16550 but have a larger buffer. These larger-buffered versions allow speeds of 230Kbps (16650), 460Kbps (16750), and 920Kbps (16850 and 16950) and are recommended when running a high-speed external communications link, such as an ISDN terminal adapter or external 56Kbps modem. These are discussed more in the following section.

High-Speed Serial Port Cards

If you are using external RS-232 devices designed to run at speeds higher than 115Kbps (the maximum speed of the 16550 series UARTs and equivalents), you can't achieve maximum performance unless you replace your existing serial ports with add-on cards using one of the 16650, 16750, 16850, or 16950 UARTs discussed earlier. Most cards allow raw port speed settings of 230Kbps, 460Kbps, or even higher, which is valuable when connecting a PC to a high-speed external component that is connected to a serial port, such as an ISDN terminal adapter. You can't really get the full-speed benefit of an external ISDN modem (terminal adapter) unless your serial port can go at least 230Kbps. Lava Computer Mfg. and SIIG are two of the companies that offer a complete line of high-speed serial and parallel port cards (see the Vendor List on the accompanying disc).

Onboard Serial Ports

Starting with late-model 486-based systems in the mid-1990s, a component on the motherboard called a Super I/O chip began to replace separate UART chips. This usually has two serial port UARTs as well as a multimode parallel port, floppy controller, keyboard controller, and sometimes the CMOS memoryall built into a single tiny chip. Still, this chip acts as if all these separate devices were installed: That is, from a software point of view, both the operating system and applications still act as if separate UART chips were installed on serial port adapter cards. The most recent systems integrate the functions of a Super I/O chip into the South Bridge chip. As with the Super I/O chip, South Bridge chips with integrated I/O are transparent to software. Super I/O and South Bridge chips are discussed throughout this chapter and in Chapter 4, "Motherboards and Buses."

Serial Port Configuration

Each time a character is received by a serial port, it has to get the attention of the computer by raising an interrupt request line (IRQ). Eight-bit ISA bus systems have eight of these lines, and systems with a 16-bit ISA bus have 16 lines. The 8259 interrupt controller chip or equivalent typically handles these requests for attention. In a standard configuration, COM1 uses IRQ4, and COM2 uses IRQ3. Even on the latest systems, the default COM port assignments remain the same for compatibility with older software and hardware.

When a serial port is installed in a system, it must be configured to use specific I/O addresses (called ports) and interrupts (called IRQs). The best plan is to follow the existing standards for how these devices are to be set up. For configuring serial ports, use the addresses and interrupts indicated in Table 15.10.

Table 15.10. Standard Serial I/O Port Addresses and Interrupts

COMx

I/O Ports

IRQ

COM1

3F83FFh

IRQ4

COM2

2F82FFh

IRQ3

COM3

3E83EFh

IRQ4[1]

COM4

2E82EFh[2]

IRQ3[1]


[1] Note that although many serial ports can be set up to share IRQ3 and IRQ4 with COM1 and COM2, it is not recommended. The best recommendation is setting COM3 to IRQ10 and COM4 to IRQ11 (if available). If ports above COM3 are required, it is recommended that you purchase a special multiport serial board, preferably a PCI-based board that supports IRQ sharing without conflicts.

[2] This I/O address can conflict with registers in some video cards. In such cases, you cannot use COM4 unless COM4 or the video card can be configured to use a different I/O port address range.

Be sure that, if you are adding more than the standard COM1 and COM2 serial ports, they use unique and nonconflicting interrupts. If you purchase a serial port adapter card and intend to use it to supply ports beyond the standard COM1 and COM2, be sure it can use interrupts other than IRQ3 and IRQ4; PCI-based serial port boards take advantage of IRQ sharing features to allow COM3 and above to use a single IRQ without conflicts.

Note that BIOS manufacturers never built support for COM3 and COM4 into the BIOS. Therefore, DOS can't work with serial ports above COM2 because DOS gets its I/O information from the BIOS. The BIOS finds out what is installed in your system, and where it is installed, during the power-on self test (POST). The POST checks only for the first two installed ports. This is not a problem under Windows because Windows 95 and later have built-in support for up to 128 ports.

With support for up to 128 serial ports in Windows, using multiport boards in the system is much easier. Multiport boards give your system the capability to collect or share data with multiple devices while using only one slot and one interrupt.

Caution

Sharing interrupts between COM portsor any devicescan function properly sometimes and not others. It is recommended that you never share interrupts between multiple ISA-based serial ports, such as the COM ports built into your motherboard or found on an ISA modem. Trying to track down drivers, patches, and updates to allow this to work successfullyif it's even possible in your systemcan cause you hours of frustration.


See "Resolving Resource Conflicts," p. 393.


Testing Serial Ports

You can perform several tests on serial and parallel ports. The two most common types of tests are those that involve software only and those that involve both hardware and software. The software-only tests are done with diagnostic programs, such as Microsoft's MSD or the Modem diagnostics built into Windows, whereas the hardware and software tests involve using a wrap plug to perform loopback testing.

See "Advanced Diagnostics Using Loopback Testing," p. 1001.


See "Testing Parallel Ports," p. 1010.


Microsoft Diagnostics

Microsoft Diagnostics (MSD) is a diagnostic program supplied with MS-DOS 6.x, Windows 3.x, and Windows 9x/Me/2000. In Windows 95 this program can be found on the CD-ROM in the \other\msd directory, and in Windows 98/Me/2000, you can find it on the CD-ROM in the \tools\oldmsdos directory. MSD is not automatically installed when you install the operating system. To use it, you must run it from the CD-ROM directly or copy the program from the CD-ROM to your hard disk.

For the most accurate results, many diagnostics programs, such as MSD, are best run in a DOS-only environment. Because of this, you need to restart the machine in DOS mode before using them. If you use Windows 2000 or XP, you can format a floppy disk with MS-DOS startup files and use it to start your computer. Then, to use MSD, switch to the directory in which it is located. This is not necessary, of course, if the directory that contains the program is in your search pathwhich is often the case with the DOS 6.x or Windows-provided versions of MSD. Then, simply type MSD at the DOS prompt and press Enter. Soon you see the MSD screen.

Select the Serial Ports option. Notice that you are given information about which type of serial chip you have in your system, as well as information about which ports are available. If any of the ports are in use (with a mouse, for example), that information is provided as well.

MSD is helpful in at least determining whether your serial ports are responding. If MSD can't determine the existence of a port, it does not provide the report that indicates that the port exists. This sort of "look-and-see" test is the first action I usually take to determine why a port is not responding.

Troubleshooting Ports in Windows

Windows 9x/Me can tell you whether your ports are functioning. First, you must verify that the required communications files are present to support the serial ports in your system:

  1. Verify the file sizes and dates of both COMM.DRV (16-bit serial driver) and SERIAL.VXD (32-bit serial driver) in the SYSTEM directory, compared to the original versions of these files from the Windows 9x/Me CD-ROM.

  2. Confirm that the following lines are present in SYSTEM.INI:

    [boot] comm.drv=comm.drv [386enh] device=*vcd 

The SERIAL.VXD driver is not loaded in SYSTEM.INI; instead, it is loaded through the Registry.

Windows 2000 and XP use the SERIAL.SYS and SERENUM.SYS drivers for handling RS-232 devices. You can compare the file sizes and dates for these files to those on the Windows 2000 CD-ROM.

If both drivers are present and accounted for, you can determine whether a particular serial port's I/O address and IRQ settings are properly defined by following these steps for Windows 9x/Me/2000:

1.

Right-click the My Computer icon on the desktop and select Properties, or double-click the System icon in the Control Panel. Click the Device Manager tab, click Ports, and then select a specific port (such as COM1).

2.

Click the Properties button, and then click the Resources tab to display the current resource settings (IRQ, I/O) for that port.

3.

Check the Conflicting Devices List to see whether the port is using resources that conflict with other devices. If the port is in conflict with other devices, click the Change Setting button, and then select a configuration that does not cause resource conflicts. You might need to experiment with these settings until you find the correct one.

4.

If the resource settings can't be changed, most likely they must be changed via the BIOS Setup. Shut down and restart the system, enter the BIOS Setup, and change the port configurations there.

See "Resolving Resource Conflicts," p. 393.


A common problem with nonPlug and Play modems can occur when people try to use a modem on COM3 with a serial mouse or other device on COM1. Typically, COM1 and COM3 ports use the same IRQ, meaning that they can't be used simultaneously. The COM2 and COM4 ports have the same problem sharing IRQs. If possible, change the COM3 or COM4 port to an IRQ setting that is not in conflict with COM1 or COM2. Note also that some video adapters have an automatic address conflict with COM4.

Advanced Diagnostics Using Loopback Testing

One of the most useful types of diagnostic test is the loopback test, which can be used to ensure the correct function of the serial port and any attached cables. Loopback tests are basically internal (digital) or external (analog). You can run internal tests by simply unplugging any cables from the port and executing the test via a diagnostics program.

The external loopback test is more effective. This test requires that a special loopback connector or wrap plug be attached to the port in question. When the test is run, the port is used to send data out to the loopback plug, which simply routes the data back into the port's receive pins so the port is transmitting and receiving at the same time. A loopback or wrap plug is nothing more than a cable that is doubled back on itself. Most diagnostics programs that run this type of test include the loopback plug, and if not, these types of plugs easily can be purchased or even built.

Following is a list of the wiring necessary to construct your own serial port loopback or wrap plugs:

  • Standard IBM-type 25-pin serial (female DB25S) loopback connector (wrap plug). Connect the following pins:

    1 to 7
    2 to 3
    4 to 5 to 8
    6 to 11 to 20 to 22
    15 to 17 to 23
    18 to 25

  • Norton Utilities (Symantec) 25-pin serial (female DB25S) loopback connector (wrap plug). Connect the following pins:

    2 to 3
    4 to 5
    6 to 8 to 20 to 22

  • Standard IBM-type 9-pin serial (female DB9S) loopback connector (wrap plug). Connect the following pins:

    1 to 7 to 8
    2 to 3
    4 to 6 to 9

  • Norton Utilities (Symantec) 9-pin serial (female DB9S) loopback connector (wrap plug). Connect the following pins:

    2 to 3
    7 to 8
    1 to 4 to 6 to 9

See "Serial Ports," p. 993.


To make these loopback plugs, you need a connector shell with the required pins installed. Then, wire wrap or solder the wires, interconnecting the appropriate pins inside the connector shell as specified in the preceding list.

In most cases, purchasing a set of loopback connectors that are premade is less expensive than making them yourself. Most companies that sell diagnostics software can also sell you a set of loopback plugs. Some hardware diagnostic programs include loopback plugs with the software.

One advantage of using loopback connectors is that you can plug them into the ends of a cable that is included in the test. This can verify that both the cable and the port are working properly.

If you need to test serial ports further, see Chapter 22, "PC Diagnostics, Testing, and Maintenance," which describes third-party testing software.




Upgrading and Repairing PCs
Upgrading and Repairing PCs (17th Edition)
ISBN: 0789734044
EAN: 2147483647
Year: 2006
Pages: 283
Authors: Scott Mueller

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