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

Frame Exchange Log

This section shows the frames exchanged in a connection between the IrCOMM2k driver for the PC and the MSP430 IrDA stack. This is only meant to be an example, and it shows communication with no errors. When a frame is similar to the previous frame, only the different fields are commented on. All the numbers are in hexadecimal format, unless noted otherwise.

NOTE

IrCOMM2k is a driver for Windows that makes possible to use the IrCOMM services in the Windows IrDA stack. It also enables the user to be able to use the Linux-IrDA stack ported to Windows, if so desired (see IrCOMM2k, Virtual Infrared COM Port for Windows 2000/XP).

(001 from IrCOMM2k) XID command: FF 3F 01 29 23 BE 84 FF FF FF FF 01 00

Address Field: FF, where the last bit is the C/R bit. When set, the C/R bit indicates a command frame. The previous seven bits, equal to 7F are the broadcast address.

Control Field: 3F, 001x1111b indicates an unnumbered type frame. 2F is the opcode for exchange station identification. Bit 4 is the Poll/Final bit, which, when set by the primary, indicates the frame is the final frame.

Format Identifier: 01 is a set value as defined in the IrLAP documentation.

Source Device Address: 2923BE84 is the address of the device sending the frame. Destination Device Address: FFFFFFFF is the broadcast address during discovery. Discovery Flags: 01. The last two bits indicate the amount of slots to be used during the

discovery, in this case six. Bit 2 is the conflict bit which is not set in this case. Slot Number: 00, marks the first discovery slot.

Version Number: 00, as specified in the IrLAP documentation.

(002 from MSP430) XID response: FE BF 01 AB CD 12 34 29 23 BE 84 01 00 00 82 04 00 20 4D 53 50 34 33 30 20

Destination Device Address: 2329BE84 is the address of the device for which the frame is intended.

Service Hint Bits: 8204. These bits are set according to the IrLMP documentation and in this case they are set to support PDA/Palmtop and IrCOMM.

Character Set: 00 indicates ASCII is used.

Device Nickname: 204D535034333220 reads MSP430 and is the name that stores this device information in the peer device IAS database.

(003 from IrCOMM2k) XID command: FF 3F 01 29 23 BE 84 FF FF FF FF 01 01

(004 from IrCOMM2k) XID command: FF 3F 01 29 23 BE 84 FF FF FF FF 01 02

(005 from IrCOMM2k) XID command: FF 3F 01 29 23 BE 84 FF FF FF FF 01 03

(006 from IrCOMM2k) XID command: FF 3F 01 29 23 BE 84 FF FF FF FF 01 04

(007 from IrCOMM2k) XID command: FF 3F 01 29 23 BE 84 FF FF FF FF 01 FF 00 84 04 00 4C 54 41 30 38 36 36 32 36 35

Slot Number: FF marks the final discovery slot in the discovery sequence.

Service Hint Bits: 8404. This device supports PCs, PDA/Palmtops, and IrCOMM.

(008 from IrCOMM2k) SNRM command: FF 93 29 23 BE 84 AB CD 12 34 70 01 01 3E 82 01 01 83 01 3F 84 01 7F 85 01 80 86 01 1F 08 01 07

Control Field: 93, 100x0011b = Unnumbered: Set Normal Response Mode (83) with the final bit set

Connection Address: 38 this corresponds to the middle six bits of 70.

Negotiation Parameters:

  • Baud Rate: (01, 01, 3E) 9600, 19200, 38400, 57600, and 115200 bps supported
  • Maximum Turnaround Time: (82, 01, 01) 500 ms
  • Data Size: (83, 01, 3F) 64, 128, 256, 512, 1024, and 2048 bytes
  • Window Size: (84, 01, 7F) 1, 2, 3, 4, 5, 6, and 7 frame windows
  • Additional BOFs: (85, 01, 80) 0 additional BOFs at 115200 bps
  • Minimum Turnaround Time: (86, 01, 1F) 10, 5, 1, 0.5, and 0.1 ms
  • Link Disconnect/Threshold Time: (08, 01, 07) 3/0, 8/3, and 12/3 seconds

(009 from MSP430) UA Response: 70 73 AB CD 12 34 23 29 BE 84 01 01 02 82 01 01 83 01 01 84 01 01 85 01 01 86 01 01 08 01 01

Address Field: 70. Bit 0 is the C/R bit indicating a response, and the upper 7 bits use from now on the 'Connection Address' received in the SNRM frame number 38.

Control Field: 73, 011x0011b = Unnumbered: Unnumbered Acknowledgement (63) with the poll bit set.

(010 from IrCOMM2k) RR command: 71 11

Address Field: 71 with the C/R bit set and the CA (connection address) set to 38.

Control Field: 11 where bits 0-3 indicate a supervisory frame with a receive ready opcode, bit 4 is the P/F bit, and bits 5-7 indicate the received frame count (Nr).

(011 from MSP430) RR response: 70 11

(012 from IrCOMM2k) IrLMP Connect Command: 71 10 80 5A 01 00

Control Field: 10 where bit 0 indicates an information type frame, bits 1-3 indicate the sent frame count (Ns), bit 4 is the P/F bit, and bits 5-7 indicate the received frame count.

Destination: 80 where bit 7 is the control bit, and bits 0-6 are the DLSAP.

Source: 5A where bit 7 is reserved, and bits 0-6 are the SLSAP.

Opcode: 01 this corresponds to the connect command.

Reserved: 00 for future use.

(013 from MSP430) IrLMP Connect Confirm: 70 30 DA 00 81 00

Opcode: 81 corresponds to the connect confirm.

(014 from IrCOMM2k) IAS query: 71 32 00 5A 84 0B 49 72 44 41 3A 49 72 43 4F 4D 4D 0A 50 61 72 61 6D 65 74 65 72 73

IAP Control Field: 84 where bit 7 corresponds to the last frame bit, bit 6 is the acknowledge bit, and bits 0-5 are the opcode to the GetValueByClass IAS query.

Class Name: 0B497244413A4972434F4D4D where the first byte represents the length of the class name, and the rest is the ASCII hex for the class name: "IrDA:IrCOMM"

Attribute Name: 0A506172616D6574657273 where the first byte represents the length of the attribute, name and the rest is the ASCII hex for the attribute name: "Parameters".

(015 from MSP430) IAS result: 70 52 5A 00 84 00 00 01 00 01 02 00 03 00 01 07

IAP Control Field: 84 where bit 7 corresponds to the last frame bit, bit 6 is the acknowledge bit, and bits 0-5 are the opcode to the GetValueByClass IAS response.

Return: 00, success

List Length: 01

Object Identifier: 0001

Type: 02 for octet sequence

Sequence Length: 03

Sequence: 000107, where the first byte means service type, second byte is the length of result, and the last byte has bits set for: 3-wire raw, 3-wire, or 9-wire service.

(016 from IrCOMM2k) IrLMP Disconnect: 71 54 80 5A 02 01

IrLMP opcode: 02

Reason: 01 meaning user request.

(017 from MSP430) RR response: 70 71

(018 from IrCOMM2k) IrLMP Connect Command: 71 56 80 5B 01 00

(019 from MSP430) IrLMP Connect Confirm: 70 94 DB 00 81 00

(020 from IrCOMM2k) IAS query: 71 78 00 5B 84 0B 49 72 44 41 3A 49 72 43 4F 4D 4D 13 49 72 44 41 3A 54 69 6E 79 54 50 3A 4C 73 61 70 53 65 6C

IAP Control Field: 84 where bit 7 corresponds to the last frame bit, bit 6 is the acknowledge bit, and bits 0-5 are the opcode to the GetValueByClass IAS query.

Class Name: 0B497244413A4972434F4D4D where the first byte represents the length of the class name, and the rest is the ASCII hex for the class name: "IrDA:IrCOMM".

Attribute Name: 13497244413A54696E7954503A4C73617053656C where the first byte represents the length of the attribute name, and the rest is the ASCII hex for the attribute name: "IrDA:TinyTP:LsapSel".

(021 from MSP430) IAS result: 70 B6 5B 00 84 00 00 01 00 01 01 00 00 00 02

Type: 01 indicating an integer result.

Value: 000002 indicating the LSAP to use for TTP.

(022 from IrCOMM2k) IrLMP Disconnect: 71 9A 80 5B 02 01

(023 from MSP430) RR response: 70 D1

(024 from IrCOMM2k) IrLMP/TTP Connect Command: 71 9C 82 55 01 00 10

TTP Connect Frame: 10 where bit 7 is the P bit indicating a parameter-less connection frame, and where the remaining 7 bits indicate the Initial Credit given to the peer entity.

(025 from MSP430) IrLMP/TTP Connect Confirm: 70 F8 D5 02 81 00 01

(026 from IrCOMM2k) RR command: 71 B1

(027 from MSP430) RR response: 70 F1

(028 from IrCOMM2k) IrCOMM Parameter Set: 71 BE 02 55 00 12 00 01 04 10 04 00 00 25 80 11 01 03 12 01 0C 20 01 0C

IrCOMM header: 00

Length of Parameters: 12

Service Type: (00, 01 04) Service selected, equal to highest service in common, 9-wire

Data Rate: (10, 04, 00002580) 9600 bps

Data Format: (11, 01, 03) 8 bits, 1 stop bit, no parity

Flow Control: (12, 01, 0C) RTS/CTS on input and output

DTE Line Settings and Changes: (20, 01, 0C) DTR and RTS state

(029 from MSP430) IrCOMM Parameter Accept and TTP credit: 70 1A 55 02 02

TTP Credit: 02, where bit 7 is the M (more) bit, and the remaining six bits indicate the delta credit

(030 from IrCOMM2k) RR command: 71 D1

(031 from MSP430) RR response: 70 11

NOTE

The RR command and response and exchange continue (frames 32-37) until a device starts sending.

(038 from IrCOMM2k) IrLMP PDU/IrCOMM: 71 D0 02 55 00 00 74

IrCOMM data header: 0000

User Data: 74, the hex value for the ASCII character t

(039 from MSP430) IrLMP PDU/IrCOMM: 70 3C 55 02 00 00 38 37 46 20

IrCOMM data header: 0000

User Data: 38374620, the hex sequence for the ASCII string 87F

(040 from IrCOMM2k) RR command: 71 F1

(041 from MSP430) TTP advancing credit: 70 3E 55 02 02

TTP Credit: 02, where bit 7 is the M (more) bit, and the remaining six bits indicate the delta credit.

The exchange of RR command/response frames, IrCOMM user data and TTP credit continues until one of the peers requests disconnection after finishing the data transfer.