Issue
138 January 2002
WHAT
GOOD IS IrD,Eh?
PART
1: CORDLESS PROTOCOL
byJeff
Bachiochi
Start
Standards Make It Happen
IrPHY
The Range
UART To IrDA IR
Encoder/Decoder
Gimme More Sources
& PDF
UART to IrDA
Data transmission
via a UART needs to be only slightly modified to be considered
IrDA-compatible. As stated earlier, to reduce the IrDA
power requirement to a minimum, the actual IR on time
is reduced to a minimum of 1.62 µs (or a maximum of 0.1875
bit time) during each 0 bit time. Some additional circuitry
is required between the UART and IR transmitter/receiver
to encode/decode serial bit timing and IR pulses.
This is usually
accomplished by providing a 16× (data rate) clock to a
circuit, which will divide each bit time into 16 time
slots. Some systems can provide this clock because their
UART may already have a 16× clock. The Texas Instruments
TIR1000 in Figure 2 is a standalone IrDA encoder/decoder
(TL16C550C UART has a data out 16× clock).
|

(Click here to enlarge)
|
Figure
2—This Texas Instruments device produces an IR pulse
delayed by 0.5 bit time from the TX = 0 bit. A received
IR pulse produces an RX = 0 bit immediately upon reception. |
Although the
TX serial data of the UART is high, no IR pulses are created.
When the TX serial data goes low (start bit), the TIR1000
starts counting 16× clock cycles. At the end of the seventh
cycle, the IRTX output is driven high. The IRTX is driven
low after three 16× clock cycles. This IR pulse generation
(equal to 0.1875 bit time) is repeated if the TX serial
data is sending another 0 bit after the sixteenth 16×
clock cycle.
IR reception
is done similarly. Because the IR pulse is shorter than
a bit time, the circuitry must lengthen the IR pulse into
standard bit timing for the UART. So, whenever an IR pulse
is seen at the IRRX input, the TIR1000 drops its RX output
for 16 16× clock cycles (1 bit time). A lack of IRRX input
pulses keeps the RX output high. Notice that with this
scheme (transmitter/receiver), the received data is delayed
(in this case, 0.5 bit time) from the transmitted data
but does not cause problems because the data timing is
based on the start bit.
When a 16× clock
is not available, there are other options. The TOIM4232
from Vishay or MCP2120 from Microchip are similar devices
that contain an optional clock generator (see Figure 3).
Data rate selection is by jumper or via TX serial data
(while a mode pin is active). This means that a UART can
change data rate (and the 16× clock), but this device
will not know there is a change unless a software change
routine is used to update the device.
|

(Click here to enlarge)
|
Figure
3—The Microchip MCP2120 shown here produces an IR
pulse delayed by 0.5 bit time on all TX = 0 bits.
A received IR pulse produces an RX = 0 bit delayed
by a 0.5 bit time from the received IR pulse. |
You must take
this into consideration if it will be necessary to change
data rates within your application. The default (initial)
connection data rate for IrDA is 9600 bps, so you must
at least run at 9600 bps to be IrDA-compatible. Changing
the data rate is an option and not a requirement.