SLAA202B February   2005  – December 2018 MSP430F149 , MSP430F149 , MSP430F2252-Q1 , MSP430F2252-Q1 , MSP430F2272-Q1 , MSP430F2272-Q1 , MSP430F2274 , MSP430F2274 , MSP430FG4619 , MSP430FG4619

 

  1.   Implementing IrDA With MSP430™ MCUs
    1.     Trademarks
    2. 1 Introduction
    3. 2 Hardware Description
      1. 2.1 Hardware Overview
      2. 2.2 Circuit Description
    4. 3 Software Description
      1. 3.1 Implementing IrPHY Layer Using Timer_A
        1. 3.1.1 Transmission
        2. 3.1.2 Reception
      2. 3.2 Implementing IrPHY Layer using USCI_A0
      3. 3.3 Implementing IrLAP
        1. 3.3.1 Discovery Services
        2. 3.3.2 Connect Services
        3. 3.3.3 Data Services
        4. 3.3.4 Disconnect Services
      4. 3.4 Implementing IrLMP
        1. 3.4.1 Discovery Services
        2. 3.4.2 Link Connect and Connect Services
        3. 3.4.3 Data Services
        4. 3.4.4 Disconnect Services
      5. 3.5 IAS Implementation
      6. 3.6 TTP Implementation
      7. 3.7 IrCOMM Implementation
      8. 3.8 Application Layer
    5. 4 PC Demonstration Application
    6. 5 IrDA Protocol Basics
      1. 5.1 Physical (IrPHY) Layer
      2. 5.2 Link Access Protocol (IrLAP) Layer
      3. 5.3 Link Management Protocol (IrLMP) Layer
      4. 5.4 Information Access Services (IAS)
      5. 5.5 Tiny Transfer Protocol (TTP)
      6. 5.6 IrCOMM
    7. 6 IrDA Communication Diagram
    8. 7 Frame Exchange Log
    9. 8 References
  2.   Revision History

Discovery Services

IrLAP routines are responsible for the negotiation of the link and identification exchange while in NDM mode. The first communication that happens between devices is the identification exchange (XID) process. During this time, the primary issues a cycle of XID frames according to the set number of discovery slots. The frame is received and parsed. First, it is identified as an unnumbered (U) frame by checking bits 0 and 1 of the IrLAP control byte, and if they are both 1, then the frame is in the unnumbered format. To identify the unnumbered frame as an XID command frame, bit 5 of the byte is tested next. If this bit is 1, then the identification process of an XID command frame is positive (control bytes shown in Figure 7).

unnumbered-and-xid-command-frame-formats.gifFigure 7. Unnumbered and XID Command Frame Formats

As soon as an XID command frame is identified, the discovery flag is checked to see if the XID command has been answered already. If discovery has not happened yet and the frame is not the final slot frame, which is marked by a 0FFh slot number, then an XID response is sent out. The routine in charge of assembling the XID response frame first verifies that the frame was sent for the broadcast address (0FFh) and then produces a frame with the format of an IrLAP XID response frame as the one seen in Figure 8.

discovery-response-xid-format.gifFigure 8. Discovery Response XID Format

The MSP430 is set to always answer to discovery slot 0. Therefore, when the first discovery slot is sent by the primary, a frame is sent that claims that spot by issuing the XID response frame. This means the following XID command frames are ignored.