Public Version
UART/IrDA/CIR Basic Programming Model
www.ti.com
19.5 UART/IrDA/CIR Basic Programming Model
19.5.1 UART Programming Model
19.5.1.1 Quick start
This section outlines the procedure for operating the UART module with FIFO and DMA or interrupts. This
3-part procedure ensures the quick start of the UART module. It does not cover every UART module
feature.
The first programming model covers software reset of the module. The second programming model deals
with FIFO and DMA configuration. The last programming model deals with 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.5.1.1.1 Software Reset
To clear the UART registers, perform the following steps:
1. Initiate a software reset:
Set the UARTi.
[1] SOFTRESET bit to 1.
2. Wait for the end of the reset operation:
Poll the UARTi.
[0] RESETDONE bit until it equals 1.
19.5.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.
register:
(a) Save the current UARTi.
value.
(b) Set UARTi.
to 0x00BF.
2. Enable register submode TCR_TLR to access UARTi.
(part 1 of 2):
(a) Save the UARTi.
[4] ENHANCED_EN value.
(b) Set the UARTi.
[4] ENHANCED_EN bit to 1.
3. Switch to register configuration mode A to access the UARTi.
register:
Set UARTi.
to 0x0080.
4. Enable register submode TCR_TLR to access UARTi.
(part 2 of 2):
(a) Save the UARTi.
[6] TCR_TLR value.
(b) Set the UARTi.
[6] TCR_TLR bit to 1.
5. Enable 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:
•
[7:6] RX_FIFO_TRIG
•
[5:4] TX_FIFO_TRIG
•
[3] DMA_MODE
•
[0] FIFO_ENABLE (0: Disable the FIFO/1: Enable the FIFO)
NOTE:
The UARTi.
register is not readable.
2920
UART/IrDA/CIR
SWPU177N – December 2009 – Revised November 2010
Copyright © 2009–2010, Texas Instruments Incorporated