Texas Instruments CC2650DK 사용자 설명서

다운로드
페이지 1570
1
0
5-8 data bits
LSB
MSB
1-2
Stop bits
UnTX
n
Start
enabled
Parity bit
if
Functional Description
19.4.1 Transmit and Receive Logic
The transmit logic performs parallel-to-serial conversion on the data read from the TX FIFO. The control
logic outputs the serial bit stream, beginning with a start bit and followed by the data bits (LSB first), parity
bit, and the stop bits according to the programmed configuration in the control registers. See
for details.
The receive logic performs serial-to-parallel conversion on the received bit stream after a valid start pulse
is detected. Overrun, parity, frame error checking, and line-break detection are also performed, and their
status accompanies the data written to the RX FIFO.
Figure 19-2. UART Character Frame
19.4.2 Baud-Rate Generation
The baud-rate divisor (BRD) is a 22-bit number consisting of a 16-bit integer and a 6-bit fractional part.
The number formed by these two values is used by the baud-rate generator to determine the bit period.
Having a fractional baud-rate divider allows the UART to generate all standard baud rates.
The 16-bit integer is loaded through the UART Integer Baud-Rate Divisor [UART_IBRD] register, and the
6-bit fractional part is loaded with the UART Fractional Baud-Rate Divisor [UART_FBRD] register. The
BRD has the following relationship to the system clock (where BRDI is the integer part of the BRD, and
BRDF is the fractional part, separated by a decimal place).
BRD = BRDI + BRDF = PERDMACLK / (ClkDiv × Baud Rate)
(1)
where PERDMACLK is the system clock connected to the UART, and ClkDiv is 16.
The 6-bit fractional number that will be loaded into the DIVFRAC bit field in the [UART_FBRD] register can
be calculated by taking the fractional part of the baud-rate divisor, multiplying it by 64, and adding 0.5 to
account for rounding errors:
UART_FBRD.DIVFRAC = integer(BRDF × 64 + 0.5)
(2)
Along with the UART Line Control, High Byte [UART_LCRH] register, the [UART_IBRD] and
[UART_FBRD] registers form an internal 30-bit register. This internal register is updated only when a write
operation to the [UART_LCRH] register is performed, so a write to the [UART_LCRH] register must follow
any changes to the BRD for the changes to take effect.
To update the baud-rate registers, there are four possible sequences:
[UART_IBRD] write, [UART_FBRD] write, and [UART_LCRH] write
[UART_FBRD] write, [UART_IBRD] write, and [UART_LCRH] write
[UART_IBRD] write and [UART_LCRH] write
[UART_FBRD] write and [UART_LCRH] write
19.4.3 Data Transmission
Data received or transmitted is stored in two FIFOs, though the RX FIFO has an extra 4 bits per character
for status information. For transmission, data is written into the TX FIFO. If the UART is enabled, a data
frame will start transmitting with the parameters indicated in the [UART_LCRH] register. Data continues to
transmit until no data is left in the TX FIFO. The BUSY bit in the UART Flag [UART_FR] register is
asserted as soon as data is written to the TX FIFO (that is, if the FIFO is not empty), and remains
asserted while data is transmitting. The BUSY bit is negated only when the TX FIFO is empty, and the last
character has transmitted from the shift register, including the stop bits. The UART can indicate that it is
busy even though the UART may no longer be enabled.
When the receiver is idle (the UARTRXD signal is continuously 1), and the data input goes low (a start bit
was received), the receive counter begins running and data is sampled.
1330
Universal Asynchronous Receivers and Transmitters (UARTS)
SWCU117A – February 2015 – Revised March 2015
Copyright © 2015, Texas Instruments Incorporated