Primitive IR Sender Receiver Protocol

boooooong!!!!
sender statediagram
Sender State Diagram
recevier statediagram
Receiver State Diagram

SENDER.BS2
RECEIVER.BS2

This extraordinarily simple protocol filters out a good percentage of IR noise.  It relies on a sender emitting a series of start flags followed by a data packet of lengths up to 16 bytes.  The receiver analyzes all IR signals at 40hz and waits to receive a consecutive series of start flags of some minimal length.  Upon receiving this series the receiver reads all data until something other than the start flag is found.  This data is considered valid under this protocol and is immediately passed on to the client computer via the serial port.
 
 
Advantages:
  • The start flag currently in use is 80h or 10000000b.  Its binary sequence contains no internal cyclical pattern which prevents a delayed reception from accepting the flag.  For example, a flag like 10101010 could be received any multiple of two bits in shift and considered valid if directly followed by another start flag.  Also, the ASCII representation of the flag is the <delete> character, which will not be sent in a reasonable text package.
  • The noise filter this protocol provides is statistically significant when few IR sources are within range of the receiver.  We have demonstrated nearly 70% correctness at distances up to approximately three meters with constant 40hz, IR garbage transmitted only inches from the receiver (fluorescent lights aglow).
  • The receiver lightens the serial load on the client computer by passing only valid data packets.
Disadvantages:
  • Any 40hz IR signal arriving just after the start flag series is considered valid.
  • Communication is unidirectional.  Lost data packets are never recognized or retransmitted.
  • Packet sized is currently fixed which does not easily allow for application expansions.
  • Because no bit or character stuffing occurs, application developers are restricted from transmitting arbitrary, binary data.