Professional Documents
Culture Documents
UART
UART
Receiver/Transmitter
UART
What is UART
• The transmitting UART converts parallel data from a controlling device like a
CPU into serial form, transmits it in serial to the receiving UART, which then
converts the serial data back into parallel data for the receiving device.
• Only two wires are needed to transmit data between two UARTs. Data flows
from the Tx pin of the transmitting UART to the Rx pin of the receiving UART
• UARTs transmit data asynchronously, which means there is no clock signal to
synchronize the output of bits from the transmitting UART to the sampling of bits
by the receiving UART.
• Instead of a clock signal, the transmitting UART adds start and stop bits to the
data packet being transferred.
• These bits define the beginning and end of the data packet so the receiving UART
knows when to start reading the bits.
• When the receiving UART detects a start bit, it starts to read the incoming bits at a
specific frequency known as the baud rate.
• Baud rate is a measure of the speed of data transfer, expressed in bits per second
(bps).
• The transmitting UART adds the start bit, parity bit, and the stop bit(s) to the data frame
• The entire packet is sent serially from the transmitting UART to the receiving UART. The
receiving UART samples the data line at the pre-configured baud rate
• The receiving UART discards the start bit, parity bit, and stop bit from the data frame
• The receiving UART converts the serial data back into parallel and transfers it to the data
UART MODULES
1. UART transmitter
2. UART receiver
of a single byte
• Each block represents a bit that can be a mark (logic ‘1’, high) or space
(logic ‘0’, low)
UART Character Transmission
• Each bit has a fixed time duration determined by the transmission rate
• Example: a 1200 bps (bits per second) UART will have a 1/1200 s or about
833.3 µs bit width
UART Character Transmission
• When detected, the receiver synchronizes with the new data stream
UART Character Transmission
• The parity bit is added to make the number of 1’s even (even parity) or odd (odd
parity).
• This bit can be used by the receiver to check for transmission errors
UART Character Transmission
• The stop bit marks the end of transmission
• Separates one word from the start bit of the next word
UART Transmission Example
• Send the ASCII letter ‘W’ (1010111)
UART RECEPTION
• During the UART reception the serial data and receiving clock are asynchronous.
So it is very important to correctly determine the start bit of a frame data.
• When the receiving UART detects the high to low voltage transition, it begins
reading the bits in the data frame at the frequency of the baud rate.
• Receiver look for a stop bit after complete data transmission. If stop bit does not
appear when it is supposed to be UART will report framing error to the host.
BAUD RATE GENERATOR
• Baud rate generator is actually a frequency divider, this is calculated according to
a given system clock frequency.
• The purpose of this baud rate generator is to precisely sample the asynchronous
serial data at the receiver.
• Assume that the system clock is 32 MHz, baud rate is 9600bps, and then the
output clock frequency of baud rate generator should be 16*9600Hz.
THANK YOU