Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USART IrDA Example
Purpose

This example demonstrates the IrDA (Infrared Data Association) on SAM.

Requirements

This example can be used on all SAM EK boards with external IrDA transceiver component. Connect the board and external component with the following paired pins.

  • SAM4S-EK – IrDA transceiver
    • 3V3 – VCC
    • TXD(PA22) – TXD
    • RXD(PA21) – RXD
    • CTS(PA25) – SD
    • GND – GND

      Description

      The provided program uses the USART in IrDA mode for transmitting and receiving several octets. This example can be used with two SAM-EK boards. The program receives or transmits a series of octets according to its state of either receiver or transmitter.

      Note
      To receive IrDA signals, the following needs to be done:
      • Disable TX and Enable RX.
      • Configure the TXD pin as PIO and set it as an output at 0 (to avoid LED emission). Disable the internal pull-up (better for power consumption).
      • Receive data.
      Usage
      1. Build the program and download it into the two evaluation boards.
      2. Connect a serial cable to the UART port for each evaluation kit.
      3. On the computer, open and configure a terminal application (e.g., HyperTerminal on Microsoft Windows) with these settings:
        • 115200 bauds
        • 8 data bits
        • No parity
        • 1 stop bit
        • No flow control
      4. Start the application.
      5. The following traces shall appear on the terminal:
        -- USART IrDA Example --
        -- xxxxxx-xx
        -- Compiled: xxx xx xxxx xx:xx:xx --
        -I- Press t to transmit, press r to receive...
      6. Enable one board as transmitter and another as receiver to start the communication. If succeed, the side of receiver would output the received data.