UART/IrDA/CIR Basic Programming Model
19.4.2.2 MIR Mode
19.4.2.2.1 Receive
The following programming model explains how to program the module to receive an IrDA frame with no
parity, baud rate = 1.152 Mpbs, and FIFOs disabled.
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. Load the new baud rate (1.152 Mpbs):
UARTi.UART_DLL = 0x01
UARTi.UART_DLH = 0x00
4. Set MIR mode:
UARTi.UART_MDR1[2:0] MODE_SELECT = 0x4
5. Disable access to the UART_DLL and UART_DLH registers and switch to register operational mode:
UARTi.UART_LCR = 0x00
6. Force DTR output to active (UART_MCR[0] DTR = 1):
Force RTS output to active (UART_MCR[1] RTS = 1).
UARTi.UART_MCR = 0x3
7. Optional: Enable the RHR interrupt:
UARTi.UART_IER[0] RHR_IT = 1
19.4.2.2.2 Transmit
The following programming model explains how to program the module to transmit an IrDA 60-byte frame
with no parity, baud rate = 1.152 Mpbs, and FIFOs disabled:
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. Load the new baud rate (1.152 Mpbs):
UARTi.UART_DLL = 0x01
UARTi.UART_DLH = 0x00
4. Set MIR mode:
UARTi.UART_MDR1[2:0] MODE_SELECT = 0x4
5. Disable access to the UART_DLL and UART_DLH registers and switch to register operational mode:
UARTi.UART_LCR = 0x00
6. Force DTR output to active:
UARTi.UART_MCR[0] DTR = 1
7. Optional: Enable the THR interrupt:
UARTi.UART_IER[1] THR_IT = 1
8. Set the frame length to 60 bytes:
UARTi.UART_TXFLL = 0x3C
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.
3503
SPRUH73H – October 2011 – Revised April 2013
Universal Asynchronous Receiver/Transmitter (UART)
Copyright © 2011–2013, Texas Instruments Incorporated