Theory
IrDA supports a wide variety of data rates. Currently there are four different physical specifications, each have their own encoding schemes. Table 1.1 shows the specifications starting with the most widely used, SIR. Since this design project will use Serial Infrared (SIR), very little will be discussed about the other specifications. SIR speeds are sufficient for IrDA transmissions especially those that involve little amounts of data like schedules or business cards.

The IrDA protocol follows a stack architecture. Table 1.2 summarizes the layers of IrDA. The physical layer is typically at the bottom and layers increase in complexity as you ascend to the top. Applications that control the stack are usually at the top and interface with the most top layers. The layers are all interconnected and information is passed from one stack to another for data interpretation. There are six core layers that will be discussed in detail. 

The physical layer specifies transmission characteristics, including transceiver properties and encoding/decoding schemes. It encompasses the low-level components needed to send and receive infrared pulses. To send an infrared LED is needed as a controller is used to generate proper pulses of infrared energy. The encoder takes data bits and converts them into voltage signals that are fed in the LED. On the receiving side, a photoreceptor is used to detect the infrared energy and convert them into voltages so they can be interpreted by a receiver (decoder) to produce ordinary bits. A controller is a hardware component that drives the transceiver. For different IrDA specifications, the controller�s responsibility and algorithm changes. In the SIR case, an ordinary RS-232 controller with a universal asynchronous receiver transmitter (UART) simply takes the bytes and modulates them to produce pulses, thus performing its own framing. In more complex specifications (MIR,FIR,VFIR), a controller generally employs much efficient algorithms for moving large amounts of data bytes and then does all the framing required so that the output is ready to drive the transceiver circuit. Generally, the faster the transmission rate, the more complex the controller is. Figure 3 shows a block diagram of the physical layer components.  The optimum wavelength for infrared signals is 880nm.  There are several constraints formed by IrDA that must hold for all transceivers. Some include maximum intensity, minimum intensity, rise and fall times of pulses, maximum overshoot and pulse duration to name a few.  Maximum intensity cannot be too large otherwise it will blind the receiver if the person positions their receiver too close. This variable is limited to 500mW/sr. Oppositely if an LED does not transmit strong enough, the signal will be too dim and not perceived. SIR transceivers must achieve no lower than 40mW/sr. In order for a receiver, to correctly interpret a signal, the transmitter must create the pulse within certain constraints.  Rise time is defines as the time a signal grows from 10% to 90% of its steady state value. Fall times are appropriately defines as the time the signal decreases from 90% to 10% of its value. Figure 4 shows the infrared signals are not ideal square pulses but actually takes time to reach the final value, hence we have rise and fall times. For SIR speeds rise and fall times must be less than 600 nanoseconds. For higher speeds this number should be lower (i.e for MIR it is 40 ns). As the signal rises it usually surpasses the final value thus causing overshoot, this should be limited to 25% for all speeds. Once an infrared pulse begins, it must remain on for a predefined period for it to be recognized as a valid pulse. This parameter varies with different speeds. For SIR it can range from 1.41us too a maximum of 88.55us. For my purposes (115kbps) the nominal value is 1.63us. Signal modulation in the physical layer is fairly simple. Data bytes taken from the UART compatible controller is passed through an infrared transmit encoder and then produces the IR signal. However, there are three basic important functions that take place in the transmit encoder. The first is it inverts the data bits, so that a �0� becomes a �1� and vice versa. This is done since most the data bytes have more ones than zeros so as to minimize power consumption they make a zeros turn on the LED. Secondly, it generates a signal that is 3/16 the width of the original RS-232 signal. Finally, it adds a start bit (0) and a stop bit (1) after every byte so the device knows how to organize the information. Figure 5 summarizes the three functions. The pulse on the top shows the original UART signal and the bottom pulse is the output that will drive the IR LED.

The second layer from the bottom of the stack on top of the physical layer is called the Framer/Driver. The driver part is mainly software oriented that interfaces with the microcontroller. The framer takes packet data from upper stack layers and organizes it into frames that can be transmitted. Drivers perform four functions; initializing the controller (setting data rate of the controller to 9600bps), setting the data rate at which the controller sends and receives data during normal response mode (NRM), delivering data from other layers to the controller so it can be transmitted and finally delivering data from the controller to other layers. The basic work for a framer is to accept an IrLAP packet and prepare it for transmission. Within the responsibilities of a framer, it has to add other bytes such as Beginning of Frame (BOF) and End of Frame (EOF) to the packet to make it valid. The BOF is a single byte of value $C0 that is added to indicate the start of a frame. Similarly, EOF is also a single byte of value $C1 that marks the end of a frame.

The next layer is the IrDA Link Access Protocol (IrLAP). This layer builds and interfaces with the framer/driver layer to maintain a communication link. It is the fundamental building block of all infrared connections. A basic brief picture of what IrLAP is about will be illustrated without going deep into the software related rules and protocols. Every IrLAP connections is made up of a primary device and a secondary device. The primary device is responsible for initiating deice discovery, negotiation and maintaining a connection. The secondary device responds to device discovery, negotiation and connection requests. Thus in this project, the kiosk will be the secondary device and the PDA (or any other IrDA enabled device) will be the primary.

The layer above the IrLAP is Infrared Link Management Protocol. This layer provides service multiplexing over an IrLAP link. IrLAP establishes and maintains only one physical link, making it possible for only one application to use the link. IrLMP provides multiple application channel over a single IrLAP connection. Although this might not always be used, sometimes it is needed in situations where it may be useful to launch two point and shoot applications in opposite directions.

The next two layers are TinyTP and IAS (Information Access Service). The fundamental purpose of TinyTP is to provide an application with the ability to submit arbitrary large files by breaking them up into small packets that can be reassembled by the other device. IAS can be compared to the �yellow pages� where services are looked up. Any additional information is stored in the IAS, so that if a device needs to know the address of a register or name of the device, it would just retrieve it from the IAS by sending a specific code that would correspond to a service.
Hosted by www.Geocities.ws

1