Feature
Untangling IrDA and Bluetooth
Compared with Bluetooth, IrDA is almost the forgotten wireless technology. Infrared ports are standard equipment on most laptops and PDAs, because they're useful and inexpensive. Before you decide to replace a cable with a Bluetooth connection, figure out your real requirements and look into IrDA.
By Greg Vrana, Technical Editor -- EDN, 9/27/2001
|
The promoters of Bluetooth are doing a good job of raising our awareness of the RF-based, short-range wireless technology. They aren't doing a good job of predicting when you will see store shelves filled with Bluetooth-enabled devices. One reason for the lack of Bluetooth products is cost. Components are $10 to $20, and component vendors are striving to get that figure down to the often-cited $5 point. Another reason is complexity. The technology is new, and engineers are still learning how to design to the 1000-plus-page specification (and that's just volume one). If you believe your next design can benefit from a short-range wireless connection, you may want to revisit an older technology that was designed to address many of the same problems as Bluetooth. Infrared is the original "cable-replacement" technology, but its impact has been nearly as invisible as the light it uses.
In 1993, 50 companies met to create the IrDA (Infrared Data Association, www.irda.org). In 1994, the association published the first IrDA specification, which defined the lower layers of the infrared protocol. Unfortunately, the IrDA assumed at the time that providing manufacturers with the basic ground rules for building infrared devices would be enough. The association left the upper level protocol and application layers up to the vendors. This strategy was fine for companies that built both ends of a system and could control the protocol on either side of the link. But without standards for exchanging organizer or business-card data, for example, manufacturers couldn't guarantee that their devices would work with devices from other manufacturers. This lack of standardization at the upper protocol layers slowed the adoption of IrDA technology. Although most notebook PCs contain an IrDA port, peripheral manufacturers haven't adopted the technology as rapidly as notebook manufacturers.
The IrDA soon realized what was happening, and it has been busy defining protocols for certain usage models—profiles—ever since. Currently, the IrDA has published specifications for using infrared to connect to LANs, exchange calendar and address-book data, download images from digital cameras, and even communicate with wristwatches. Some industry observers believe these specifications have come too late, allowing Bluetooth to catch up and eventually replace IrDA. The Bluetooth SIG (Special Interest Group, www.bluetooth.com) has certainly learned from IrDA's early mistakes. The group has already published profiles for 13 usage models, including faxing, phone headsets (Figure 1), and data synchronizing (for example, between PDAs and notebooks). The Bluetooth SIG even lifted one profile directly from the IrDA specification, saving itself and programmers some work.
There are two basic reasons to use a short-range wireless connection: One is to get rid of a cable between two devices, and the other is to allow ad-hoc, or "spontaneous," connections. Although connectors are relatively cheap and wire even cheaper, cable connections are prone to wear and tear, require users to always carry the correct—possibly several—cables, and are simply inconvenient. Adhoc connections allow users to quickly exchange business cards between PDAs or transfer files from their notebooks to their colleagues' (Figure 2). One of the more compelling ad-hoc connection applications is for POS (point-of-sale) purchases. The IrFM (IrDA Financial Messaging) SIG demonstrated its "Point and Pay" protocol in April. The upcoming IrFM specification defines payment usage models, profiles, and protocol layers to enable users to beam data to and from their financial accounts and IrDA-enabled POS terminals or vending machines.
What do you really need?Once you decide to add short-range wireless connectivity, you need to define the connection's requirements. This requirement list will help you choose between IrDA and Bluetooth. Or, you may decide that a wire's not so bad, after all. Data bandwidth is a good place to start. Bluetooth's raw data rate is 1 Mbps. If you need more than that, IrDA can go to 4 or 16 Mbps. If the devices are going to be more than 1m apart when they are communicating, you will probably have to go with Bluetooth. The IrDA specification defines a range of 0 to 1m within a 30° cone. Therefore, the receiver must be no more than 1m from the transmitter and within a 30° cone emanating from the transmitting infrared LED. In practice, the actual distance between the two devices can be 2m or more if you align the transmitter and the receiver along the same axis. The Bluetooth specification defines three classes of maximum transmitter-power output instead of a maximum range. Classes 1, 2, and 3 correspond to 100, 2.5, and 1 mW, respectively. Depending on the environment, a Class 3 transmitter has a range of about 10m, and a Class 1 transmitter should push out to about 100m.
Your operating environment affects not only range but how appropriate infrared or RF is to your application. If you can't guarantee a line-of-sight connection between the devices, you will have to use RF. Such situations include transmitting through walls, a briefcase, or your shirt pocket. On the other hand, because RF is omnidirectional, it is more susceptible to interception and less secure. The Bluetooth specification built security into the lower levels of the protocol—but at a price. An ad-hoc connection between Bluetooth devices is not as spontaneous as it is between IrDA devices. Exchanging business cards with IrDA is as simple as pointing two PDAs at each other and pushing a button. There's no ambiguity as to which devices are communicating. With Bluetooth, however, several devices may be within range, and the user has to select which device he or she wishes to communicate with. The Bluetooth protocol takes care of discovering other Bluetooth devices but not distinguishing between the PDA belonging to your colleague and the one belonging to the corporate spy behind the ficus plant.
The directionality of infrared light not only makes IrDA devices inherently more secure than RF devices but also makes them less susceptible to interference. Unless you point an IrDA device at the sun or other bright light source, interference is usually not a problem. Bluetooth devices, however, compete not only with other Bluetooth devices within their range but also with other devices using the ISM (industrial, scientific, and medical) band, such as IEEE 802.11 radios, cordless phones, and microwave ovens. Being radio-based, Bluetooth products are subject to FCC (Federal Communications Commission) and ETSI (European Telecommunication Standards Institute) approval. Another drawback of RF devices is that airlines don't allow their use during flight. Airlines allow you to use infrared devices on board except during takeoff and landing.
Another advantage of Bluetooth is that you can use it for point-to-multipoint applications. (IrDA limits you to point-to-point connections.) For example, Bluetooth allows you to create a piconet, consisting of a master and as many as seven slaves for an ad-hoc wireless network. But these types of applications go beyond simple cable replacement. WiFi (Wireless Fidelity) or IEEE 802.11b may be a better wireless-connection technology for applications involving more than two devices (Reference 1). Cost is another differentiator, and the advantage there goes to IrDA. You can add an IrDA port to your processor-based design for $1 or $2. Prices continue to come down for a complete Bluetooth bill of materials. Depending on the vendor and volumes, adding Bluetooth capability costs you an additional $15 to $25 per device. Over the next couple of years, that figure should drop by $5 to $10.
Another difference between Bluetooth and IrDA is subtle and perhaps even philosophical. Making a connection between two IrDA devices requires you to make a conscious decision followed by an action. You must physically point one of the devices at the other. Bluetooth devices, on the other hand, are constantly sniffing the ether for other Bluetooth devices and, depending on the application, can make a connection with another device without your intervention or knowledge. You may not even be aware of the existence of other Bluetooth devices.
Nothing prevents you from using Bluetooth and IrDA in the same device (Figure 3). Brightcom and Link Evolution believe that the two technologies are complementary rather than competing. The two companies are collaborating on a combination Bluetooth-IrDA module that connects to a mobile phone, giving you both types of connections. Link Evolution has also developed a protocol for using IrDA to simplify the pairing process between Bluetooth devices.
A closer lookAssuming IrDA offers the capabilities you need, you need to look at how to implement the technology. A place to start is the IrDA specification, which you can download from the IrDA Web site. Figure 4 shows a simplified diagram of the IrDA-protocol layers. The lowest layer, IrPHY (infrared physical layer), represents the IR transceiver. The IrPHY is always a hardware device and usually consists of a photodiode for the receiver, an infrared emitter for the transmitter, and an analog circuit for encoding the data and framing (Figure 5). The next layer is the IrLAP (Infrared Link Access Protocol). The IrLAP establishes and maintains a reliable data connection between two IrDA devices. The default state of a disconnected device is called NDM (Normal Disconnect Mode). During NDM, a device listens for other transmissions. If a device wishes to transmit, it must detect a 500-msec period of inactivity before beginning. All IrDA connections begin at 9600 bps. Once two devices connect, they exchange capability information and negotiate optimum communication parameters. The IrLAP maintains the link using error detection, retransmission, and low-level flow control.
The third protocol layer is called the IrLMP (Infrared Link Management Protocol) and depends on the reliable connection that the IrLAP established. The IrLMP allows multiple clients to use the same physical IrDA port and resolves address conflicts between devices. The IrLMP also contains the IAS (Information Access Service), which acts as a "yellow pages" of services available on the device.
The shaded boxes in Figure 4 represent optional protocols. TinyTP (Tiny Transport Protocol) adds flow control to each channel that the IrLMP maintains. IrOBEX (Infrared Object Exchange Protocol) supports file and object transfers. The Bluetooth SIG adopted this protocol for its specification. IrCOMM (Infrared Communications Protocol) emulates serial and parallel ports to support legacy applications. IrLAN (Infrared Local Area Network) enables access to a LAN via an IrDA access point, allows two devices to connect as if they were on a LAN, and allows a device to access a LAN via a computer that is already attached to the LAN.
The chip you use to interface to the IrDA transceiver depends on the functions you have available in your design. If you're using a PC I/O chip, such as National Semiconductor's PC8739x, you can connect an infrared transceiver directly to the chip's IR interface pins. If you have a serial interface available—from a microcontroller, UART, or RS-232 chip, for example—you need to use an IR modulator/demodulator or EnDec (encode/decode) chip. An EnDec chip translates serial data to and from the format that IrDA transceivers require. IrDA data modulation uses a maximum 25% duty-cycle return-to-zero pulse to limit power dissipation in the IR emitter. Depending on whether your UART has a 16× baud pin, you can use either the Agilent HSDL-7000 or HSDL-7001 EnDec IC or the Microchip MCP2120.
Sigmatel offers the STIr4200 USB/IrDA bridge chip, which interfaces an IrDA transceiver to a USB port. You can use the chip to embed an IrDA port in a USB-enabled design or to build a USB/IrDA dongle for desktop PCs.
The IrDA-protocol code size depends on the functions you want to put into your device. The IrDA publishes a document for a minimal IrDA implementation called IrDA Lite. The document describes how to minimize ROM and RAM by implementing only those functions necessary for compatibility with IrDA devices. IrDA Lite implementations range from a device that transfers data at 9600 bps to full-featured IrDA designs. If you implement a minimal IrDA Lite protocol stack, you can fit the code into as little as 4 kbytes of ROM and 150 bytes of RAM. These figures are based on an x86 architecture and compiled C code.
Microsoft added IrDA support beginning with Windows 95, and today you will find IrDA in Windows 98, ME, and 2000. Windows XP includes additional IrDA support for the VFIR (Very Fast IR) 16-Mbps extension and for USB attached IrDA devices. Embedded operating systems, such as Palm OS, Windows CE, and Pocket PC, and Wind River's VxWorks and PSoS also have native IrDA support. Linux also supports IrDA. Although Microsoft is working on Bluetooth support for Windows, the company will not ship Bluetooth drivers until they can test the software on a variety of Bluetooth devices. The bottom line is that there is no Bluetooth support in any Windows operating system, including Windows XP.
To ensure interoperability among IrDA devices, the IrDA created the IrReady certification program. You must submit your product to an IrDA-approved test lab to receive IrReady certification. IrDA-interoperability test labs include Actisys, Extended Systems, and Veritest. You can download testing guidelines from the IrDA Web site.
It's too soon to tell whether Bluetooth will untangle our lives by eliminating the cables dangling from our ears and desks. Although the technology is new, it has nearly 2500 SIG members and is enjoying a lot of attention. Bluetooth devices have a greater range, can communicate through walls and people, and don't require alignment to work. If you require these capabilities and can afford the added cost, then Bluetooth is a good choice. But if all you need to do is connect two nearby devices without wires, an infrared connection is a cost-effective alternative.
| For more information... | ||
| When you contact any of the following manufacturers directly, please let them know you read about their products in EDN. | ||
| Actisys 1-510-490-8024 www.actisys.com | Agilent 1-800-235-0312 www.semiconductor.agilent.com | Brightcom 1-760-918-5775 www.brightcom.com |
| Ericsson 1-972-583-0000 www.ericsson.com | Extended Systems 1-541-758-6123 www.extendedsystems.com | Handspring 1-716-871-6448 www.handspring.com |
| Link Evolution +81-3-5301-2700 www.linkevolution.com | Microchip 1-480-792-7668 www.microchip.com | Microsoft 1-425-882-8080 www.microsoft.com |
| National Semiconductor 1-408-721-5000 www.national.com | Palm OS 1-408-878-9000 www.palmos.com | Sigmatel 1-512-381-3700 www.sigmatel.com |
| Veritest 1-208-321-0098 www.veritest.com | Vishay Telefunken 1-402-563-6866 www.vishay.com | Wind River 1-510-748-4100 www.windriver.com |
| Author Information |
Living in Austin, Texas, Technical Editor Greg Vrana has a lot of experience with infrared rays. You can reach Greg at 1-512-338-0129 fax 1-512-338-0139, e-mail gvrana@earthlink.net. |
| Reference |
|















Living in Austin, Texas, Technical Editor Greg Vrana has a lot of experience with infrared rays. You can reach Greg at 1-512-338-0129 fax 1-512-338-0139, e-mail