UART/IrDA/CIR Basic Programming Model
5. Clear the UARTi.UART_IER register (set the UARTi.UART_IER[4] SLEEP_MODE bit to 0 to change
the UARTi.UART_DLL and UARTi.UART_DLH registers). Set the UARTi.UART_IER register value to
0x0000.
6. Switch to register configuration mode B to access the UARTi.UART_DLL and UARTi.UART_DLH
registers:
Set the UARTi.UART_LCR register value to 0x00BF.
7. Load the new divisor value:
Set the UARTi.UART_DLL[7:0] CLOCK_LSB and UARTi.UART_DLH[5:0] CLOCK_MSB bit fields to
the desired values.
8. Switch to register operational mode to access the UARTi.UART_IER register:
Set the UARTi.UART_LCR register value to 0x0000.
9. Load the new interrupt configuration (0: Disable the interrupt; 1: Enable the interrupt):
Set the following bits to the desired values:
•
UARTi.UART_IER[7] CTS_IT
•
UARTi.UART_IER[6] RTS_IT
•
UARTi.UART_IER[5] XOFF_IT
•
UARTi.UART_IER[4] SLEEP_MODE
•
UARTi.UART_IER[3] MODEM_STS_IT
•
UARTi.UART_IER[2] LINE_STS_IT
•
UARTi.UART_IER[1] THR_IT
•
UARTi.UART_IER[0] RHR_IT
10. Switch to register configuration mode B to access the UARTi.UART_EFR register:
Set the UARTi.UART_LCR register value to 0x00BF.
11. Restore the UARTi.UART_EFR[4] ENHANCED_EN value saved in Step 3a.
12. Load the new protocol formatting (parity, stop-bit, character length) and switch to register operational
mode:
Set the UARTi.UART_LCR[7] DIV_EN bit to 0.
Set the UARTi.UART_LCR[6] BREAK_EN bit to 0.
Set the following bits to the desired values:
•
UARTi.UART_LCR[5] PARITY_TYPE_2
•
UARTi.UART_LCR[4] PARITY_TYPE_1
•
UARTi.UART_LCR[3] PARITY_EN
•
UARTi.UART_LCR[2] NB_STOP
•
UARTi.UART_LCR[1:0] CHAR_LENGTH
13. Load the new UART mode:
Set the UARTi.UART_MDR1[2:0] MODE_SELECT bit field to the desired value.
See
, Choosing the Appropriate Divisor Value, to choose the following values:
•
UARTi.UART_DLL[7:0] CLOCK_LSB
•
UARTi.UART_DLH[5:0] CLOCK_MSB
•
UARTi.UART_MDR1[2:0] MODE_SELECT
See
, Frame Formatting, to choose the following values:
•
UARTi.UART_LCR[5] PARITY_TYPE_2
•
UARTi.UART_LCR[4] PARITY_TYPE_1
•
UARTi.UART_LCR[3] PARITY_EN
•
UARTi.UART_LCR[2] NB_STOP
•
UARTi.UART_LCR[1:0] CHAR_LENGTH
3498
Universal Asynchronous Receiver/Transmitter (UART)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated