Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Universal Asynchronous

Receiver/Transmitter
UART
What is UART

• Universal asynchronous receiver/transmitter

• Protocol for exchanging serial data between two devices

• Uses only two wires - TX to RX (each direction)

• Data is transmitted in the form of frames


UART COMMUNICATION
UART COMMUNICATION

• In UART communication, two UARTs communicate directly with each other.

• 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). 

• Both UARTs must operate at about the same baud rate.


STEPS OF UART TRANSMISSION

• The transmitting UART receives data in parallel from the data bus

• 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

The UART serial communication


module divided in to three sub modules

1. UART transmitter

2. UART receiver

3. Baud rate generator


UART Character Transmission
• Below is a timing diagram for the transmission

of a single byte

• Uses a single wire for transmission

• 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

• In the configuration shown, it takes 10 bits to send 7 bits of data

• The start bit marks the beginning of a new word

• When detected, the receiver synchronizes with the new data stream
UART Character Transmission

• Next follows the data bits (7 or 8)

• The least significant bit is sent first

• 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

• Receiver checks to make sure it is ‘1’

• 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

You might also like