Upgrading and Repairing PCs (17th Edition)
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.
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.
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:
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.
[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.
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.
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:
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:
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:
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. |
Категории