PC Hardware Interfaces: A Developer’s Reference – Wireless Interfaces

Chapter 3: Wireless Interfaces

Wireless interfaces free devices from the cables connecting them. This is especially attractive for compact peripheral devices, whose size and weight are comparable to the connecting cables. Wireless interfaces communicate using infrared (IrDA) and radio (Bluetooth). Besides these interfaces for peripheral devices, there are other wireless methods to connect to local area networks.

3.1 IrDA Infrared Interface

Using infrared emitters and receivers allows for wireless communication between two devices located up to several meters apart. Infrared is not hazardous to human health, does not interfere with radio signals, and provides confidential communication. Infrared rays cannot penetrate walls, so the reception area is restricted to a small, easily controlled space. Infrared is attractive for organizing communications between portable and stationary computers or docking stations. Some printers have an infrared interface, and many modern compact devices, including pocket computers, mobile telephones and digital cameras, are equipped with it.

Infrared systems are divided into low- (up to 115.2 Kbps), middle- (up to 1.152 Mbps), and high-speed (4 Mbps) categories. Low-speed systems are used to exchange short messages. High-speed systems are employed for exchanging files between computers, network connections, outputting data to a printer or a projector, etc. In the future, higher transfer rates are expected that will allow the transmission of video in real time. In 1993, the Infrared Data Association (IrDA), an association of infrared data-transmission systems developers, was formed, with the aim of making equipment from different manufacturers compatible. Currently, the IrDA 1.1 standard is in effect. Some companies have developed their own systems, such as Hewlett-Packard’s Hewlett Packard Slow Infra Red (HP-SIR) and Sharp’s Amplitude Shifted Keyed IR (ASK-IR). These interfaces provide the following transfer rates:

  • IrDA Serial Infra Red (SIR), HP-SIR: 9.6 Kbps to 115.2 Kbps

  • IrDA HDLC, or Middle Infra Red (MIR): 0.566 Mbps and 1.152 Mbps

  • IrDA Fast Infra Red (FIR): 4 Mbps

  • ASK IR: 9.6 Kbps to 57.6 Kbps

The emitter in infrared communication is a light-emitting diode with a characteristic power peak at 880 nm. The diode has an effective transmission cone of about 30 degrees. PIN diodes, which receive infrared within a 15-degree angle, are used as receivers. The IrDA specification defines the requirements for transmitter power output and receiver sensitivity, and specifies both the minimum and maximum strength of the infrared rays for the receiver. (The receiver can not pick up pulses of too low power, while those of too high power would merge into one pulse and effectively blind it.) Besides infrared, the receiver can be affected by outside factors, such as sunlight and incandescent lamps (constant optical power) and fluorescent lamps (variable, low-frequency). These interferences must be filtered out. The IrDA specification sets a bit error level (BER) of no more than 10−9 at 1 meter distance in daylight (illumination up to 10 Klux). Since the transmitter almost inevitably causes outside illumination of its own receiver saturating it, half-duplex communications with certain time intervals between transfer direction changes are necessary. Binary modulation (light on/off) and various coding schemes are used for transmission.

The IrDA specification defines a multilevel system of protocols, considered here in ascending order.

Options at the IrDA physical level are:

  • IrDA SIR. For transfer rates from 2.4 Kbps to 115.2 Kbps, the standard asynchronous transmission—start bit (logical zero), 8 data bits, stop bit (logical one)—is used (as in COM ports). Logical zero is encoded by a signal 3/16th the duration of the bit interval (1.63 μsec at 115.2 Kbps). Logical one is encoded by an absence of pulses (IrDA SIR-A mode). Accordingly, the transmitter does not send during breaks between transmissions, and every transmission begins with a start-bit pulse. The IrDA 1.1 specification also provides for IrDA SIR-B mode, with a fixed pulse length of 1.63 μsec for all transmission rates.

  • ASK IR. Asynchronous mode is also used for speeds between 9.6 Kbps and 57.6 Kbps, but with different encoding. Logical zero is encoded by sending pulses at 500 KHz, logical one is encoded by an absence of pulses.

  • IrDA HDLC. Synchronous transmission mode is -used for speeds between 0.576 Mbps and 1.152 Mbps, and the encoding is analogous to the SIR protocol (zero—pulsed, one—no pulse) but with pulses a quarter of the bit interval duration. The frame format complies with the HDLC protocol. The beginning and the end of a frame are marked by 01111110 flags; inside the frame, this combination is avoided by bit stuffing. A 16-bit CRC code is inserted into each frame to control data integrity.

  • IrDA FIR (IrDA4PPM). Synchronous mode is also used for transmissions at 4 Mbps, but the encoding is somewhat more complicated. Every pair of adjacent bits is encoded by a positional pulse code: 00 → 1000, 01→ 0100, 10→ 0010, 11→ 0001 (in 4-character sequences, 1 sends a pulse at the corresponding quarter of the symbol interval). This encoding method makes it possible to reduce the frequency of switching on LED by half in comparison with the previous method. The consistency of the average frequency of the received impulses makes it easier for the receiver to adapt to external illumination. 32-bit CRC code is used to improve data integrity.

Above the physical level comes the IrDA Infrared Link Access Protocol (IrLAP). IrLAP is a modification of the HDLC protocol, reflecting the needs of infrared communication. This protocol encapsulates data into frames and prevents device conflicts. When more than two devices capable of “seeing” each other are present, one is designated as the master, all the rest as slaves. Communication always uses the half-duplex mode. The IrLAP describes the procedure for establishing, enumerating, and terminating connections. Connections are established at the speed of 9,600 bps, after which the transfer speed is negotiated to the maximum supported by both devices (9.6 Kbps, 19.2 Kbps, 38.4 Kbps, or 115.2 Kbps) and logical channels are established, each controlled by one master device.

Above the IrLAP protocol comes the IrDA Infrared Link Management Protocol (IrLMP). Using IrLMP, a device informs other devices about its presence in the coverage area. (IrDA devices can be configured dynamically by bringing a new device closer or moving it further away.) IrLMP allows detection of services offered by a device, control of data streams, and provision of multiplexer functions in a configuration in which multiple accessible devices are present. Using IrLMP, applications can determine whether the device they need is present in the coverage area. However, this protocol does not guarantee reliable data delivery.

The transport level is provided by the IrDA Transport Protocol (Tiny TP). Tiny TP, which resembles the TCP protocol, services the virtual channels between the devices, processes errors (lost packets, data errors, and the like), packages data into packets, and assembles the original data from packets. The transport level may also be serviced by the IrTP protocol.

The IrCOMM protocol allows an infrared connection to emulate a conventional wire connection:

  • A 3-wire connection via an RS-232C interface (TXD, RXD, and GND)

  • A 9-wire connection via an RS-232C interface (the complete COM port signal set)

  • A Centronics connection (emulation of a parallel interface)

The IrLAN protocol provides access to local area networks, allowing transmission of Ethernet and Token Ring network frames. To connect to a local area network using an infrared connection, a server device with an IrDA interface and connected conventionally (i.e., by wires) to the network is needed, along with the appropriate software for the client device.

The Object Exchange Protocol (IrOBEX) is a simple protocol, implementing PUT and GET commands to exchange “useful” binary data between devices. This protocol is located above Tiny TP. IrOBEX has an extension for mobile communications that defines transmission of GSM-network information (notebook, calendar, call control, digital voice transmission, etc.) between a telephone and any sort of computer (from a desktop to a PDA).

This is not an exhaustive list of protocols related to infrared communications. The same frequency range (880 nm) is used for remote control of household appliances (televisions, video recorders, etc.) but different frequencies and physical encoding methods are employed.

An IrDA transceiver can be connected to a computer in various ways. In relation to the system block, it may be located either internally (on the computer’s front panel) or externally, placed anywhere. The transceiver’s location must be chosen taking into account the device’s optical angle (30 degrees for the transmitter and 15 degrees for the receiver), as well as the distance to the device it controls (up to 1 meter).

Internal transceivers, with speeds of up to 115.2 Kbps (IrDA SIR, HP-SIR, ASK IR), are connected through regular 16450/16550-series compatible UART ICs using relatively simple modulator-demodulator circuits. In some modern motherboards, the COM2 port may be configured to use infrared communications at up to 115.2 Kbps. For this, in addition to the UART, the chipset includes modulator and demodulator circuits that support one or several infrared communication protocols. To use the COM2 port for infrared communication, the corresponding mode needs to be selected in CMOS Setup (disabling infrared communications means the COM2 port will be used conventionally). There are also internal adapters on expansion cards (for ISA, PCI, and PC Card buses) that the system sees as additional COM ports.

Specialized IrDA controller ICs are used for middle and high exchange rates. These are designed to support intensive software-controlled exchange or the DMA, and have direct bus-control capability. A regular UART transceiver is of no use, as it does not support synchronous transfer or high transfer rates. Physically, the FIR IrDA controller is implemented on an expansion card or is built in into the motherboard. As a rule, such a controller also supports SIR modes.

The transceiver is connected to the motherboard’s infrared connector directly (if it is installed on the computer’s front panel) or using a transitional connector (mini DIN) located on one of the blank covers on the computer’s back panel. Unfortunately, there is no universal circuit layout for the internal connector, and for greater flexibility the transceiver (or transitional connector) is equipped with a cable and separate contacts for the connector. To assemble them in proper order is left to the user. Table 3.1 lists the functions of the infrared-transceiver connector contacts. Some transceivers supporting FIR and SIR modes have separate receiver outputs: IRRX for SIR and FIRRX for FIR. If the controller supports only one of the modes, one contact is left unconnected.

Table 3.1: Infrared Transceiver Connectors

Table 3.1 Infrared Transceiver Connectors

External infrared adapters are factory-equipped with an RS-232C interface to connect to the COM port or the USB bus. USB carrying capacity is sufficient even for the FIR; the COM port is good only for the SIR. The external infrared IrDA SIR adapter for the COM port is not as simple as it may seem, as the operation of the modulator-demodulator requires a synchronization signal on the frequency equal to 16 times the frequency of the data transmission. This signal comes onto the synchronous input of the COM port’s UART IC. There is no such signal on the output of the COM port, and it has to be extracted and reassembled from the asynchronous bit stream. The ASK infrared adapter is simpler in this respect. The transmitter must send high frequency pulses all the time while the TXD output remains in the high state; the receiver must form the envelope for the received pulses.

Use of the IrDA in applications requires the installation and setup of the corresponding drivers, as well as physical connection of the adapter and the transceiver. Windows 9x/ME/2000 place the IrDA controller into the Network Neighborhood group. Properly configured software allows connections with local area networks (for connection to the Internet or use of local network resources). It also allows data printout, synchronization of data between a PDA, a mobile phone, and a desktop computer, image upload from a digital camera to the computer, and a variety of other useful tasks without any worries about cable management.

3.2 Bluetooth Radio Interface

Bluetooth is the de facto standard for miniature, inexpensive means of short-range radio data exchange between mobile (and desktop) computers, mobile phones, and any other portable devices. The standard has been developed by a group of leading telecommunications, computer, and network companies—3Com, Agere Systems, Ericsson, IBM, Intel, Microsoft, Motorola, Nokia and Toshiba—which formed the Bluetooth Special Interest Group to bring the technology onto the market. The Bluetooth specification is freely available on the web (http://www.bluetooth.com), although it is quite bulky (about 15 MB of PDF files). The openness of the specification is supposed to promote its rapid spread, a development that can already be observed. The name itself is the nickname of the Dutch king who united Denmark and Norway, an allusion to the technology’s universal unifying role.

Every Bluetooth device has a radio transmitter and receiver working in the 2.4 GHz frequency range. In most countries, this frequency range is assigned to industrial, scientific, and medical use and does not require licensing, making the devices universally applicable. Bluetooth uses radio channels with discrete (binary) frequency modulation. The carrier frequency of the channels is F = 2,402 + k (MHz), where k = 0, …, 78. For some countries (such as France, where this frequency range is used by the military), a subset of this carrier frequency range is available with F = 2,454 + k, where k = 0, …, 22. The coding is simple: logical one is represented by a positive frequency deviation, logical zero by a negative frequency deviation. Transmitters come in three power classes, with respective maximum power of 1 mW, 2.5 mW, and 100 mW. They must also have a low-power-consumption option for energy savings.

Transmission is accomplished by the carrier frequency hopping from one radio channel to another, which helps to combat interference and signal fading. The physical communications channel is assigned by a pseudorandom sequence of the available channels (79 or 23 available frequencies). A group of devices sharing one channel (i.e., with the same hopping sequence) form a piconet, which may consist of 2 to 8 devices. Each piconet has one master device and up to 7 active slave devices. Moreover, the coverage area of the master device’s piconet may contain “parked” slave devices. They have the same hopping sequence and are synchronized on it with the master device, but cannot exchange data unless the master device allows them. Every active slave device in the piconet has a temporary number between 1 and 7. When a slave device is deactivated (parked), it releases its number to be used by the other devices. When next activated, it may receive a different number, which is why the number is temporary. Coverage areas of piconets may overlap, forming a scatternet. In this case, however, each piconet has only one master device, but a slave device may be a member of several piconets, using timesharing (i.e., working in different piconets at different times). Moreover, one piconet’s master device may be a slave device in another piconet. These piconets are not synchronized in any way, and each uses its own channel (hopping sequence).

The master device organizes time multiplexing, dividing the airtime into sequentially numbered time slots, each 625 mcsec long, with a cyclicity of 227. The master and slave devices take turns to transmit: the master transmits in even slots; the slave addressed by the master transmits in odd slots (if it has anything to transmit). In the simplest case, each time slot corresponds to one carrier frequency in the hopping sequence (1,600 hops per second). The frequency sequence is determined by the address of the master device of the piconet. Data are transferred in packets, and each packet can take from 1 to 5 time slots. Because a radio receiver requires some time to settle into a new frequency, a substantial leading part of a time slot (about 250, μsec) cannot be used to transmit data. Out of the formal 625 bits in a time slot, only 366 are used; out of these, 166 bits are taken by the service information, and only 240 bits are left for useful data. When a long packet is sent, the carrier frequency does not change during its transmission (three or five time slots), which allows the overhead to be reduced (in a 5-slot packet, 2,781 bits are used out of the total 5 × 625 = 3,125 bits). Even though the carrier frequency does not change during a long packet transmission, the 625-μsec time slots continue to be counted, and the frequency following a long packet transmission will correspond to the next time slot (i.e., several carrier frequencies will be skipped).

Two types of physical links—synchronous and asynchronous—can be established between master and slave devices.

Synchronous Connection-Oriented (SCO) (or isochronous) links are used to transmit isochronous traffic (e.g., digital sound). In these point-to-point links, the master device and its associated slave devices are specified in advance, and each link is assigned a time interval (in slots), during which slots are reserved for it. The result is symmetrical two-way links. Error packets are not retransmitted. The master device can establish up to three SCO links with one or several slave devices. A slave device may have up to three links with one master device or one link with each of two different slave devices. Under the network-classification criteria, SCO links fall into the circuit switching category.

Asynchronous Connection-Less (ACL) links perform packet switching using the “point-to-multipoint” scheme between the master unit and all the slave units of the piconet. The master device can connect any of the piconet’s slave devices in the slots not used by SCO by sending it a packet and asking for a response. A slave device can transmit only when it is addressed by a master unit (having correctly decoded its address). Most types of packets can be retransmitted in case of a reception error. A master unit also can send addressless broadcasting packets to all slave devices in its piconet. A master unit can establish only one ACL link with each of its slave units.

Information is sent in packets, whose data fields can be from 0 to 2,745 bits long. For ACL links, several types of CRC code-protection packages are provided (provisions are made for retransmitting data if an error is detected) and one without protection (no retransmissions). In SCO links, data are not protected by the CRC code. Consequently, retransmissions are not provided for.

Data-distortion prevention and data-integrity control are performed in several ways. Data in some types of packets is protected by CRC code, and the recipient of information must acknowledge receiving a correct packet or report a reception error. To reduce the number of repeats, the Forward Error Correction (FEC) redundancy coding is employed. With FEC 1/3, every payload bit is sent three times, meaning the most plausible version can be chosen by majorization. The FEC 2/3 scheme is more complicated. It uses Hamming code, which allows the correction of all single error instances and detect all double error instances in every 10-bit block.

Each voice channel provides 64 Kbits/sec transmission in both directions. Coding in the Pulse-Code Modulation (PCM) or Continuous Variable Slope Delta Modulation (CVSD; a version of adaptive delta impulse-code modulation) formats can be used in voice channels. PCM allows compression using the G.711 method. This provides only “telephone conversation” signal quality (meaning digital telephony with an 8-bit, 8 Kbps sample rate). CVSD provides higher quality, packing input PCM signal at a sample rate of 64 Kbps. However, even here the spectral density of the signal in the frequency range 4 KHz to 32 KHz must be insignificant. Bluetooth voice (audio) channels are not suitable for transmission of high-quality audio signal, although a compressed signal (such as an MP3 stream) can be sent perfectly through an asynchronous data-transfer channel.

The asynchronous channel can provide a maximum transfer rate of 723.2 Kbps in asymmetrical configuration (leaving the 57.6 Kbps band for the reverse channel) or 433.9 Kbps each way in the symmetrical configuration.

To provide security, Bluetooth uses data authentication and encryption on the link level. These may be complemented at the upper protocol level.

An important part of Bluetooth is the Service Discovery Protocol (SDP), which allows a device to find out about services on other Bluetooth devices. Having established a connection, the device can avail itself of the services it needs (e.g., to output documents to printer, connect to the web, etc.).

The RFCOMM protocol provides serial port emulation (9-wire RS232) via L2CAP. Traditional cable connections of the devices (including the null-modem) can be easily replaced by radio connection, without any modifications to the upper level software. The protocol also allows multiple connections (one device with many), and the radio connection will replace the cumbersome and expensive multiplexers and cables. The OBEX protocol, used in the infrared wireless connections (in the IrDA protocol hierarchy) can work through the RFCOMM protocol. The PPP protocol, which is located below the TCP/IP protocol stack, can also work through RFCOMM, opening the way to all Internet applications. The AT commands, which control telephone connections and fax transmission services (the same commands are used by the modems for dial-up lines), also work through RFCOMM.

The special bit-oriented binary Telephony Control Protocol (TCS BIN), which defines Bluetooth device connection call paging (for voice communications and data exchange) also works through L2CAP. Means to control groups of TCS devices also are available in this protocol.

Host-Controller Interface (HCI) is a uniform method to access low-level Bluetooth hardware and software resources. It consists of a set of commands for controlling radio communications, receiving status information, and data transmission itself. Through this interface, the L2CAP protocol interacts with Bluetooth equipment. The physical Bluetooth equipment can be connected to various interfaces, such as an expansion bus (e.g., a PC Card), a USB bus, or a COM port. For each of these connections, there is a corresponding transport-level HCI protocol and interlayer providing HCI’s independence from the connection method.