UART

Table of Contents

UART chip is included in ATMEGA328 microcontroller used in Arduino, which facilities to implement serial communication.

A UART (universal asynchronous receiver transmitter) is a chip (block of circuitry, hardware part) responsible for implementing serial communication.

UART

As UART is Asynchronous communication protocol, it follows same rules any Asynchronous protocol follows.

Actually, It acts as an intermediary between parallel and serial interfaces. On one end of the UART there is a bus of eight-or-so data lines (additionally some control pins), on the other side two serial wires – RX and TX.

UART

You can get UARTs ICs individually from the market, but they are commonly found inside the microcontrollers.

If you want to know availability of UART chip in your Microcontroller, go through the datasheet of the microcontroller.
Then you came to know that some microcontrollers have none, some have one or some have many.

For example — Microcontroller namely ATmega328p-pu used in Arduino Uno has just a single UART, while ATmega2560 microcontroller used in Arduino Mega has four built-in UARTs.

UARTs are responsible for both sending and receiving serial data:

  1. On the transmit side, a UART must create the data packet (appending sync and parity bits) and send that packet out the TX line with precise timing (according to the set baud rate).
  2. On the receive end, the UART has to sample the RX line at rates according to the expected baud rate, pick out the sync bits, and spit out the data.

So it is clear with the diagram, UART is used in microcontrollers for converting data available in parallel to Serial and vice versa for Transmitting and Receiving respectively.

More advanced UARTs IC throw their received data into buffer, where data can stay until the microcontroller comes (connected) to get it. UARTs will usually release their buffered data on this principle first-in-first-out (FIFO) basis.

Buffers size can be as small as a few bits to store data, or as large as to store thousands of bytes.

*Buffers are physical memory allocation/storage used for temporarily store data while being moving or processing

SOFTWARE UARTS

If a microcontroller doesn’t have a UART the serial interface can be directly control or bit-banged by the microcontroller or microprocessor. In simple words, use serial interface through program instead of real time circuit present on IC.

This approach is also used by Arduino in its library “SoftwareSerial

Bit-banging is processor intensive and not usually as precise as a UART sometimes adds garbage values, but it works fine in most common cases.

*Bit-banged – It is slang for numerous techniques used for data transmission where software are used instead of hardware for generating and processing signals.

We will see in later section how to create UART using software in Arduino.

Total Visits: 222
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Translate »
0
Would love your thoughts, please comment.x
()
x