UART/IrDA/CIR Basic Programming Model
19.4 UART/IrDA/CIR Basic Programming Model
19.4.1 UART Programming Model
19.4.1.1 Quick Start
This section describes the procedure for operating the UART with FIFO and DMA or interrupts. This three-
part procedure ensures the quick start of the UART. It does not cover every UART feature.
The first programming model covers software reset of the UART. The second programming model
describes FIFO and DMA configuration. The last programming model describes protocol, baud rate, and
interrupt configuration.
NOTE:
Each programming model can be used independently of the other two; for instance,
reconfiguring the FIFOs and DMA settings only.
Each programming model can be executed starting from any UART register access mode
(register modes, submodes, and other register dependencies). However, if the UART register
access mode is known before executing the programming model, some steps that enable or
restore register access are optional. For more information, see
, Register
Access Modes.
19.4.1.1.1 Software Reset
To clear the UART registers, perform the following steps:
1. Initiate a software reset:
Set the UARTi.UART_SYSC[1] SOFTRESET bit to 1.
2. Wait for the end of the reset operation:
Poll the UARTi.UART_SYSS[0] RESETDONE bit until it equals 1.
19.4.1.1.2 FIFOs and DMA Settings
To enable and configure the receive and transmit FIFOs and program the DMA mode, perform the
following steps:
1. Switch to register configuration mode B to access the UARTi.UART_EFR register:
(a) Save the current UARTi.UART_LCR register value.
(b) Set the UARTi.UART_LCR register value to 0x00BF.
2. Enable register submode TCR_TLR to access the UARTi.UART_TLR register (part 1 of 2):
(a) Save the UARTi.UART_EFR[4] ENHANCED_EN value.
(b) Set the UARTi.UART_EFR[4] ENHANCED_EN bit to 1.
3. Switch to register configuration mode A to access the UARTi.UART_MCR register:
Set the UARTi.UART_LCR register value to 0x0080.
4. Enable register submode TCR_TLR to access the UARTi.UART_TLR register (part 2 of 2):
(a) Save the UARTi.UART_MCR[6] TCR_TLR value.
(b) Set the UARTi.UART_MCR[6] TCR_TLR bit to 1.
5. Enable the FIFO; load the new FIFO triggers (part 1 of 3) and the new DMA mode (part 1 of 2):
Set the following bits to the desired values:
•
UARTi.UART_FCR[7:6] RX_FIFO_TRIG
•
UARTi.UART_FCR[5:4] TX_FIFO_TRIG
•
UARTi.UART_FCR[3] DMA_MODE
•
UARTi.UART_FCR[0] FIFO_ENABLE (0: Disable the FIFO; 1: Enable the FIFO)
3496
Universal Asynchronous Receiver/Transmitter (UART)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated