SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
Asynchronous timing mode is the only mode supported in UCD3138. In the asynchronous timing mode, each bit in a frame has a duration of 8 UART baud clock periods. Each bit therefore consists of 8 samples (one for each clock period).
When the UART is using asynchronous mode, the baud rates of all communicating devices must match as closely as possible. Receive errors result from devices communicating at different baud rates.
With the receiver in the asynchronous timing mode, the UART detects a valid start bit if the first four samples after a falling edge on the SCI_RX pin are of logic level 0. As soon as a falling edge is detected on SCI_RX, the UART assumes that a frame is being received and synchronizes itself to the bus.
The UART module has been designed to provide some protection from noise causing unintended start bits or incorrect data. Without protection, a noise spike that brings an idle receive line low may be interpreted as a start bit.
The UART prevents this by requiring a start bit to bring the SCI_RX line low for at least four contiguous UART baud clock periods. If any of the receive samples during the first four UART baud clock periods is not a logic low, then the UART does not consider this a start bit and considers the receive line idle.
When another falling edge is detected, the UART checks for a valid, noise-free start bit. When a valid start bit is detected, the UART determines the value of each bit by sampling the SCI_RX line value during the fourth, fifth, and sixth UART baud clock periods. A majority vote of these samples is used to determine the value stored in the UART receiver shift register.
By sampling in the middle of the bit, the UART reduces errors caused by propagation delays and rise and fall times. By taking a majority vote, the UART reduces the likelihood of data corruption caused by data line noise. Figure 12-2 illustrates how the receiver samples a start bit and a data bit in asynchronous timing mode.
Baud rate setting example:
Example: For baud rate of 38400 bps, Baud rate register setting = (15.625 MHz / ( 8 * 38400)) - 1 = 50
Desired Baud Rate | UARTHBAUD | UARTMBAUD | UARTLBAUD |
---|---|---|---|
110 | 0 | 69 | 91 |
300 | 0 | 25 | 109 |
1200 | 0 | 6 | 91 |
2400 | 0 | 3 | 45 |
4800 | 0 | 1 | 150 |
9600 | 0 | 0 | 202 |
19200 | 0 | 0 | 101 |
38400 | 0 | 0 | 50 |
57600 | 0 | 0 | 33 |
115200 | 0 | 0 | 16 |
230400 | 0 | 0 | 7 |
460800 | 0 | 0 | 3 |
921600 | 0 | 0 | 1 |