Introduction
A UART (Universal Asynchronous Receiver/Transmitter) is a hardware device designed for asynchronous communication. This is not a communication protocol like SPI or I2C but a physical circuit. In this case, you can configure the data format and transmission speed. It is one of the most used device-to-device communication protocols.
UART can be configured to work with many different types of serial protocols that involve sending and receiving serial data. Serial communication uses only one line or wire to transfer data bit by bit. Serial data transfer over two wires is possible in two-way communication. Serial communications may require less circuitry and wires depending on the application and system requirements, which reduces the implementation cost.
UART is mainly used by embedded systems, microcontrollers, and computers as a device-to-device hardware communication protocol. In contrast to the other communication protocols, UART uses only two wires for transmission and reception.
Functions of the UART:
- For outbound communications, it transforms parallel data into serial data.
- For inbound communications, it transforms serial data into parallel data.
- The parity bit is added to outgoing transmissions, and the parity bit is checked for inbound transmissions.
- Manages to interrupt requests and device management, involving synchronizing the operating speed of the computer and the device.
UART Connections
A serial format is used to transmit data. There are only two pins/terminals/ports, one for receiving and another for transmission. Receiving pins are denoted by Rx, while transmitting pins are denoted by Tx.
The figure below illustrates how two UART devices communicate directly with each other. A Tx from the first device is connected to an Rx from the second device, and vice versa.
UART Connections
Data is sent parallel to the transmitting UART by a controlling data bus. Data will now be transmitted serially, bit by bit, over the transmission line (wire) to the UART that will receive it. In turn, this will convert the serial data into parallel for the receiving device.
Asynchronous means there are no clock signals; instead, it employs start and stop bits to signal the beginning and ending of each data packet. By reading these bits, a receiving UART device knows when to begin reading data packets and when to stop reading them.
Maintaining the baud rate is crucial. A Baud rate is simply the number of bits transferred in a second, expressed in bits per second. All UARTs must have baud rates within 10% of each other.
Also see, Difference Between Verilog and Vhdl