Page 63 - PDA Robotics Using Your Personal Digital Assistant to Control Your Robot
P. 63

PDA 04  5/27/03  8:27 AM  Page 39
                                  BOF       A  Chapter 4 / Infrared Communications Overview  EOF
                                                     C
                                                                                FCS
                                                               I
                                 SIR Coding
                                 This topic describes how IrDA miniport drivers or their IR NICs code
                                 frames for transmission at Serial IrDA (SIR) link speeds. The SIR spec-
                                 ification  defines  a  short-range  IR  asynchronous  serial  transmission
                                 mode with one start bit, eight data bits, and one stop bit. The maxi-
                                 mum data rate is 115.2 Kb/s (half duplex). This SIR coding scheme is
                                 called  return  to  zero,  inverted  (RZI).  The  primary  benefit  of  coding
                                 frames for SIR speeds is that existing serial hardware can be used very
                                 cheaply. The low cost of using serial hardware is one of the reasons for
                                 the widespread availability of IR SIR devices.
                                 The  BOF  flag  for  SIR  speeds  is  defined  as  0xC0.  The  EOF  value  is
                                 defined as 0xC1. To avoid ambiguity in a frame that contains BOF and
                                 EOF, an escape sequence is defined for values of 0xC0 and 0xC1 that
                                 occur in other parts of the frame. The escape character is defined as
                                 0x7D.
                                 For each byte that the transmitter encounters that is the same as a BOF,
                                 EOF, or the escape character, the transmitter performs the following
                                 steps:
                                  1. Inserts a control-escape byte (0x7D) preceding such a byte.

                                  2. Complements bit five of each byte that is the same as the BOF,
                                      EOF, or escape character (i.e., performs an exclusive OR opera-
                                      tion on such a byte with 0x20).

                                 MIR Coding

                                 This topic describes how IrDA miniport drivers and their IR NICs code
                                 frames for transmission at Medium IrDA (MIR) link speeds. The MIR
                                 data rates are 0.576 Mb/s and 1.152 Mb/s (half duplex).
                                 For MIR link speeds, definitions for BOF and EOF values are the same;
                                 both  BOF  and  EOF  are  defined  as  0x7E.  To  avoid  ambiguity  in  the
                                 frame with BOF and EOF, rather than using an escape sequence as is
                                 done at SIR rates, a zero is inserted at MIR rates after any five consec-
                                 utive  one  bits  in  all  members,  except  BOF  and  EOF.  Because  the
                                 process  of  inserting  and  stripping  zeros  at  the  bit  level  is  highly

                                                                                                39
   58   59   60   61   62   63   64   65   66   67   68