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

Link Connect and Connect Services

Because all IrLMP data is exclusively in I-format frames from IrLAP, the first parsing that occurs to identify an IrLMP frame is at an IrLAP level. If the frame is not recognized as an IrLAP packet, then IrLMP parsing takes place. First, there is a check to see if it is an IrLMP data frame by checking byte 3 of the IrLAP frame and testing bit 7. This is a characteristic of data transfer packets in IrLMP which provides easy identification of frames carrying IrLMP data. Then, by checking byte 5 of the frame it is possible to recognize the IrLMP command being issued by the primary. If bit 0 of this byte is set, then the command is an IrLMP connect command. On the receipt of this command, the program enters the IrLMP connect confirm routine.

The responsibilities of this routine are to store the DLSAP-SEL and the SLSAP-SEL bytes from the IrLMP connect command frame that was received. These are values used by the two devices when communicating at the IrLMP level and, whenever called later by another service, other LSAP-SELs are assigned and stored as the ones corresponding to the particular service.

Next, the value of Nr is incremented by 1 and the value of Ns is placed in the following byte. The F bit is set because the connection parameters specify one window frame. This means that each device is allowed to transmit only one frame on each turn. The next two bytes are occupied by DLSAP-SEL and SLSAP-SEL, respectively, and then the opcode for a connect confirm 081h is placed on the next byte. The following byte is reserved and must be set to 0. The next field is the LMP-User Data field which is used by the user layer. The total number of bytes in the frame is loaded into the transmit counter variable, the buffer containing the assembled byte is passed to the transmission pointer, and the routine responsible for sending the frame is called. After this, the program waits for the next incoming frame from the primary peer.