UART/IrDA/CIR Basic Programming Model
19.4.2.3 FIR Mode
19.4.2.3.1 Receive
The following programming model explains how to program the module to receive the IrDA frame with no
parity, baud rate = 4 Mbps, FIFOs enabled, 8-bit word length.
1. Disable the UART before accessing the UARTi.UART_DLL and UARTi.UART_DLH registers:
Set the UARTi.UART_MDR1[2:0] MODE_SELECT bit field to 0x7.
2. Grant access to the UART_DLL and UART_DLH registers (UART_LCR[7] DIV_EN bit = 1):
UARTi.UART_LCR = 0x80 (Data format is unaffected by the use and settings of the
UARTi.UART_LCR register in IrDA mode.)
3. FIFO clear and enable:
UARTi.UART_FCR = 0x7 (TX/RX FIFO trigger: UART_FCR[7:6] and UART_FCR[5:4])
UARTi.UART_LCR[7] = 0
4. Set FIR mode:
UARTi.UART_MDR1[2:0] MODE_SELECT = 0x5
5. Set frame length:
UARTi.UART_RXFLL = 0xA (Data + CRC + STOP)
6. Disable access to the UARTi.UART_DLL registers and UARTi.UART_DLH and switch to register
operational mode:
UARTi.UART_LCR[7] DIV_EN = 0x0
7. Optional: Enable the RHR interrupt:
UARTi.UART_IER[0] RHR_IT = 1
19.4.2.3.2 Transmit
The following programming model explains how to program the module to transmit an IrDA 4-byte frame
with no parity, baud rate = 4 Mbps, FIFOs enabled, and 8-bit word length.
1. Disable the UART before accessing the UARTi.UART_DLL and UARTi.UART_DLH registers:
Set the UARTi.UART_MDR1[2:0] MODE_SELECT bit field to 0x7.
2. Grant access to EFR_REG:
UARTi.UART_LCR = 0xBF
3. Enable the enhanced features (EFR_REG[4] ENAHNCED_EN = 0x1):
UARTi.UART_EFR = 0x10
4. FIFO clear and enable:
UARTi.UART_FCR = 0x7 (TX/RX FIFO trigger: UART_FCR[7:6] and UART_FCR[5:4]).
UARTi.UART_LCR[7] = 0
5. Set FIR mode and enable auto-SIP mode:
UARTi.UART_MDR1 = 0x45
6. Set frame length:
UARTi.UART_TXFLL = 0x4
UARTi.UART_TXFLH = 0x0
UARTi.UART_RXFLL = 0xA (Data + CRC + STOP)
UARTi.UART_RXFLH = 0x0
7. Force DTR output to active:
UARTi.UART_MCR[0] DTR = 0x1
8. Optional: Enable the THR interrupt:
UARTi.UART_IER[1] THR_IT = 0x1
9. Optional: Transmit eight additional starts of frame (MIR mode requires two starts):
UARTi.UART_EBLR = 0x08
10. SIP is sent at the end of transmission:
UARTi.UART_ACREG[3] = 1
11. Load the UART_THR register with the data to be transmitted.
3504
Universal Asynchronous Receiver/Transmitter (UART)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated