Sending and Receiving Data: Inputs and Outputs


The number and variety of input and output connectors on the back of your computer is enough to confound anybody except a truly dedicated geek. In another five or ten years, many of those connectors will be replaced with USB ports, but today, most computer and motherboard makers provide both the general-purpose USB connectors and a dozen or more specialized connectors.

In this section, you can find similar explanations of the older types of input and output connectors that you might still find on a desktop computer.

CROSS-REF 

Interested in USB and IEEE 1394/FireWire? Check out Chapter 14.

In order to reduce confusion, the joint Intel-Microsoft PC design specification includes a color code for most of the common types of computer connectors. Most computer and motherboard makers use plastic shells and sockets or labels of the appropriate colors to identify each socket, and the makers of many peripheral devices use the same colors for the plugs at the ends of their cables. When the system works, choosing the right connector is as simple as matching the colors on the plug and the socket. Table 16.1 lists the common connection types with their standard color codes and a description of each connector.

Table 16.1: Computer Connector Color Codes
Open table as spreadsheet

Color

Description

Connector

Green

Mouse

6-pin round PS/2

Purple

Keyboard

6-pin round PS/2

Burgundy

Parallel printer port

25-pin D

Teal or Turquoise

Serial port

9-pin D
25-pin D

Blue

Analog VGA video

15-Pin D

White

Digital video

DVI

Yellow

S-video

6-pin round DIN

Yellow

Composite video

RCA plug

Pink

Analog microphone input

3.5 mm audio plug

Light Blue

Analog line-level input

3.5 mm audio plug

Lime Green

Analog line-level outputs for headphones or speakers

3.5 mm audio plug

Brown

Analog line-level surround sound speakers

3.5 mm audio plug

Orange

S/PDIF digital audio output speaker or subwoofer output

3.5 mm audio plug

Gold

Game port or MIDI

15-pin D

Black

USB port

USB Type A

Grey

IEEE 1394/FireWire port

IEEE 1394

None

SCSI, telephone, Ethernet

Various

PS/2 mouse and keyboard sockets

Keyboards and mice both use identical round 6-pin plugs and sockets that carry power from the computer to the keyboard or mouse, and data in both directions. The mouse plug and socket are generally green, and the keyboard connectors are purple. Both have been widely replaced by USB connections. They are called PS/2 connectors because they were first used on IBM's PS/2 computers. Figure 16.4 shows the PS/2 sockets.

image from book
Figure 16.4: Many desktop computers still use PS/2 connectors for the keyboard and the mouse.

Parallel (printer) port

Parallel data transfers, in which each of the 8 bits in a byte uses a separate wire, are fast and efficient over short runs, but the cable that contains all those wires becomes extremely expensive when they are used over long distances. In personal computers, a parallel connection had been used most often for data transfer to and from a printer, but most new printers use USB connections, either as an alternative to the parallel cable or as the only connection.

The cable that carries the data from your computer to a printer is more than a bit odd. The connector on the computer is a 25-pin type DB25 socket, but the "matching" socket on the printer is a 36-pin socket called a Centronics connector. Centronics was a very early printer company that was in the right place at the right time to have their choice of parallel printer connectors adopted by the rest of the industry. Unfortunately, the rest of the industry, including such giants as Hewlett-Packard, IBM and Epson also took over the printer market, and Centronics had disappeared by 1988. However, the 36-pin Centronics connector lives on as the standard parallel printer socket.

Other uses are increasingly rare, but if you're working with peripheral devices that are more than eight or ten years old, you might discover some equipment that uses your computer's parallel port, including scanners, external storage systems, and scientific data gathering devices.

Just about every personal computer still has one parallel printer port, although some new machines have eliminated them in favor of a USB port. If you need an extra parallel port, you can install one on an inexpensive PCI expansion card.

Parallel port standards

Those parallel ports on early computers moved data on each pin in only one direction. Pins 2 through 9 carried data from the computer to the printer, and the remaining pins either sent control information to the printer or they returned acknowledgements and status information (such as "paper out") back to the printer. But as printers became more complex, and as other devices began to use the parallel port, the connection was redesigned to allow data to move in both directions. And of course, what had been a single universal standard evolved into a set of incompatible connections that all used the same plugs and sockets.

The first of these new parallel connections was the Standard Parallel Port (SPP), which used automatic switching inside the computer and the destination to reverse the direction that the data bits would travel through the cable.

SPP improved data transfers to a printer, but it wasn't good enough for other devices like disk and tape drives that demanded even more speed in both directions. So the Enhanced Parallel Port (EPP) specification was introduced. At about the same time, faster and better printers were appearing (this was the era when laser printers were replacing the old dot matrix machines that used dot matrixes and film ribbons), and a separate industry group developed their own set of improvements on the SPP design, called Extended Capabilities Port (ECP). And of course, ECP wasn't compatible with EPP. When the dust settled, the IEEE (the same industry standards group that later adopted the FireWire specification as IEEE 1394) developed a single specification called IEEE 1284 that included both EPP and ECP.

Most parallel printers, plotters, and other devices that use the parallel interface made in the last ten years automatically identify themselves to the computer as either EPP or ECP. If yours does not, you'll have to use the BIOS Settings utility to change the Parallel Port Mode setting to match the device connected to your computer. The usual options are

  • Normal or Printer: This is the original configuration used by printers made before about 1988.

  • SPP: In this mode, the printer or other device returns rudimentary status information back to the computer.

  • EPP: In this mode, data moves through the parallel data port at higher speed.

  • ECP: In this mode, additional status information moves through the parallel port in both directions.

  • EPP+ECP: In this mode, the BIOS automatically detects and uses the same mode used by the device at the other end of the cable. Unless your printer or other parallel device specifies some other mode, or you're using a very old printer, this is the best choice.

Alternatives to the parallel port

If your printer has both a parallel data connector and a USB port, you can use either one to connect the printer to the computer. Both types of connection move data to the printer as fast as the printer can produce printed pages, but the USB connection might support some diagnostic tests and other functions that aren't always possible through the slower parallel port.

In many home and small business networks, a printer is connected directly to the network as an independent device, rather than through a computer, so it can accept requests to print directly from all of the computers on the network. In this kind of setup, Windows directs print commands through the network rather than either the parallel port or a USB port.

Serial ports

In a serial data transfer, the bits in each byte move through a single pair of wires, one bit at a time. Before USB ports were introduced, the serial data ports on the rear panel were the primary I/O ports for transferring data through an external modem or other communications device, and for connecting many peripheral devices to a PC. Today, high-speed Ethernet and USB connections on new computers and external peripherals have almost completely replaced the older and slower serial data ports.

Serial data communication ports can have either 9 pins or 25 pins. The smaller 9-pin connector is most common on personal computers, but you might see a system with a 9-pin connecter designated as COM 1, and a second 25-pin connector as COM 2. The performance of both types of connector is identical, so you can use either size with any external device; an external modem that uses a serial data port usually comes with a "modem cable" that has a 9-pin female plug on one end and a 25-pin male plug on the other. The outline of the shell that contains both the 25-pin and 9-pin connectors looks vaguely like a letter D, so the plugs and sockets are sometimes called D-sub connectors. If your new computer doesn't have a built-in COM port, you can add one on a PCI expansion card.

The original specification for serial data communication is a relic from the 1960s, back in the days of steam-powered computers. The most common use of this specification was to define the connection between a computer and a remote terminal through a telephone line or other communications circuit. It was adopted in the United States by the Electronics Industry Association (EIA) as RS-232 (Regular Standard No. 232), and in the rest of the world by the International Telecommunications Union

as Recommendations V.24 and V.28. Because the earliest personal computers were widely used as remote terminals for mainframe computers, the serial data interfaces on PCs have always followed the RS-232 standard for 25-pin serial data connections. 9-pin connectors follow the EIA 574 standard.

Figure 16.5 shows a serial data link between a terminal and a host computer through a modem and a telephone line. Each pin on an RS-232 serial port carries data in only one direction, so the outputs on each end of a serial data link must connect to the inputs on the other end. Because the cable that connects the terminal to the modem ties Pin 1 to Pin 1, Pin 2 to Pin 2, and so on, the connections on the terminal are not the same as the ones on the modem.

image from book
Figure 16.5: A remote terminal connects to a computer through a modem and a telephone line.

Therefore, the RS-232 standard calls for two kinds of serial data ports: Data Terminal Equipment (DTE) and Data Communications Equipment (DCE). The computer, remote terminal, and any other device that originates or receives data uses RTE connections, and the modems, network interfaces, and other intermediate devices use DCE.

Null modem cables

This all works very well until you try to connect two terminals (or two computers) together without any DCE devices in between, as shown in Figure 16.6. You might want to use an RS-232 connection to transfer files from one computer to another, or to set up a point-to-point communications link.

image from book
Figure 16.6: If you try to connect two DTE serial data ports to each other, no signal goes anywhere.

When you connect Pin 2 (the data output) of one DTE serial port to Pin 2 of another DTE port, the two devices both try to send data, but neither knows how to receive it. And when you connect Pin 3 (the input) to Pin 3, both ports wait forever for a signal. The same thing happens on all the other pins that send and receive control signals. Figure 16.7 demonstrates what a correct connection should look like.

image from book
Figure 16.7: When you connect a DTE port to a DCE port, all of the signals pass from one to the other.

The solution to this problem is something called a crossover cable or a null modem that connects each output pin to the corresponding input. Any time you try to set up a direct connection between the serial data ports on two computers, you must use a null modem cable or a null modem adapter like the one shown in Figure 16.8.

image from book
Figure 16.8: When you connect two DTE serial data ports to each other, you must use a null modem adapter or cable.

Note 

By today's standards, communication through the serial data port is slow and inefficient. If you have a choice, it's almost always better to use a network or an IEEE 1394 link.

Changing the serial port settings

Before Windows passes data through a serial data port, it encodes each character into a series of bits in a specific order that had originally been defined for sending text through telegraph lines to mechanical teleprinters. In addition to the data bits that define each letter, number, or symbol, the character sequence also includes a handful of additional bits that identify the beginning and end of each sequence.

The character sequence includes these elements:

  • A Start bit that notifies the device at the receiving end that a new character is beginning.

  • A series of 5, 6, 7, or 8 bits that represents a letter, number, or other character. The number of bits depends on the specific type of code it uses.

  • A Parity bit that provides a simple form of error checking.

  • A Stop bit that allows the mechanical printer to return to its idle state before the next character sequence begins. The duration of the Stop bit depends on the amount of time the printer needs to coast to a complete stop. In electronic data communications, the end of the Stop bit defines the beginning of the Start bit.

Figure 16.9 shows the format of a serial data character sequence.

image from book
Figure 16.9: Every serial data character uses a standard format.

The only thing you really have to know about the data format used by a serial data port is that it must be exactly the same at both ends of a link. If you were using modems ten or fifteen years ago to transfer data to and from your computer, you might remember the ritual of setting the data bits, stop bit, and parity for each connection and confirming that the person on the other end of the line was using the same settings. Today, it's assumed that just about everybody uses 8 data bits, no parity, and 1 stop bit, so it's almost never necessary to change them.

However, it is possible to make changes if you're using your computer with some kind of oddball device that doesn't like the standard settings. In addition to data bits, parity, and stop bits, you can also adjust the data transmission rate and turn flow control (the procedure for suspending transmission when the receiver's buffer is almost full) on or off. If you're using a terminal emulator program or a control program for an external device that connects to your computer through a serial data port, use that program's configuration settings to adjust the data format.

In the unlikely event that you have to change the default settings for a serial port, follow these steps:

  1. From the Windows desktop, right-click My Computer and select Properties from the pop-up menu.

  2. In the System Properties window, choose the Hardware tab.

  3. Click the Device Manager button to open the Device Manager window shown in Figure 16.10.

    image from book
    Figure 16.10: Use the Device Manager to open the COM port properties window.

  4. Scroll down to the bottom of the Device Manager window and double-click the Ports listing. Sub-listings for the Communications Port and Printer Port appear.

  5. Double-click the Communications Port item to open a Properties window.

  6. Choose the Port Settings tab to open the dialog box shown in Figure 16.11. Each of the items in the Port Settings dialog box is a drop-down menu. To change a setting, open the menu for that setting and choose the new value to match the setting at the other end of the serial communications link.

    image from book
    Figure 16.11: Use the Communications Port Properties dialog box to adjust the default configuration settings.

Most Windows users don't know that it's possible to change these settings. If you don't have a good reason to change them, leave them alone.

Testing a game controller

When you install a new game controller, you can use Windows to test each of the controls, including the joystick, buttons, wheel, yoke, or pads. If your controller comes with its own test and setup software, use that program instead of the generic windows utility.

To use the Windows utility to test the controller, follow these steps:

  1. From the Control Panel, choose the Game Controllers icon. If your Control Panel is divided into groups, look in Printers and Other Hardware. The window shown in Figure 16.12 appears.

    image from book
    Figure 16.12: The Game Controllers window shows the currently installed controller.

  2. Click Add. A list of controllers appears in the Add Game Controller dialog box shown in Figure 16.13.

    image from book
    Figure 16.13: Choose your controller to test its functions.

  3. Choose either a description of your controller or the specific make and model. Scroll down the list to find the specific types.

  4. Click Properties to test the controller. Select the Test tab to open the dialog box shown in Figure 16.14.

    image from book
    Figure 16.14: Use the Test dialog box to test the individual controls on your game controller.

  5. Move the joystick or other navigation control in all possible directions. The + marker inside the box should follow the joystick and reach all four edges of the box.

  6. Test each of the controller's pushbuttons, one at a time. One of the numbered items in the Buttons box should respond when you push each button.

  7. If any of the controls appear to be working improperly, try calibrating the controller.

Calibrating your game controller

If your game controller didn't perform the way you expected it to when you ran the tests in the last section, follow these steps to calibrate it:

  1. Click the Settings tab in the controller properties window you used to test the controller. The screen shown in Figure 16.15 appears.

    image from book
    Figure 16.15: Open the Settings tab to calibrate your game controller.

  2. Click Calibrate. The Game Device Calibration Wizard opens.

  3. Follow the instructions in the wizard to adjust the way Windows receives commands from the controller.

  4. When the wizard closes, it returns you to the Test tab. Confirm that the + symbol is now in the center of the Axes box, and that it follows the motion of the joystick.

  5. If you're satisfied with the controller's performance, click the OK buttons until you have closed all the open windows. If it still isn't working the way you want it to, try calibrating the controller again.




PC User's Bible
PC Users Bible
ISBN: 0470088974
EAN: 2147483647
Year: 2007
Pages: 372

Similar book on Amazon

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