...

What is UART(Universal Asynchronous Receiver And Transmitter) ?

Rose   utmel.com   2021-10-21 17:38:34

Topics covered in this article:
Ⅰ. What is UART?
Ⅱ. What's the function of UART?
Ⅲ. What is UART used for?
Ⅳ. What are the advantages and disadvantages of UART?
Ⅴ. What's the working principle of UART?


Ⅰ. What is UART?

UART stands for Universal Asynchronous Receiver and Transmitter. In most embedded devices, it is a communication interface that is set up by default. This is due to the fact that many embedded devices lack a display panel and hence are unable to get real-time data information. They are connected to the HyperTerminal via the UART serial port to print the embedded device's output information. When it comes to tracing and debugging the embedded system, the UART serial interface is a must-have. The serial port is used to configure network routers, switches, and other devices. Many hardware data outputs use the UART serial port. GPS receivers, for example, use the UART serial port to output GPS data.

 

Ⅱ. What’s the function of UART?

Inside the computer, parallel data is used, and the data cannot be delivered straight to the modem. To achieve asynchronous communication, the UART must sort it. The following is the procedure: the CPU first loads the data to be written to the serial device into the UART's register (temporary memory block). The data is then sent to the serial device through FIFO (First Input First Output). If there is no FIFO, the data will get jumbled and unable to transmit to the modem.

It's a control chip for computers and serial devices. It has an RS-232C data terminal device interface, which allows the computer to communicate with modems and other serial devices that use the RS-232C interface. UART additionally supports the following functions as part of the interface: Convert the parallel data from the computer into a serial data stream for output. Convert serial data from the outside of the computer into bytes for use by the computer's parallel data devices. Perform a parity check on the data stream received from the outside and add a parity bit to the output serial data stream. The start-stop mark should be added to the output data stream, and the start-stop mark should be removed from the incoming data stream. Take care of the keyboard or mouse interrupt signal (the keyboard and mouse are also serial devices). Can handle the computer and external serial device synchronization management issue. Buffers for input and output data are available on some high-end UARTs. The 16550 is a newer UART that can keep 16 bytes of data in its buffer before the computer needs to process it, whereas the 8250 is the standard UART. If you buy a built-in modem, it will almost always come with a 16550 UART.

 

Ⅲ. What is UART used for?

Debugging: Detecting system bugs early in the development process is critical. In this case, adding UART can help by capturing messages from the system.

Manufacturing function-level tracing: In the manufacturing industry, logs are quite significant. They decide functions by informing operators about what is going on on the production line.

Updates for customers or clients: Software updates are critical. To have a comprehensive system, you need complete, dynamic hardware with update-capable software.

Testing/verification: Verifying products before they leave the manufacturing process ensures that customers receive the highest quality products available.

 

Ⅳ. What are the advantages and disadvantages of UART?

(1) Advantages:

UARTs are good at transferring and receiving data, despite the fact that there are no perfect communication protocols.

UARTs are simple devices with only two wires.

They have a parity bit that allows them to examine data packets for mistakes.

It is possible if both sides are set up for structural data modification.

UART is a widely-used communication mechanism.

(2) Disadvantages:

The data frame has a 9-bit limit.

The receiving and transmitting UAT's baud rates must be within ten percent of each other.

 

Ⅴ. What’s the working principle of UART?

The data bus sends data to the UART that will transfer it. The data bus is used to deliver data from other devices to the UART (such as CPU, memory, or microcontroller). Data is sent in parallel from the data bus to the sending UART. After receiving parallel data from the data bus, the sending UART creates a data packet by adding a start bit, a parity bit, and a stop bit. The data packet is then serially sent on the Tx pin, bit by bit. On its Rx pin, the receiving UART reads the data stream bit by bit. The data is then converted back to parallel form and the start, parity, and stop bits are removed by the receiving UART. Finally, the data packets are transmitted in parallel to the data bus at the receiving end by the UART:

 WORKING PRINCIPLE.png

Source: Internet

The data sent over UART is divided into packets. Each packet has one start bit, five to nine data bits (depending on the UART), an optional parity bit, and one or two stop bits:

 WORKING2.png

Source: Internet

START BITS

When the UART data transmission line is not transmitting data, it is generally held at a high voltage level. The transmitting UART pulls the transmission line from high to low for one clock cycle to initiate data transfer. When the receiving UART detects a high-to-low voltage transition, it starts reading the bits in the data frame at the baud rate's frequency.

 

FRAME OF DATA

The actual data being sent is contained in the data frame. If a parity bit is employed, it can be anything from 5 to 8 bits long. The data frame can be 9 bits long if no parity bit is used. The data is usually delivered with the least significant bit first.


PARITY

The evenness or oddness of a number is described by parity. The receiving UART uses the parity bit to determine if any data has changed during transmission. Electromagnetic radiation, mismatched baud rates, and long-distance data transmissions can all alter bits. After reading the data frame, the receiving UART counts the number of bits with a value of 1 and determines whether the total is even or odd. The 1 bits in the data frame should amount to an even number if the parity bit is a 0 (even parity). The 1 bits in the data frame should sum to an odd number if the parity bit is a 1 (odd parity).The UART understands that the transmission was error-free when the parity bit matches the data. The UART knows that bits in the data frame have changed if the parity bit is a 0 and the total is odd; or if the parity bit is a 1 and the total is even.

 

STOP BITS

The sending UART drives the data transmission line from a low voltage to a high voltage for at least two-bit lengths to signify the end of the data packet.


Topics covered in this article:
Ⅰ. What is UART?
Ⅱ. What's the function of UART?
Ⅲ. What is UART used for?
Ⅳ. What are the advantages and disadvantages of UART?
Ⅴ. What's the working principle of UART?


Ⅰ. What is UART?

UART stands for Universal Asynchronous Receiver and Transmitter. In most embedded devices, it is a communication interface that is set up by default. This is due to the fact that many embedded devices lack a display panel and hence are unable to get real-time data information. They are connected to the HyperTerminal via the UART serial port to print the embedded device's output information. When it comes to tracing and debugging the embedded system, the UART serial interface is a must-have. The serial port is used to configure network routers, switches, and other devices. Many hardware data outputs use the UART serial port. GPS receivers, for example, use the UART serial port to output GPS data.

 

Ⅱ. What’s the function of UART?

Inside the computer, parallel data is used, and the data cannot be delivered straight to the modem. To achieve asynchronous communication, the UART must sort it. The following is the procedure: the CPU first loads the data to be written to the serial device into the UART's register (temporary memory block). The data is then sent to the serial device through FIFO (First Input First Output). If there is no FIFO, the data will get jumbled and unable to transmit to the modem.

It's a control chip for computers and serial devices. It has an RS-232C data terminal device interface, which allows the computer to communicate with modems and other serial devices that use the RS-232C interface. UART additionally supports the following functions as part of the interface: Convert the parallel data from the computer into a serial data stream for output. Convert serial data from the outside of the computer into bytes for use by the computer's parallel data devices. Perform a parity check on the data stream received from the outside and add a parity bit to the output serial data stream. The start-stop mark should be added to the output data stream, and the start-stop mark should be removed from the incoming data stream. Take care of the keyboard or mouse interrupt signal (the keyboard and mouse are also serial devices). Can handle the computer and external serial device synchronization management issue. Buffers for input and output data are available on some high-end UARTs. The 16550 is a newer UART that can keep 16 bytes of data in its buffer before the computer needs to process it, whereas the 8250 is the standard UART. If you buy a built-in modem, it will almost always come with a 16550 UART.

 

Ⅲ. What is UART used for?

Debugging: Detecting system bugs early in the development process is critical. In this case, adding UART can help by capturing messages from the system.

Manufacturing function-level tracing: In the manufacturing industry, logs are quite significant. They decide functions by informing operators about what is going on on the production line.

Updates for customers or clients: Software updates are critical. To have a comprehensive system, you need complete, dynamic hardware with update-capable software.

Testing/verification: Verifying products before they leave the manufacturing process ensures that customers receive the highest quality products available.

 

Ⅳ. What are the advantages and disadvantages of UART?

(1) Advantages:

UARTs are good at transferring and receiving data, despite the fact that there are no perfect communication protocols.

UARTs are simple devices with only two wires.

They have a parity bit that allows them to examine data packets for mistakes.

It is possible if both sides are set up for structural data modification.

UART is a widely-used communication mechanism.

(2) Disadvantages:

The data frame has a 9-bit limit.

The receiving and transmitting UAT's baud rates must be within ten percent of each other.

 

Ⅴ. What’s the working principle of UART?

The data bus sends data to the UART that will transfer it. The data bus is used to deliver data from other devices to the UART (such as CPU, memory, or microcontroller). Data is sent in parallel from the data bus to the sending UART. After receiving parallel data from the data bus, the sending UART creates a data packet by adding a start bit, a parity bit, and a stop bit. The data packet is then serially sent on the Tx pin, bit by bit. On its Rx pin, the receiving UART reads the data stream bit by bit. The data is then converted back to parallel form and the start, parity, and stop bits are removed by the receiving UART. Finally, the data packets are transmitted in parallel to the data bus at the receiving end by the UART:

 WORKING PRINCIPLE.png

Source: Internet

The data sent over UART is divided into packets. Each packet has one start bit, five to nine data bits (depending on the UART), an optional parity bit, and one or two stop bits:

 WORKING2.png

Source: Internet

START BITS

When the UART data transmission line is not transmitting data, it is generally held at a high voltage level. The transmitting UART pulls the transmission line from high to low for one clock cycle to initiate data transfer. When the receiving UART detects a high-to-low voltage transition, it starts reading the bits in the data frame at the baud rate's frequency.

 

FRAME OF DATA

The actual data being sent is contained in the data frame. If a parity bit is employed, it can be anything from 5 to 8 bits long. The data frame can be 9 bits long if no parity bit is used. The data is usually delivered with the least significant bit first.


PARITY

The evenness or oddness of a number is described by parity. The receiving UART uses the parity bit to determine if any data has changed during transmission. Electromagnetic radiation, mismatched baud rates, and long-distance data transmissions can all alter bits. After reading the data frame, the receiving UART counts the number of bits with a value of 1 and determines whether the total is even or odd. The 1 bits in the data frame should amount to an even number if the parity bit is a 0 (even parity). The 1 bits in the data frame should sum to an odd number if the parity bit is a 1 (odd parity).The UART understands that the transmission was error-free when the parity bit matches the data. The UART knows that bits in the data frame have changed if the parity bit is a 0 and the total is odd; or if the parity bit is a 1 and the total is even.

 

STOP BITS

The sending UART drives the data transmission line from a low voltage to a high voltage for at least two-bit lengths to signify the end of the data packet.


(+86) 755-8257-9923

sales@myasias.com
0