Infrared communications using the IrDA standard

The rapid emergence of mobile terminals in work and home environments is accelerating the introduction of mobile wireless digital links. But portable devices are subject to severe limitations on size, weight, power consumption and battery lifetime. The desire for inexpensive, high-speed links satisfying these requirements has motivated the interest in infrared wireless communication.

Article Tools

Infrared radiation, as a medium for short-range communication, offers several significant advantages over RF transmission, especially if you are looking for a short-range, low-power, high data-rate connection. High-speed infrared transceivers are available at low cost. Market analysis indicates that Bluetooth links are up to five times more expensive to integrate than infrared links.

The infrared spectral region offers virtually unlimited bandwidth that is unregulated worldwide. Infrared and visible light are close together in wavelength, but have one distinct difference: both types of light can penetrate glass, but not walls or other opaque barriers. Infrared transmissions are confined to the originating room.

Clearly, the directed spreading of the beam might be the major drawback of infrared. The infrared device must be pointed at the device one wants to communicate with. RF transmission shows an undirected non-line-of-sight behavior.

But this can also be an advantage if security or a “noisy” environment are considered. Infrared communication is by nature more secure against casual eavesdropping, and it prevents interference between links operating in different rooms or neighboring cells.

Infrared communications can potentially achieve a very high aggregate capacity, and their designs may be simplified, since transmissions in different rooms need not be coordinated.

The other infrared disadvantage is noise in the infrared ambient. In many indoor environments, there exists intense noise, arising from sunlight, incandescent lighting and fluorescent lighting. This is a reason why infrared communication is typically limited to short-range distances, unless high optical (and, thus, electrical) output power is employed.

Characteristics and key features of the IrDA connection

An IrDA infrared connection is established solely by a directed infrared beam, for bi-directional half-duplex communications. The lowest signaling rate is 9,600 bps, and the highest currently specified is 16 Mbps.

Nevertheless, most devices available today operate at a maximum of 4 Mbps. The range of the line-of-sight connection is at least 1 meter, but, typically, 2 meters can be reached.

There is also a low power version available with a limited range objective of 20 cm, but at 10 times less power consumption. IrDA connections are suitable for point-to-point and even point-to-multipoint. IrDA is very popular with portable devices, such as notebooks, handheld computers, digital cameras, electronic books, toys, and watches.

Once upon a time

At one time, there were data communications by means of an asynchronous serial connection — by wire. Some people might remember these annoying settings for 9600 baud: no parity, two stop bits, or was it 19200 baud: no parity, single stop bit? The bit stream of pulses in a serial interface frame look like the pulses in Figure 1.

A typical universal asynchronous receiver/transmitter (UART) controller unit is the 16550, see Figure 2. The UART typically retrieves the data bits from the received bit stream (Rx), is responsible for serial to parallel conversion, and is also responsible for parity checking and data buffering. For the transmit path (Tx) the inverse operations are performed. The UART can be embedded in a PC, laptop or can be connected to a microcontroller or microprocessor over its bus.

Infrared starting Point

This environment was the starting point for the introduction of the infrared communications, according to the IrDA specification. The Tx and Rx lines are replaced by an optical link, the infrared beams, transmitted by LEDs. The LED, together with its power driver and the infrared detector, are encapsulated in a single component, a transducer module, or infrared transceiver, as shown in Figure 3.

But the infrared signaling imposes a different modulation to the conventional serial connection. The modulation schema is shown in Figure 4. Only a “0” bit is transmitted, in the form of a short infrared flash with a length of 3/16 of the bit time. Therefore, an encoder/decoder module is required to connect to a conventional UART.

The circuit implementation of the encoding/decoding is rather simple.

Alternatively the encoder/decoder can be embedded into the UART. Most of the many UART units with IrDA extensions are now of this style. Please note that this modulation schema is used for a signaling rate of up to 115.2 kbps (starting at 9.6 kbps).

For higher signaling rates, more sophisticated modulation schemes are necessary.

For 0.576 Mbps and 1.152 Mbps, the optical pulse duration is nominally 1/4 of a bit. For 4 Mbps, the modulation schema is 4PPM. In it, a pair of bits is taken together and called a data symbol. It is divided into four “chips”, only one of which contains an optical pulse. For 4 Mbps, the nominal pulse duration (chip duration) is 125 ns. A “1” is represented by a light pulse. See Table 1.

For 16 Mbps transmission, the HHH(1, 13) code — a low duty cycle, rate 2/3, (d, k) = (1, 13) run-length limited (RLL) code — is used as the modulation code to achieve the specified data rate. The HHH(1, 13) code is guaranteed for at least one empty chip, and at most 13 empty chips, between chips containing pulses in the transmitted IR signal.

The 16 Mbps rate packet frame structure is based on the current IrDA-FIR (4 Mbps) frame format with modifications introduced where necessary to accommodate the requirements specific to the new modulation code. Furthermore, the HHH (1,13) code is enhanced with a simple scrambling/descrambling scheme to further optimize the duty cycle.

IrDA controller key feature

An IrDA controller is not only responsible for modulation and demodulation, it is also involved in encoding/decoding, CRC generation/checking, bit and character stuffing, preamble, start and stop bit generation, framing, synchronization by means of a DPLL for higher data rates, and data buffering.

These tasks cannot be performed by a CPU (or by means of software) efficiently. A hardware implementation is the only choice. Unfortunately, the modulation and the encoding differ from signaling rate to signaling rate. Let's take a closer look on the encoding on the basis of the 4 Mbps (FIR).

4 Mbps signaling rate (FIR)

For the 4 Mbps rate, 4PPM modulation is used. Pulse position modulation is achieved by the definition of a data symbol duration (Dt) that is further divided into four equal-length time slices called chips (Ct), with Dt = 500 ns and Ct = 125 ns.

Each data symbol represents two bits of payload data, or a single data bit pair, so that a byte of payload data can be represented by four data symbols in sequence. Table 1 defines the chip pattern representation of the four valid and unique data symbols.

Logical “1” represents a chip duration when the transmitting LED is emitting light, while logical “0” represents a chip duration when the LED is off.

In the packet format of 4 Mbps, the 4PPM encoded symbols reside in the DD field — see Figure 6. The preamble field (PA) is used by the receiver to establish phase lock.

During PA, the receiver begins to search for the start flag (STA) to establish symbol synchronization. If the STA is received correctly, the receiver can begin to interpret the data symbols in the DD field.

The receiver continues to receive and interpret data until the stop flag (STO) is recognized. STO indicates the end of a frame. The chip patterns and symbols for PA, STA, and STO are shown in Figure 6.

The frame check sequence (FCS) is a 32-bit field that contains a cyclic redundancy check (CRC) value. It consists of the 4PPM encoded data resulting from the IEEE 802 CRC32 algorithm.

Back to back, or “brick-walled” packets are allowed, but each packet must be complete (i.e., containing PA, STA, DD and STO fields). Brick-walled packets are illustrated in Figure 7.

There are further media interface specifications. For example, the maximum and minimum single pulse durations (115 ns and 135 ns) and the maximum and minimum double pulse durations (240 ns and 260 ns) — double pulses may occur whenever two adjacent chips require a pulse. The rate tolerance is limited to +/-0.01 percent.

So far, this article has covered the physical layer of IrDA (IrPHY). Please note that the physical representation differs significantly from signaling-rate to signaling-rate, due mainly to the evolutionary history of IrPHY.

SIR, MIR, FIR

There are many terms in circulation for the different signaling rates. For clarification, the Table 2 gives an overview. Please note that most acronyms are either not defined by IrDA or are already obsolete. Nevertheless, they are very popular.

System partitioning

Figure 8 illustrates the main components of a typical IrDA controller: the kernel, a bus bridge and an interrupt and direct memory access (DMA) service block for the connection to the CPU.

On the other end, the IrDA controller is connected to an IrDA transceiver. There are many vendors for the optical interface on the market.

Transmit

When an IrDA frame is to be transmitted, the CPU assembles the payload data, such as a 32-byte sized segment of a MPEG coded music title, and transfers the data over the on-chip bus to the IrDA controller.

The on-chip bus might be an ARM Ltd. (www.arm.com) AMBA bus — a widely used bus system for mobile systems. The transfer could be delegated to a DMA controller so the CPU is not further stressed, and it is immediately free for others tasks.

Burst transfers guarantee full bus utilization. It is the bus bridge's task, together with the FIFO, to buffer the incoming bursts from the bus, to unwrap the 32-bit-sized words to 8-bit, and to handle bus control and IRQ signals.

For the higher signaling rates, a 48 MHz clock frequency is required, which rarely meets the clock rate of the bus, as given by CPU system.

Special care must be taken for the clock domain crossing from the bus clock to the kernel clock domain (48 MHz). Within the kernel side, the payload data stream is serialized and finally encoded and modulated to the arranged signaling rate — an example for the 4 Mbps rate was given above. The raw on/off single line Tx signal is sent directly to the IrDA transceiver, and it is responsible for the conversion of the electric signal to the optical signal.

Receive

An incoming optical signal is converted by the external transceiver unit infrared detector into the electrical Rx signal. The asynchronous signal is then synchronized to the kernel clock domain.

For signaling rates of 4 Mbps and higher, a DPLL retrieves the data out of the asynchronous stream. In contrast to a UART-style clock recovery, the DPLL uses not only a single edge to set the phase, but uses the timing information of all signal edges, resulting in a sampling clock with much less jitter.

An analog PLL might achieve even less jitter, but it would not be capable of achieving phase lock as rapid as a DPLL. Rapid phase lock is mandatory because it determines the length of the preamble (or training sequence), sent at the start of every packet to allow phase lock.

After synchronization, the demodulation is achieved by one of the blocks (RZI, 4PPM, or HHH [1,13]), according to signaling rate. Note that a 4 Mbps IrDA device can communicate with an older 115.2 kbps device, as well, because the IrDA standard defines the first contact between new devices is always 9,600 bps (mandatory signaling rate). Higher protocol layers also ensure that a maximum signaling rate is arranged no higher than the maximum of the slower device.

Table 2: Acronyms used for the different signaling rates.
Acronym Slang Data Rate Modulation Remarks
SIR Slow infrared 9.6 kbps to 115.2 kbps RZI Official IrDA definition is serial infrared
MIR Medium infrared 576 kbps and 1152 kbps RZI Never defined by IrDA
FIR Fast infrared 4 Mbps 4 PPM Obsolete term
VFIR Very fast infrared 16 Mbps HHH (1,13) Obsolete term

After demodulation, the data is decoded and checked for CRC correctness. Any difficulties that might arise are asserted by an interrupt request signal (unless masked) to the CPU. The final steps (such as serial/parallel conversion, clock domain crossing, and FIFO buffering) are sent back in the transmit direction.

IrLAP and higher protocol layers

Up to now, this article has just examined the lowest layers defined by IrDA, namely IrPHY and some parts of the Ir link access protocol (IrLAP). Figure 9 shows which layers of the protocol stack are covered by the IrDA controller (highlighted in yellow).

IrLAP describes the functions and services for the half-duplex interconnection at the data link layer (the OSI Layer 2), and is based on the HDLC protocol.

Due to IrLAP's nature, most of its functionality has to be implemented by means of software, typically coded in C/C++. Only the encoding and decoding can be efficiently performed by hardware.

IrLAP offers the following services:

  • Discovery — to determine what devices are available within communication range;
  • Connect — to establish a connection to a device already addressed;
  • Data and status — to handle the data transfer; and
  • Disconnect — to intentionally terminate a logical connection.

During link initialization, IrLAP chooses a random 32-bit device address. As a result, there is no need to maintain fixed addresses for IrDA devices. The service address conflict is available to detect and resolve address conflicts, although it is very unlikely that two or more devices within range of each other will choose an identical address.

Figure 10 gives an overview of the (most important) layers of the IrDA protocol stack. The lower layers (here colored in yellow) are mandatory. IrPHY has to be implemented in hardware and is described above. IrLAP is in charge for the reliable device-to-device connection and the ordered transfer of data. IrLMP provides the multiplexing of the IrLAP layer, hence multiple channels above an IrLAP connection are possible.

There are several optional protocols available (colored green in Figure 10). They are device or application specific. The link management information access service (LM-IAS) provides the services necessary to allow applications to discover devices and to access device-specific information out of a small data base.

Tiny-TP is a rudimentary transport protocol to provide flow control on IrLMP connections with an optional segmentation and reassembly service to prevent deadlock situations. A deadlock could occur in a multiple-device scenario due to limited buffer space. Tiny-TP adds a single byte of overhead to each frame, serving as a “credit” to be distributed by a device among its applications, ensuring communication without running out of buffer space.

The highest layers are defined to particular applications, such as IrTran-P to capture images from digital cameras, IrCOMM to emulate a serial (or parallel) port connection for legacy applications (such as printing or modem devices).

IrOBEX provides object exchange services similar to HTTP. IrMC specifies how mobile phones can exchange information, including phonebook, calendar, and message data.

The author would like to express his appreciation to Thomas Luftner and Friedrich Seebacher, both from Dice GmbH & Co. KG (www.dice.at), for their assistance in preparing this article.

ABOUT THE AUTHOR

Markus Schutti is the technical director for digital design research and development at Dice GmbH & Co. KG (www.dice.at) in Linz, Austria. He has 11 years experience in the design and verification of complex digital circuits and processor architectures. Schutti holds a Ph.D. degree from the Johannes Kepler University in Linz. He can be reached at markus.schutti@infineon.com.

Infrared Data Association (IrDA)

Line-of-sight infrared links are well known and have been used for many years in remote-control units, such as those used with television sets. In the early development stages, the protocols were not standardized. Consequently, end users ended up with numerous remote controls lying around the living room.

In September 1993, the Infrared Data Association (IrDA, at www.irda.org) determined the basis for the IrDA serial infrared (SIR) physical layer link specification. In the following years, IrDA successfully established a comprehensive standard for infrared data communications, from the low layer — specifying optical and electrical issues — to high software layers, such as IrFM for “point and pay” financial messaging, published in January 2003. IrDA is the one and only standard for the infrared communication in today's consumer products.

The IrDA is founded as a non-profit organization, with its headquarters in Walnut Creek, California. The charter is to establish and promote an infrared standard that provides convenient cordless connectivity and fosters application interoperability over a broad range of platforms and devices.

Want to use this article? Click here for options!
© 2010 Penton Media Inc.


Acceptable Use Policy blog comments powered by Disqus


Latest Issue

Features:

View Entire Issue

Most Popular Stories

Resources

Special Coverage

CTIA Wireless IT & Entertainment 2008

Read the latest from the show...