29.4.3.3 IrDA Modulation and Demodulation

Transmission and reception can be encoded IrDA compliant up to 115.2 kb/s. IrDA modulation and demodulation work in the following configuration:

  • IrDA encoding enabled (CTRLB.ENC = 1)
  • Asynchronous mode (CTRLA.CMODE = 0)
  • 16x sample rate (CTRLA.SAMPR[0] = 0)

During transmission, each low bit is transmitted as a high pulse. The pulse width is 3/16 of the baud rate period, as illustrated in the figure below.

Figure 29-10. IrDA Transmit Encoding

The reception decoder has two main functions.

The first is to synchronize the incoming data to the IrDA baud rate counter. Synchronization is performed at the start of each zero pulse.

The second main function is to decode incoming Rx data. If a pulse width meets the minimum length set by the configuration (RXPL.RXPL), it is accepted. When the baud rate counter reaches its middle value (1/2 bit length), the data is transferred to the receiver.

Note: The polarity of the transmitter and receiver are opposite: During transmission, a '0' bit is transmitted as a '1' pulse, while during reception, an accepted '0' pulse is received as a '0' bit.

Example: The figure below illustrates reception with RXPL.RXPL set to 19. This means that the pulse width must be at least 20 SE clock cycles. When using BAUD = 0xE666, or 160 SE cycles per bit, this corresponds to a minimum required pulse width of 2/16 of the baud clock. In this case, the first bit is accepted as a '0', the second bit is a '1', and the third bit is also a '1'. A low pulse is rejected because it does not meet the minimum requirement of 2/16 of the baud clock.

Figure 29-11. IrDA Receive Decoding