Circuit Fever Author - Rohit
Rohit
Posted on 12 Feb 2024

UART Serial Communication Protocol

UART (Universal Asynchronous Receiver Transmitter) is a serial communication protocol used to transfer data from the sender device to the receiver device. It is mostly used in microcontroller, programming the microcontroller, transferring data form one microcontroller to another etc. Some sensors also uses UART protocol for sending the data to the host device.

If you have some experience with microcontroller, you must have seen TX-RX pin in almost all the microcontroller. You can use these pins for communicating with the device.

Why UART Protocol?

  • It is a simple serial communication protocol which can transfer data bits from one device to another device.
  • It supports full-duplex communication mode (sending and receiving data can be done simultaneously).
  • Only two wires are required, one for transmitting the data, and other is for receiving the data.

UART pin Connection

UART Protocol

In UART protocol, the message is sent or received in blocks which is also called frame. The frame has additional bits with the message for the sucessful communication. The basic UART protocol has a start bit, a stop bit and data bits. The data bits may contains 5-bit,6-bit,7-bit or 8-bit as shown below.

UART Connection

If the sender wants to send the data, it first sends the start bit, then data bit and then stop bit. If the start bit is logic 0, idle state of the wire will be logic 1. If there is no communication, the transmitter wire will be in logic 1 state. In this case receiver knows that there is no data is coming. Since it is the asynchronous communication, receiver checks if state is changed or not. If the sender sends the message, the transmitter should change the state from 1 to 0. In this case, the receiver knows the data is coming and it starts the sampling of the data. This is how asynchronous communication is done.

Some Issues With UART

UART protocol are sime and easy to implement. But there are some issues.

  • Dedicated wires are required for each device. We can't use one TX or RX pin for communication between multiple devices.
  • It doesn't provide high-speed data transmission.
  • Synchronization in case of transferring large chunk of data can be challenging
  • By default, it provides simple error detection and no error correction mechanism.
👈 Like If You Found This Useful
0 Likes