Page 98 - PDA Robotics Using Your Personal Digital Assistant to Control Your Robot
P. 98
PDA 05 5/30/03 11:35 AM Page 74
PDA Robotics
packets, and then responds to one of the packets. The packet it
responds to determines the “time slot” to be used by the secondary
device. For example, if the secondary device responds after packet
number 2, then the secondary device will use time slot 2. If the sec-
ondary device responds after packet number 0, then the secondary
device will use time slot 0. This mechanism allows the primary device
to recognize as many nearby devices as there are time slots. The pri-
mary device will continue to generate time slots, and the secondary
device should continue to respond, even if there is nothing to do.
During NDM, the MCP2150 handles all of the responses to the primary
device (Figure 5.28) without any communication with the host con-
troller. The host controller is inhibited by the clear to send (CTS) sig-
nal of the MCP2150 from sending data to the MCP2150. Note the fol-
lowing:
• The MCP2150 can only be used to implement a secondary
device.
• The MCP2150 supports a system with only one secondary device
having exclusive use of the IrDA standard IR link (known as
point-to-point communication).
• The MCP2150 always responds to packet number 2. This means
that the MCP2150 will always use time slot 2.
• If another secondary device is nearby, the primary device may
fail to recognize the MCP2150, or the primary device may not
recognize either of the devices. This is not the case with the soft-
ware developed for the PDAs. I get a list of all secondary devices
that respond to the discovery request and look for the identifier
for PDA Robot, which is “Generic IrDA” (the default setting of
the MCP2150). My printer and PDA Robot always respond, and
the software only connects to PDA Robot.
Discovery Mode
Discovery mode allows the primary device to determine the capabili-
ties of the MCP2150 (secondary device). Discovery mode is entered
once the MCP2150 (secondary device) has sent an XID response to the
primary device and the primary device has completed sending the
XIDs, and then sends a Broadcast ID. If this sequence is not complet-
ed, then a primary and secondary device can stay in NDM indefinite-
74