English
Language : 

LM3S1N16 Datasheet, PDF (588/794 Pages) Texas Instruments – Stellaris® LM3S1N16 Microcontroller
Universal Asynchronous Receivers/Transmitters (UARTs)
13.4
To enable DMA operation for the receive channel, set the RXDMAE bit of the DMA Control
(UARTDMACTL) register. To enable DMA operation for the transmit channel, set the TXDMAE bit
of the UARTDMACTL register. The UART can also be configured to stop using DMA for the receive
channel if a receive error occurs. If the DMAERR bit of the UARTDMACR register is set and a receive
error occurs, the DMA receive requests are automatically disabled. This error condition can be
cleared by clearing the appropriate UART error interrupt.
If DMA is enabled, then the μDMA controller triggers an interrupt when a transfer is complete. The
interrupt occurs on the UART interrupt vector. Therefore, if interrupts are used for UART operation
and DMA is enabled, the UART interrupt handler must be designed to handle the μDMA completion
interrupt.
See “Micro Direct Memory Access (μDMA)” on page 327 for more details about programming the
μDMA controller.
Initialization and Configuration
To enable and initialize the UART, the following steps are necessary:
1. The peripheral clock must be enabled by setting the UART0, UART1, or UART2 bits in the RCGC1
register (see page 244).
2. The clock to the appropriate GPIO module must be enabled via the RCGC2 register in the
System Control module (see page 253).
3. Set the GPIO AFSEL bits for the appropriate pins (see page 405). To determine which GPIOs to
configure, see Table 18-4 on page 737.
4. Configure the GPIO current level and/or slew rate as specified for the mode selected (see
page 407 and page 415).
5. Configure the PMCn fields in the GPIOPCTL register to assign the UART signals to the appropriate
pins (see page 422 and Table 18-5 on page 740).
To use the UART, the peripheral clock must be enabled by setting the appropriate bit in the RCGC1
register (page 244). In addition, the clock to the appropriate GPIO module must be enabled via the
RCGC2 register (page 253) in the System Control module. To find out which GPIO port to enable,
refer to Table 18-5 on page 740.
This section discusses the steps that are required to use a UART module. For this example, the
UART clock is assumed to be 20 MHz, and the desired UART configuration is:
■ 115200 baud rate
■ Data length of 8 bits
■ One stop bit
■ No parity
■ FIFOs disabled
■ No interrupts
588
January 21, 2012
Texas Instruments-Production Data