IrPHY - Physical
The IrPHY layer specifies the actual characteristics of the IrDA infrared data as transmitted over the physical medium - air.
As infrared light within air is an imperfect physical medium, ie susceptible to corruption, errors may occur within the IrPHY layer. Any errors are detected and corrected in the higher layers.
Because IrDA specifies that the same infrared light frequency is used for both transmit and receive nodes in the same physical medium, use of IrDA forces a half-duplex link - only one node may transmit at any one time.
For an IrPHY compliant device:
These constraints are most easily satisfied by the use of commercial IrPHY compliant devices.
The payload data, which consists of 8 bits, is framed where each IrPHY character consists of:
The IrPHY data is transmitted serially with the LBb first.
The IrPHY duty cycle is 3/16 for both transmission and reception where a 0 is represented by a pulse and a 1 is represented by no pulse.
Thus, when transmitting a physical zero, the infrared LED is pulsed with 3/16 of the baud rate period. When transmitting a physical one, the infrared LED is not pulsed.
According to the IrDA specifications, the XBOF flag may have a value of either 0xC0 or 0xFF. However, all existing stacks investigated use a value of 0xFF. Conveniently, using a value of 0xFF for the XBOF flag allows a receiving IrDA device(s) to easily synchronize and detect a pending start of frame by 1 mark followed by 9 spaces.
All payload data is packed into IrPHY frames where each frame consists of:
Between the BOF and EOF flags, so that the receiver may easily determine the start and end of each frame, no payload data or FCS character may have the same value as the BOF, EOF or control escape (CE) flags. If so, these characters are escaped, ie byte-stuffed, using the CE character (0x7D):
For convenience and simplicity, data within stack dumps is listed prior to IrPHY byte-stuffing, ie BOF and EOF flags may appear in the payload data.
Serial Infrared (SIR)
SIR covers all of the standard baud-rates from 9600 up to 115K2 bps inclusive.
This is the IrDA entry point which is designed to be low cost and allows the infrared port to use the same hardware and baud rates as a standard serial port, eg the 16550A UART widely used in PCs.
According to the IrDA specifications, 2400 bps is also covered as part of the SIR baud rates. This baud rate is not used and is irrelevant because discovery, which uses default, 'least common denominator' settings, uses 9600 bps.
Fast Infrared (FIR)
FIR covers one standard baud-rate 4 Mbps - this is out of scope.
Very Fast Infrared (VIR)
VIR covers one standard baud-rate 16 Mbps - this is out of scope.
IrDA Port - Discrete Components
There are numerous IrPHY compliant devices that allow nodes to interact using IrDA.
There are two main parts to an IrPHY device:
An encoder/decoder usually allows the baud rate to be set and transforms the serial data stream, ie 1 + 8 + 1 bits, to and from IrPHY pulses. Because of the critical timing required for IrPHY, the timing of the encoder/decoder circuitry must be crystal controlled.
An example encoder/decoder is the Microchip MCP2120.
A transceiver typically consists of one transmit LED and one receive photo-receptor. Example transceivers are the:
IrDA Port - Dongles
Rather than construct an IrDA port, a more convenient approach is to use a commercially available dongle.
There are two classes of IR dongles: 'combined' and 'transceiver only'.
Combined Encoder and Transceiver Dongle - SIR
This class of infrared dongles incorporates the IrDA encoder, IR transmitter, IR receiver, and IrDA decoder. These are SIR devices and the host system does not need any other IrDA specific hardware. Dongles in this class usually come with a female DB9 connector and are designed to interface to a traditional RS-232 serial port. There is no IrDA standard for this class of dongles and the host system must drive the RxD/TxD data and control lines accordingly. Typically, these dongles are self-powered from the control lines and the required baud rate must be selected by setting the DTR and RTS control lines.
Examples of such dongles are:
Transceiver Only Dongle - FIR
This class of infrared dongles incorporates the IR transmitter and the IR receiver only. These are FIR devices and the host system must have the necessary IrDA encoder/decoder controller. Dongles in this class usually come with a mini DIN-8 connector and are designed to interface with an IrDA encoder/decoder controller inside the host. There is an IrDA standard for this interface.
One example of such an IR dongle is the ACTiSYS IR2000L.