UART Communication Introduction, Working, Frame Format, Applications (2023)

UART Communication stands for Universal asynchronous receiver-transmitter. It is a dedicated hardware device that performs asynchronous serial communication. It provides features for the configuration of data format and transmission speeds at different baud rates. A driver circuit handles electric signaling levels between two circuits. A Universal asynchronous receiver-transmitter (UART) Communication is usually an individual component or part of an integrated circuit. We can use it for communications over a computer or its peripheral devices such as a mouse, monitor or printer. In microcontroller chips, there are usually a number of dedicated UART hardware peripherals available.

UART communication Introduction

Universal Asynchronous Receive Transmit (UART) or Serial communication is one of the most simple communication protocols between two devices. It transfers data between devices by connecting two wires between the devices, one is the transmission line while the other is the receiving line. The data transfers bit by bit digitally in form of bits from one device to another. The main advantage of this communication protocol is that its not necessary for both the devices to have the same operating frequency. For example, two microcontrollers operating at different clock frequencies can communicate with each other easily via serial communication. However, a predefined bit rate that is referred to as baud rate usually set in the flash memory of both microcontrollers for the instruction to be understood by both the devices.

Transmitting and receiving serial data

The transmitting UART takes bytes of data and transmits the bits in a sequential form. The second transmitter which is the receiver reassembles the bits into a complete byte. Serial transmission of data through a single wire is actually more cost-effective than parallel transmission through multiple wires.

UART Communication Introduction, Working, Frame Format, Applications (1)

Communication between two UART devices may be simplex, full-duplex or half-duplex. Simplex communication is a one-direction type of communication where the signal moves from one UART to another. It doesn’t have provision for the receiving UART to send back signals. A full-duplex is when both devices can transmit and receive communications at the same time. A half-duplex is when devices take turns to transmit and receive.

Structure of a UART Protocol

  • A UART contains a clock generator. This allows the sampling in a bit period.
  • It also contains input and output shift registers.
  • Transmitting and receiving control.
  • A read or write control logic.
  • Other optional components of a UART are: transmit or receive buffers, FIFO buffer memory, and a DMA controller.

UART technology

There was a time not so long ago when keyboards, mice, and printers had thick cables and clunky connectors. These had to be literally screwed into the computer. These devices where using UART to communicate with computers. Although these clunky cables have been replaced with USB, you can still find UARTs being used in DIY electronics such as Raspberry Pi, Arduino, and other common microcontrollers. We can use it to connect Bluetooth modules and GPS modules.

UART has a different transfer protocol than other communication protocols such asSPIandI2C. It is a physical circuit fount in a microcontroller. It can also function as a stand-alone integrated circuit. One significant advantage of UART is that it only relies on two wires to transmit data.

How two Device Communicate through UART

(Video) Basics of UART Communication | UART Frame Structure | RS 232 Basics | Part1

It takes two UART’s to communicate directly with each other. On one end the transmitting UART converts parallel data from a CPU into serial form then transmits the data in serial form to the second UART which will receive the serial data and convert it back into parallel data. This data can then be accessed from the receiving device.

Instead of cloak signals the transmitting and receiving bit use start and stop bit signals for the data packages. These start and stop bits define the beginning and the end of the data packages. Therefore the receiving UART knows when to start and stop reading the bits.

The Receiving UART will detect the start bit then start reading the bits. The specific frequency used to read the incoming bits is known as the baud rate. The baud rate is a measure used for the speed of data transfer. The unit used for baud rate is bits per second (bps). In order for the data transfer to be a success both the transmitting and receiving UART must operate at almost the same baud rate. However, if the baud rates differ between both UARTs they must only differ by 10%. The receiving and transmitting UART must be configured to receive the same data packages.

How UART communication works

Now let us discuss the transmission of data through UART in a step by step manner.

  • Firstly, the data bus sends the data to the transmitting UART. The transmitting UART receives data from a data bus. A data bus is used to send data from another device such as a microcontroller, memory or CPU.
UART Communication Introduction, Working, Frame Format, Applications (4)
  • When the transmitting UART receives the data it processes the data by adding a start bit and a stop bit. This, in turn, creates a data package.
UART Communication Introduction, Working, Frame Format, Applications (5)
  • The next step is the transmission of the data from the transmitting UART to the receiving UART. The whole data packet including the data packet, start and stop bits is sent to the receiving UART serially. The data line is sampled at the pre-configured baud rate by the receiving UART.

Bit by bit the data packet is serially output at the Tx pin. UART will then read the data packet bit by bit through its Rx pin

(Video) Understanding UART

UART Communication Introduction, Working, Frame Format, Applications (6)
  • At the receiving side, the receiving UART gets rid of the start bit, parity bit, and stop bit from the data frame. This is to convert the data back to its original form.
UART Communication Introduction, Working, Frame Format, Applications (7)
  • Receiver will finally transfer the data packet in parallel to the data bus

Explanation of Timing Diagram

This is how UART transmitted data is organized: It is organized into packets that have one start bit, 5 to 9 data bits. A parity bit is optional, and 2 stop bits.

  • Start Bit:When not transmitting data the UART data transmission line is usually high voltage. In order to start the transfer process the transmitting UART switches from high voltage to low voltage for one clock cycle. The receiving UART will detect the high to low voltage transition and start reading the bits at the accurate baud rate.
  • Parity:Parity is the oddness or evenness of a number. The parity bit functions to tell the receiving UART if the data has changed during transmission. Bits can change due to electromagnetism, different baud rates or long-distance transmission of data. The UART reads the data frame after receiving the data. It then counts the number of bits and checks if they are even or odd. If the parity bit is a 0 then it is even parity. If the bit is a 1 then it is an odd parity. For the UART to know that the transmission is free of errors the parity bit has to match the data.
  • Stop bits:For at least two-bit duration the transmitting UART drives the transmission line from a low to a high voltage.

Baud Rate

The communication between two devices via UART Protocol occurs by transmission of bits. A total of 8 bits are sent one right after the other to transmit a byte. A bit is either a logical low or high. The time interval between two bits is called the baud rate or bit rate. it must be defined in both devices so the sending device can encode the data into bits with this specific time interval and the receiver expects the successive bits at the right time. The most commonly used baud rates is 9600 bits per second. Although other baud rates are also used, but the higher the bit rate, the more chances there are of data corruption. Lower bit rates are used when there is greater physical distance between two devices because the length of the wire increases resistance and thus deteriorates the signal.

Timing Diagram of UART

The data in Serial communication is sent by transmitting data packets. Each data packet consists of starting bit, data byte (8 bits), a parity bit (sometimes optional) and a stop bit.

  • Start bit is sent before sending the data byte to inform the receiver device to start logging the data. This bit is active low, meaning that the bit goes low when it has to notify the receiver.
  • After the starting bit, data byte is sent. 8 consecutive bits are transmitted and their time is dependent on the baud rate.

Timing diagram Working

  • After the data byte, parity bit is sent. This bit is optional and is used to check for data corruption during transmission. When the data byte is being transmitted, number of high bits are counted from the total 8 bits of the data byte. Now two types of parity checks can be implemented, Odd or Even.
  • If, for example the number of high bits were 3 in the data byte which is an odd number, the parity bit in case of odd parity will be set to 1 and it will be set to zero in case of even parity check. This parity bit is encoded by the transmitter device into the data packet.
  • Now when the receiver receives the data packet, it also counts the number of high bits in the data byte and compares it with the parity bit. If the parity bit confirms the data, it is further processed and if the parity bit and number of high bits in the data byte don’t match, the data is discarded as it is corrupt and error counter is incremented. If this error counter exceeds a certain value, it is advised to reduce the baud rate which will increase the data quality at cost of reduced speed.
  • After Parity bit, stop bit is issued which is used to notify receiver about end of data packet. We can also choose to send 2 stop bits to the receiver to slower the communication speed and give it enough time in between receiving consecutive data packets to decrease the error rate.

Errors in UART

  • Overrun error:When the receiving UART cannot process the incoming characters before the next characters, this is known as an overrun error. Devices have a different amount of space to hold incoming characters. The CPU or controller must service the UART quickly so that the buffer does not become full. If the buffer becomes full an Overrun error will happen, this will lead to the loss of incoming characters.
  • Underrun error:When the UART transmitter has finished sending a character and the transmit buffer is empty then an underrun error has occurred. This is due to the fact that in asynchronous modes this is treated as a sign that no data remains transmitted. This error is common in USARTs. This is due to the serious levels of underrun errors in synchronous systems.
  • Framing error:When there is no stop bit at the expected interval A UART will detect an error. The start bit is used to identify the beginning of an incoming data packet. If the data packet does not arrive at the expected state at the expected time the UART will signal a framing error. If the data line experiences a break condition it will also be signaled as a framing error.
  • Parity error:A parity error happens when the parity of the number of one-bits does not match the one specified by the parity bit. Since the use of parity bits is optional, this error will occur if you enable the parity-checking.


Let’s summarize the steps of UART communication:

  • Step1: The receiving UART receives data from the data bus in parallel.
  • Step 2: The transmitting UART adds the start, parity and stop bit to the data packet.
  • Step 3: The entire packet is sent from the transmitting UART to the receiving UART serially. Using the configured baud rate the receiving UART samples the data packet.
  • Step 4: The receiving UART converts the data back to its original form and then transfers it to the data bus where it can be used or visualized.

UART Communication modules

A UART that combines two UARTs into a single chip is known as a dual UART or DUART. A quadruple UART combines four UARTs in a single chip. If a UART combines eight UARTs into one chip it is called an OCTART or octal UART. The most common OCTART is the ExarXR16L788.

(Video) UART frame formats | UART Essentials | MICROCONTROLLER | LECTURE 157

Applications of UART

  • Transmitting and receiving UARTs must be set to the same bit, parity and stop bits in order for them to function properly.
  • Serial ports used in personal computers and embedded systems use UARTs. These devices use the CPU to sample the state of data transmissions. However, the UART chip can be omitted to save money and space in the devices.
  • UARTs were more commonly used a while back in personal computers and their peripherals, such as a mouse and keyboard. However, they have been replaced with USB in recent times.

Pros of UART

Although there are no perfect communication protocols that are perfect, UARTs are good at transmitting and receiving data.

  • UARTs are simple and they only rely on two wires.
  • They possess a parity bit in order to check for errors in data packets.
  • If both sides are set up for structural data change it can happen.
  • UART is a widely used method.

Disadvantages of UART

  • The data frame is limited to 9 bits.
  • The baud rates of the receiving and transmitting UAT must be within ten percent.

UART Serial Programming in Arduino

Arduino has the capability to communicate with other devices via UART Protocol. This can be used when connecting one Arduino to another or when connecting an Arduino to a UART compatible module like HC-05 Bluetooth module. To achieve serial communication, follow the following steps:

  • Connect Tx pin of one Arduino to Rx pin and Rx pin to Tx pin of the other Arduino.
  • Connect the grounds of both Arduinos together

UART Transmitter Code for Arduino

As discussed above, when we have to transmit data via serial port, we encode it into data packets. Thankfully, there is a built in Arduino library that does it for us. Lets make an example code that will send a simple “Hello World” to the receiver.

  • Initialize the Serial port by calling the function Serial.begin() at a baud rate of 9600bps.. This is done in the setup function because we want to initialize the Serial port only once at the start of the code.
  • Transmit the string “Hello World” by calling the function Serial.println() and passing the string “Hello World” to that function.

The basic code looks like this

void setup(){Serial.begin(9600); //Initialize the serial port}void loop(){ Serial.println("Hello World"); //transmit the string to receiver Arduino delay(100); //Wait for 10 milli sec before transmitting it again because we are in the loop() function}

UART Receiver Code for Arduino

To receive the string transmitted by the transmitter Arduino, we

  • Initialize the Serial port by calling the function Serial.begin() at a baud rate of 9600bps. This is done in the setup function because we want to initialize the Serial port only once at the start of the code.
  • In the loop() function, we first check whether the transmitter sent any data or not by calling the Serial.available() function. If the data is received by the receiver Arduino, the Serial.available function will output a TRUE and after that we can decode the data packet by using Serial.Read() function.
  • Display the decoded data on serial monitor by using Serial.print() function.

The code goes like this

void setup(){ Serial.begin(9600);}void loop(){if (Serial.available()) //If the data is transmitted from the transmitter Arduino, only then the contents of if function will be executed { Serial.print(; //Print the received byte to the serial monitor. }}
(Video) PROTOCOLS: UART - I2C - SPI - Serial communications #001

The serial monitor will display

Software Serial UART for Arduino

Arduino has dedicated Tx and Rx pins and it can communicate to only one device at a time via these pins. But what if we want to communicate to multiple devices via Serial Protocol. Well, we can do that by creating a software serial in which any of the digital pins of Arduino can transmit and receive data via Serial protocol.

Software UART Library

To achieve this, the following steps are taken

  • Include the software serial library by using the command #include <SoftwareSerial.h>
  • Initialize the pins that want to use for Software Serial communication and create object of the class SoftwareSerial. The object can be named whatever you want and is used to differentiate the software serial and the built-in hardware serial of the Arduino that we discussed before in this article. If, for example, we want the pin 2 to be Receiver line Rx and pin 3 to be Transmission line Tx and, we initialize by calling SoftwareSerial class and initializing object by the name of newserial.
  • Call the newserial.begin(9600) in the setup function to set the baud rate at 9600bps.
  • Transmit a string “Hello World” by calling the function newserial.print(“Hello World”) in the loop function.

The code goes like this

#include <SoftwareSerial.h> //Include Software serial librarySoftwareSerial newserial(2, 3); //Initialize the object newserial and set pin 2 as Rx and 3 as Txvoid setup(){ newserial.begin(9600); //Set baud rate of software serial at 9600bps}void loop(){ newserial.println("Hello World"); //Print the received byte to the serial monitor.}

If we run the same code on receiver Arduino that we ran before, we would get the same output.

Other Serial communication Protocols:

  • I2C
  • SPI
  • CAN

Practical Tutorials and Projects

The following articles contains examples of UART Serial communication use:

(Video) UART Protocol Tutorial

  • MSP430 Serial communication module use with examples
  • Serial communication PIC microcontroller
  • UART Communication with 8051 microcontroller
  • How to receive Arduino data through Serial communication in Labview
  • Bluetooth module interfacing with Arduino via UART
  • Bluetooth module HC 05 interfacing with pic microcontroller
  • Control 2 DC Motors via Serial Bluetooth and Arduino
  • Serial Bluetooth based dc motor speed and direction control using arduino
  • Serial Bluetooth Controlled Robot using pic microcontroller
  • Bluetooth based home automation system using android phone


What are the applications of UART communication? ›

A UART is usually an individual (or part of an) integrated circuit (IC) used for serial communications over a computer or peripheral device serial port. One or more UART peripherals are commonly integrated in microcontroller chips. Specialised UARTs are used for automobiles, smart cards and SIMs.

What is frame format for UART? ›

Frame format for UART. It starts with a start bit, which is always low for a 1-bit duration. Then follows data bits from LSB to MSB, which usually occupies 5 to 9 bits. You can decide how many data bits have to be there in a frame between 5 to 9 bits using configuration registers in the UART peripheral.

What is UART communication introduction? ›

By definition, UART is a hardware communication protocol that uses asynchronous serial communication with configurable speed. Asynchronous means there is no clock signal to synchronize the output bits from the transmitting device going to the receiving end.

What is the working of 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.

What are examples of UART devices? ›

Today, UART is being used in many applications like GPS Receivers, Bluetooth Modules, GSM and GPRS Modems, Wireless Communication Systems, RFID based applications etc. If you remember older computer systems, devices like Mouse, Printer and Modem are connected using a heavy connectors at the back.

Which is most commonly used UART? ›

Which is the most commonly used UART? Explanation: The Intel 8253, 8254 and 8259 are timers whereas Intel 8250 is a UART which is commonly used.

What is frame format? ›

Ethernet frame format is a continuous pattern of alternative occurring 0's and 1's which indicates when the frame is starting and creates synchronization among the sender and receiver. Ethernet frame exist in data link layer of the OSI model (which has 7 layers in it) and is a PDU (aka protocol data unit).

What is frame and its format? ›

A frame can be defined as the digital data transmission unit in telecommunication and computer networking. A frame is a straight-forward network packet in the packet-switched systems. A frame is a repeating structure that supports time-division multiplexing in other types of telecommunication systems.

What is frame format in networking? ›

A frame is a digital data transmission unit in computer networking and telecommunication. In packet switched systems, a frame is a simple container for a single network packet. In other telecommunications systems, a frame is a repeating structure supporting time-division multiplexing.

What are the benefits of UART? ›

UART supports bi-directional, asynchronous and serial data transmission. It has two data lines, one to transmit (TX) and another to receive (RX), which are used to communicate through digital pin 0, digital pin 1. UART can also handle synchronization management issues between computers and external serial devices.

How to send data using UART? ›

Select the UART port on the board to which the block sends data. The Tx port on the block sends the values to the UART port using the Tx pin on the port. To specify the Tx pin for the UART Serial Interface, go to Configuration Parameters > Hardware Implementation pane > UARTx > Tx Pin.

Does USB use UART? ›

UART to USB in Computers

UART devices were created to be compatible with this communication. USB, however, has almost completely replaced these outdated cables and connectors that operate using UART communication.

What type of communication is UART? ›

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.

What is UART programming? ›

A UART (Universal Asynchronous Receiver/Transmitter) is the microchip with programming that controls a computer's interface to its attached serial devices.

What is the main feature of UART? ›

It's not a communication protocol like SPI and I2C, but a physical circuit in a microcontroller, or a stand-alone IC. A UART's main purpose is to transmit and receive serial data. One of the best things about UART is that it only uses two wires to transmit data between devices.

What are the real time applications of UART protocol? ›

Applications of UART Communication
  1. Achieving communication amongst distant computers around 900 meters.
  2. Transferring data through PC serial port.
  3. Baud rate generation for numerous applications that helps to determine the speed of data transmission.
  4. Microcontroller to implement wireless data communication.
Dec 14, 2019

What is the key feature of UART? ›

Capabilities and Characteristics. As you probably know, a basic UART system provides robust, moderate-speed, full-duplex communication with only three signals: Tx (transmitted serial data), Rx (received serial data), and ground.

How many devices can be connected to UART? ›

The UART protocol typically allows for only two devices to be connected to each other. There is no easy way of connecting multiple UART devices to a single interface.

Is UART digital or analog? ›

Universal asynchronous receiver-transmitter (UART) is one of the simplest and oldest forms of device-to-device digital communication. You can find UART devices as a part of integrated circuits (ICs) or as individual components.

Is UART input or output? ›

The term UART stands for Universal Asynchronous Receiver/Transmitter. UARTs are commonly used to interface with devices that have no graphical display capabilities. The UART can provide input/output to a terminal program that allows the user to monitor status and provide input.

What are 3 types of frames? ›

Types of Picture Frames
  • 1) Standard Frame. Let's begin with the obvious —the standard frame. ...
  • 2) Gallery Frames. These are a bit more specialized than standard picture frames, but they're still very common. ...
  • 3) Floating Frames. ...
  • 4) Deep-Set Frames. ...
  • 5) Decorative Frames. ...
  • 6) Collage Frames. ...
  • 7) Poster Frames. ...
  • 8) Document Frames.

What are examples of a frame structure? ›

A frame structure is a very sturdy structure, often quite tall, which is typically made up of beams, columns and slabs. Natural frame structures include coral, trees, spider webs and skeletons. Man-made frame structures include scaffolding, chairs, tables, bridges and bicycles.

What is a frame and why it is used explain with example? ›

HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection of frames in the browser window is known as a frameset. The window is divided into frames in a similar way the tables are organized: into rows and columns.

What is the difference between a frame and a frame? ›

Conclusion. In brief, the frame and frameset are two elements available in HTML. The main difference between frame and frameset in HTML is that the frame holds a separate document, while the frameset holds one or more frames.

What are the two types of frames in computer networks? ›

Framing can be of two types, fixed sized framing and variable sized framing. Here the size of the frame is fixed and so the frame length acts as delimiter of the frame. Consequently, it does not require additional boundary bits to identify the start and end of the frame. Example − ATM cells.

Why do we need frames in networking? ›

In networking, a frame is a unit of data. A frame works to help identify data packets used in networking and telecommunications structures. Frames also help to determine how data receivers interpret a stream of data from a source.

Can you explain frame format of Ethernet? ›

In computer networking, an Ethernet frame is a data link layer protocol data unit and uses the underlying Ethernet physical layer transport mechanisms. In other words, a data unit on an Ethernet link transports an Ethernet frame as its payload.

What is Usart and its application? ›

A USART (universal synchronous/asynchronous receiver/transmitter) is hardware that enables a device to communicate using serial protocols. It can function in a slower asynchronous mode, like a universal asynchronous receiver/transmitter (UART), or in a faster synchronous mode with a clock signal.

How many types of UART are there? ›

There are two basic types of UARTs: dumb UARTS and FIFO UARTS.

What is difference between USART and UART? ›

The only difference between them is that the UART peripheral supports only asynchronous mode, whereas USART supports both synchronous and asynchronous modes. All modern microcontrollers come with a USART module instead of just a UART module.

What is meant by UART? ›

(Universal Asynchronous Receiver Transmitter) The electronic circuit that makes up the serial port. Also known as "universal serial asynchronous receiver transmitter" (USART), it converts parallel bytes from the CPU into serial bits for transmission, and vice versa.

How many devices can be connected to UART simultaneously? ›

Normally, only one device will be connected to the UART; however, there is the potential for one device could provide input only, and a different device could use the output.

What are the different modes of UART communication? ›

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

How to collect data from UART? ›

To receive data from UART you will have to utilize a UART receive interrupt that will trigger every time a data packet is received in the UART receive registers (U1RXREG). This data is transferred to another variable and the receive buffer is cleared if full.


1. UART Structure and Data Frame| Embedded Systems
(Easy Electronics)
2. UART(Universal Asynchronous Receiver Transmitter) working,Advantages & Disadvantages
(Omkar Kulkarni)
3. 77 - UART - Introduction
(Anas Salah Eddin)
4. Understanding UART Communication Programming | UART Peripherals | Part 2
(Foolish Engineer)
5. CAN Frame structure Understanding | CAN communication Explained
(Foolish Engineer)
6. CAN Protocol Frame Format | CAN Protocol Basics
(TechVedas .learn)
Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated: 10/07/2023

Views: 6163

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.