EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Page 179

Texas Instruments CC3235 SimpleLink Series
799 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
www.ti.com
Functional Description
179
SWRU543–January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
Universal Asynchronous Receivers/Transmitters (UARTs)
6.2.3.5 DMA Operation
The UART provides an interface to the µDMA controller with separate channels for transmit and receive.
The DMA operation of the UART is enabled through the UART DMA Control (UARTDMACTL) register.
When DMA operation is enabled, the UART asserts a DMA request on the receive or transmit channel
when the associated FIFO can transfer data. For the receive channel, a single transfer request is asserted
whenever any data are in the RX FIFO. A burst transfer request is asserted whenever the amount of data
in the RX FIFO is at or above the FIFO trigger level configured in the UARTIFLS register. For the transmit
channel, a single transfer request is asserted whenever there is at least one empty location in the TX
FIFO. The burst request is asserted whenever the TX FIFO contains fewer characters than the FIFO
trigger level. The single and burst DMA transfer requests are handled automatically by the µDMA
controller, depending on how the DMA channel is configured.
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.
6.2.4 Initialization and Configuration
To enable and initialize the UART, the following steps are necessary:
1. Enable the UART module using the UART0CLKEN or UART1CLKEN register.
2. Set the GPIO_PAD_CONFIG CONFMODE bits for the appropriate pins.
This section discusses the steps required to use a UART module. For this example, the UART clock is
assumed to be 80 MHz, and the desired UART configuration is:
• 115200 baud rate
• Data length of 8 bits
• One stop bit
• No parity
• FIFOs disabled
• No interrupts
The first thing to consider when programming the UART is the BRD, because the UARTI BRD and UARTF
BRD registers must be written before the UARTLCRH register. Using the equation described in
Section 6.2.2, the BRD can be calculated by Equation 3.
BRD = 80,000,000 / (16 × 115,200) = 43.410590 (3)
which means that the DIVINT field of the UARTIBRD register should be set to 43 decimal or 0x2B. The
value to be loaded into the UARTFBRD register is calculated by Equation 4.
UARTFBRD[DIVFRAC] = integer(0.410590 × 64 + 0.5) = 26 (4)

Table of Contents