UART Protocol
1. Starting part
2. Content part
a. Intro to UART
b. Why UART
c. What is Serial Transmission & parallel transmission
d. UART Block Diagram
e. Data Transmission
f. UART frame format
g. Application of UART
3. Intro to UART
● Stand for Universal Asynchronous Receiver/Transmitter.
● Used for serial communication.
● It is two wire communication protocol:
○ One wire is for transmission.
○ Second wire is for reception.
● Here the clock is not given for synchronisation.
● UART transmission speed is slower compared to parallel communication
but it needs less bus interface for communication.
4. Why UART
● A UART may be used when:
○ High speed is not required
○ An inexpensive communication link between two devices is required.
● UART communication is very cheap
○ Single wire for each direction (plus ground wire)
○ Relatively simple hardware
5. What is Serial Transmission & parallel transmission
Serial Transmission:
In Serial Transmission, data-bit flows from one computer to another computer in
bi-direction. In this transmission, one bit flows at one clock pulse. In Serial
Transmission, 8 bits are transferred at a time having a start and stop bit.
Parallel Transmission:
In Parallel Transmission, many bits are flow together simultaneously from one
computer to another computer. Parallel Transmission is faster than serial
transmission to transmit the bits. Parallel transmission is used for short
distance.
6. UART Block Diagram
The UART block diagram consists of two components namely the transmitter
& receiver that is shown below. The transmitter section includes three blocks
namely transmit hold register, shift register and also control logic. Likewise,
the receiver section includes a receive hold register, shift register, and control
logic. These two sections are commonly provided by a baud-rate-generator.
This generator is used for generating the speed when the transmitter section
& receiver section has to transmit or receive the data.
The hold register in the transmitter comprises the data-byte to be transmitted.
The shift registers in transmitter and receiver move the bits to the right or left
till a byte of data is transmitted or received. A read (or) write control logic is
used for telling when to read or write.
The baud-rate-generator among the transmitter and the receiver generates
the speed that ranges from 110 bps to 230400 bps. Typically, the baud rates
of microcontrollers are 9600 to 115200.
7. Data Transmission
In UART, the mode of transmission is in the form of a packet. The piece that
connects the transmitter and receiver includes the creation of serial packets and
controls those physical hardware lines. A packet consists of a start bit, data
frame, a parity bit, and stop bits.
Start Bit
The UART data transmission line is normally held at a high voltage level when it’s not
transmitting data. To start the transfer of data, the transmitting UART pulls the transmission
line from high to low for one (1) clock cycle. 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.
Data Frame
The data frame contains the actual data being transferred. It can be five (5) bits up to eight (8)
bits long if a parity bit is used. If no parity bit is used, the data frame can be nine (9) bits long.
In most cases, the data is sent with the least significant bit first.
Parity
Parity describes the evenness or oddness of a number. The parity bit is a way for the receiving
UART to tell if any data has changed during transmission. Bits can be changed by
electromagnetic radiation, mismatched baud rates, or long-distance data transfers.
After the receiving UART reads the data frame, it counts the number of bits with a value of 1
and checks if the total is an even or odd number. If the parity bit is a 0 (even parity), the 1 or
logic-high bit in the data frame should total to an even number. If the parity bit is a 1 (odd
parity), the 1 bit or logic highs in the data frame should total to an odd number.
When the parity bit matches the data, the UART knows that the transmission was free of
errors. But if the parity bit is a 0, and the total is odd, or the parity bit is a 1, and the total is
even, the UART knows that bits in the data frame have changed.
Stop Bits
To signal the end of the data packet, the sending UART drives the data transmission line from
a low voltage to a high voltage for one (1) to two (2) bit(s) duration.
8. UART frame format
9. Application of UART
10. SUMMARY