Datasheet

PIC18F97J94 FAMILY
DS30575A-page 432 2012 Microchip Technology Inc.
21.5.2 BUILT-IN IrDA ENCODER AND
DECODER
The built-in IrDA encoder and decoder functionality is
enabled using the IREN bit in the BAUDCONx register
while the module is in Asynchronous mode
(SYNC = 0). When enabled (IREN = 1), the Receive
pin (RXx) acts as the input from the infrared receiver.
The Transmit pin (TXx) acts as the output to the infra-
red transmitter. The 16x clock must be available for
this feature to work properly.
The IrDA feature cannot be enabled for Synchronous
modes (SYNC = 1).
21.5.2.1 IrDA Encoder Function
The encoder works by taking the serial data from the
USART and replacing it as follows:
Transmit bit data of ‘1’ gets encoded as ‘0 for the
entire 16 periods of the 16x Baud Clock
Transmit bit data of ‘0’ gets encoded as ‘0 for the
first 7 periods of the 16x Baud Clock, then as ‘1
for the next 3 periods, and as ‘0’ for the remaining
6 periods
See Figure 21-15 and Figure 21-17 for details.
21.5.2.2 IrDA Transmit Polarity
The IrDA transmit polarity is selected using the
TXCKP bit. This bit only affects the transmit encoder
and does not affect the receiver.
When TXCKP = 0, the Idle state of the TXx line is ‘0
(see Figure 21-15). When TXCKP = 1, the Idle state of
the TXx line is ‘1 (see Figure 21-16).
FIGURE 21-15: IrDA
®
ENCODING SCHEME
FIGURE 21-16: INVERTED IrDA
®
ENCODING (TXCKP = 1)
FIGURE 21-17: 0’ BIT DATA IrDA
®
ENCODING SCHEME
TXx Data
TXx (tx_out)
TXx Data
TXx (tx_out)
Start ofStart of
0’ Transmit bit
16x Baud Clock
TXx Data
TXx (tx_out)
8th Period 11th Period