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 Access Protocol (IrLAP) Layer

The link access protocol (IrLAP) layer is responsible for reliable data transfer at a low level; upper layers can then rely on the services provided by this layer. The data is delivered and if delivery is not possible, then the upper layer is aware of this fact and acts accordingly. The IrLAP layer provides a point-to-point half-duplex connection with no data collision control mechanism. It is possible to simulate a full-duplex connection when the timing requirements are not critical.

The devices connected to the IrLAP layer are known as the primary and secondary devices which correspond to a master-slave relationship, respectively. The responsibilities of each device vary depending on the role it performs. Although many times a primary station can take on the role of a secondary, the opposite is not true when a secondary-only implementation is followed.

The primary station is responsible for:

  • Sending command frames (commencing connections and transfers)
  • Control and organization of data
  • Manipulating data link errors

The secondary station:

  • Sends response frames only

The IrLAP layer is built around two modes of operations: normal disconnect mode (NDM) and normal response mode (NRM). NDM is used when a connection does not yet exist. When the devices identify the IR media to be free, then the discovery process can begin with the default parameters for negotiating a connection. NRM is used when a connection exists and then upper layers proceed to exchange information. Figure 17 shows the basic IrLAP frame format.

irlap-frame-format.gifFigure 17. IrLAP Frame Format

The address and control fields only take 1 byte each; thus, adding little overhead to user data. Three different framings exist that are applied to the data before it is sent. Proper framing depends solely on the speed at which the data is sent. The scope of this report is up to 115.2 kbps; therefore, asynchronous framings schemes are followed.

The operations performed by this layer are defined in its service primitives; these can be understood as IrLAP API definitions. Figure 18 shows an example of how these service primitives work. Not all the primitives defined are required to have an IrDA implementation. The primitives defined by the IrDA Lite protocol as required are:

  • Discovery and address conflict services
  • Connect services
  • Data services
  • Disconnect services
irlap-service-primitives.gifFigure 18. IrLAP Service Primitives