what is uart

11 months ago 22
Nature

A UART (Universal Asynchronous Receiver-Transmitter) is a computer hardware device for asynchronous serial communication in which the data format and transmission speeds are configurable. It is a simple, two-wire protocol for exchanging serial data between two devices. UARTs are usually integrated in microcontroller chips, and specialised UARTs are used for automobiles, smart cards, and SIMs.

A UARTs main purpose is to transmit and receive serial data. It transmits 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. Instead of a clock signal, the transmitting UART adds start and stop bits to the data packet being transferred. These bits define the beginning and end of the data packet so the receiving UART knows when to start reading the bits.

A UART contains the following components:

  • A clock generator, usually a multiple of the bit rate to allow sampling in the middle of a bit period
  • Input and output shift registers, along with the transmit/receive or FIFO buffers
  • Transmit/receive control
  • Read/write control logic

UARTs transmit and receive data in frames. Data is transferred from the data bus to the transmitting UART in parallel form. After the transmitting UART gets the parallel data from the data bus, it adds a start bit, a parity bit, and a stop bit, creating the data packet. Next, the data packet is output serially, bit by bit at the Tx pin.