Universal Asynchronous Receiver Transmitter (UART) Protocol - GeeksforGeeks (2024)

Last Updated : 29 Dec, 2022

Improve

UART means Universal Asynchronous Receiver Transmitter Protocol. UART is used for serial communication from the name itself we can understand the functions of UART, where U stands for Universal which means this protocol can be applied to any transmitter and receiver, and A is for Asynchronous which means one cannot use clock signal for communication of data and R and T refers to Receiver and Transmitter hence UART refers to a protocol in which serial data communication will happen without clock signal.

UART is established for serial communication. In this article, we will discuss how parallel communication is established with respect to serial communication using UART as well as how to configure UART and what is the data format in UART. Later on, we will discuss the Pros and Cons of the UART.

UART Basics

UART is a Universal Asynchronous Receiver Transmitter protocol that is used for serial communication. Two wires are established here in which only one wire is used for transmission whereas the second wire is used for reception. Data format and transmission speeds can be configured here. So, before starting with the communication define the data format and transmission speed. Data format and transmission speed for communication will be defined here and we do not have a clock over here that’s why it is referred to as asynchronous communication with UART protocol. Here we will see how this protocol is designed physically.

Universal Asynchronous Receiver Transmitter (UART) Protocol - GeeksforGeeks (1)

UART

Here, DEVICE A that is having transmitter PIN and a receiver pin; DEVICE B is having a receiver and transmission pin. The Transmitter of DEVICE A is one that should be connected with the receiver pin of DEVICE B and the transmitter pin of DEVICE B should be connected with the receiver pin of DEVICE A we just need to connect two wires for communication.

If DEVICE A wants to send data, then it will be sending data on the transmitter’s pin and here receiver of this DEVICE B will receive it over and if DEVICE A wants to receive the data, then that is possible on the RX line that will be forwarded by TX of DEVICE B. On comparing this serial communication of UART with parallel then it can be observed that in parallel multiple buses are required. Based on the number of lines bus complexity of UART is better but parallel communication is good in terms of speed.

So, when speed is required at that time we should select parallel communication and for a low-speed application, UART must be used and the bus complexity will be less.

The configuration of UART is done before transmission, both of these devices are connected with protocol and should know the speed of data transmission. First, define the speed of both devices. Now, configure the speed of DEVICE A and B for data transmission which is referred to as Baud Rate so here Baud Rate will be the same for DEVICE A and B otherwise both of these devices cannot understand at what speed and at what rate data is coming. After that, configure the data length so here DEVICE A and DEVICE B both are configured at fixed data length if DEVICE A is transmitting data, then it is configured with fixed data. Like if DEVICE A is configured with the eight-bit size of data then DEVICE B should also be configured at the same size of data which is eight bits. After this, check data transmission or receiving time, forward start bits, and stop bits.

Now we will see the data format and when the communication is according to UART protocol. We are using NRZ encoding for data communication.

UART Data Format

Universal Asynchronous Receiver Transmitter (UART) Protocol - GeeksforGeeks (2)

UART Data Format

Suppose DEVICE A is sending data to DEVICE B, and the transmitter of DEVICE A will send data to the receiver of Device B then it will be logic high. Now, send the start bit that will be logic 0 and once we have the start bit, DEVICE B will know that somebody is communicating. Now there is the same speed configuration with both devices. So, after the start bit, DEVICE A can forward data.

Consider 8 bits of data length, so we will be forwarding 8 bits and those 8 bits will be received by DEVICE B a parity bit can also be used which is optional, but this is quite effective. By using the parity bit, it can be identified whether the received data is correct or not. Suppose we are sending 1 1 1 0 0 0 1 0. Now, we have 4 ones; an even number of ones are there hence the parity is even and for that, logic 0 will be assigned. Suppose we are receiving data with some error, say zero is converted into one; Now incorrect data that is 1 1 1 1 0 0 1 0 for this incorrect data parity will be 0 as there are 5 ones, here is a mismatch in the parity bit and hence it is confirmed that the received data has some error.

Pros of UART Protocol

  • It is having less physical interfacing based on only two lines.
  • Simple to configure data and data size. Speed is also configurable. In the majority of cases, this baud rate is 9600 for the UART protocol. Full duplex mode configuration is possible by using two wires so that is the major advantage of UART.
  • Error detention is possible

Cons of UART Protocol

  • UART is having serial communication, therefore, it has less speed.
  • Start bit, stop bit, and the parity bit is other overhead.
  • Since this is asynchronous communication so here there are many things that we need to do in configuration, for instance, we should configure both devices at the same speed because the clock signal is absent.


C

codearcade

Improve

Next Article

Asynchronous serial data transfer

Please Login to comment...

Universal Asynchronous Receiver Transmitter (UART) Protocol - GeeksforGeeks (2024)

FAQs

Universal Asynchronous Receiver Transmitter (UART) Protocol - GeeksforGeeks? ›

UART is used for serial communication from the name itself we can understand the functions of UART, where U stands for Universal which means this protocol can be applied to any transmitter and receiver, and A is for Asynchronous which means one cannot use clock signal for communication of data and R and T refers to ...

What is the universal asynchronous receiver transmitter protocol? ›

UART stands for universal asynchronous receiver / transmitter and defines a protocol, or set of rules, for exchanging serial data between two devices. UART is very simple and only uses two wires between transmitter and receiver to transmit and receive in both directions. Both ends also have a ground connection.

How does the UART protocol work? ›

At its core, UART enables the serial transmission of data, where bits are sent one after the other without a shared clock signal between the sender and the receiver. This asynchronous nature is fundamental to its flexibility, as devices with varying clock speeds can still communicate effectively.

How to communicate with UART? ›

The transmitting UART is connected to a controlling data bus that sends data in a parallel form. From this, the data will now be transmitted on the transmission line (wire) serially, bit by bit, to the receiving UART. This, in turn, will convert the serial data into parallel for the receiving device.

What is the difference between synchronous and asynchronous UART? ›

synchronous implies that there is a clock involved, whereas asynchronous there is not. For uart based comms (RS232), it is asynchronous. SPI,and I2c are examples of synchronous comms.

What is the purpose of asynchronous transmission? ›

Asynchronous transmission, sometimes referred to as start/stop transmission, involves sending data to the receiver using the flow control method. Data is synchronized between the sender and the receiver without the use of a clock. Data is transmitted one character or 8 bits at a time.

Why is UART universal? ›

UART is used for serial communication from the name itself we can understand the functions of UART, where U stands for Universal which means this protocol can be applied to any transmitter and receiver, and A is for Asynchronous which means one cannot use clock signal for communication of data and R and T refers to ...

Why is UART still used? ›

However, UART is still used for lower-speed and lower-throughput applications, because it is very simple, low-cost and easy to implement.

How do I receive data from UART? ›

Let's start with the simplest method i.e using the POLL method. The data is Received in blocking mode i.e the CPU will block every other operation until the data Reception is complete. This method is good to use if you are only using UART and nothing else, otherwise all other operations will be affected.

What are the benefits of UART communication? ›

Advantages of UART
  • It is bidirectional.
  • It is a full-duplex.
  • There is no clock signal because it is asynchronous.
  • Error checking using parity bit.
  • Data format and transmission speeds are configurable.
  • As long as both sides are set up for it, the structure of the data packet can be changed.
Mar 27, 2024

How far can UART transmit? ›

UART uses 2 wires: 1 for transmit (or Tx) and one for receive (or Rx) UART communication is asynchronous, meaning that it is not synchronized using a clock. UART has a max communication distance of 15 meters.

How many wires are required for UART communication? ›

One of the best things about UART is that it only uses two wires to transmit data between devices. The principles behind UART are easy to understand, but if you haven't read part one of this series, Basics of the SPI Communication Protocol, that might be a good place to start.

How does UART work without a clock? ›

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.

What are the different modes of UART protocol? ›

UARTs are able to communicate in several different modes: full duplex, half duplex (the two devices communicate with each other one at a time) or simplex (the data communication is one way only).

Is UART full duplex or half duplex? ›

The UART provides asynchronous communications commonly referred to as RS-232 or RS-485. The UART component can be configured for Full Duplex, Half Duplex, RX only or TX only versions.

What is the difference between SPI and UART? ›

Unlike SPI, UART is a physical circuit and relies on two UART devices to send and receive data. It doesn't use a shared clock, so baud rates must be closely matched to avoid data loss. Both UART and SPI do not support multi-host configurations, but SPI offers significantly higher data transfer speeds compared to UART.

What is the protocol for asynchronous communication? ›

In asynchronous serial communication in the physical protocol layer, the data blocks are code words of a certain word length, for example octets (bytes) or ASCII characters, delimited by start bits and stop bits. A variable length space can be inserted between the code words. No bit synchronization signal is required.

What is the universal messaging socket protocol? ›

The Universal Messaging Socket Protocol (NSP) is a plain TCP socket protocol optimized for high throughput, low latency and minimal overhead.

What is asynchronous serial communication protocol? ›

Asynchronous serial communication is a communication interface in which the signals used are not synchronized to each other using a common clock signal. Instead, start and stop bits are used to indicate the beginning and end of a data message.

Which is considered an asynchronous protocol? ›

Asynchronous communication means interaction without real-time conversation — replies can be delayed. A good example is email. In this approach, people aren't scheduling meetings and responses are less time-sensitive.

References

Top Articles
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 6242

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.