Uart definition pdf




















It transfers data between devices by connecting two wires between the devices, one is the transmission line while the other is the receiving line. The data transfers bit by bit digitally in form of bits from one device to another. The main advantage of this communication protocol is that its not necessary for both the devices to have the same operating frequency.

For example, two microcontrollers operating at different clock frequencies can communicate with each other easily via serial communication. However, a predefined bit rate that is referred to as baud rate usually set in the flash memory of both microcontrollers for the instruction to be understood by both the devices.

The transmitting UART takes bytes of data and transmits the bits in a sequential form. The second transmitter which is the receiver reassembles the bits into a complete byte. Serial transmission of data through a single wire is actually more cost-effective than parallel transmission through multiple wires.

Communication between two UART devices may be simplex, full-duplex or half-duplex. Simplex communication is a one-direction type of communication where the signal moves from one UART to another. A full-duplex is when both devices can transmit and receive communications at the same time. A half-duplex is when devices take turns to transmit and receive.

There was a time not so long ago when keyboards, mice, and printers had thick cables and clunky connectors. These had to be literally screwed into the computer.

These devices where using UART to communicate with computers. We can use it to connect Bluetooth modules and GPS modules. It is a physical circuit fount in a microcontroller. It can also function as a stand-alone integrated circuit. One significant advantage of UART is that it only relies on two wires to transmit data.

On one end the transmitting UART converts parallel data from a CPU into serial form then transmits the data in serial form to the second UART which will receive the serial data and convert it back into parallel data.

This data can then be accessed from the receiving device. Instead of cloak signals the transmitting and receiving bit use start and stop bit signals for the data packages. These start and stop bits define the beginning and the end of the data packages. Therefore the receiving UART knows when to start and stop reading the bits. The specific frequency used to read the incoming bits is known as the baud rate.

The baud rate is a measure used for the speed of data transfer. The unit used for baud rate is bits per second bps.

In order for the data transfer to be a success both the transmitting and receiving UART must operate at almost the same baud rate. The receiving and transmitting UART must be configured to receive the same data packages. The transmitting UART receives data from a data bus. A data bus is used to send data from another device such as a microcontroller, memory or CPU. When the transmitting UART receives the data it processes the data by adding a start bit and a stop bit.

This, in turn, creates a data package. Bit by bit the data packet is serially output at the Tx pin. The transmitting UART is connected to a controlling data bus that sends data in a parallel form. From this, the data will now be transmitted on the transmission line wire serially, bit by bit, to the receiving UART.

This, in turn, will convert the serial data into parallel for the receiving device. The UART lines serve as the communication medium to transmit and receive one data to another. Take note that a UART device has a transmit and receive pin dedicated for either transmitting or receiving. For UART and most serial communications, the baud rate needs to be set the same on both the transmitting and receiving device. The baud rate is the rate at which information is transferred to a communication channel.

In the serial port context, the set baud rate will serve as the maximum number of bits per second to be transferred. The UART interface does not use a clock signal to synchronize the transmitter and receiver devices; it transmits data asynchronously. Instead of a clock signal, the transmitter generates a bitstream based on its clock signal while the receiver is using its internal clock signal to sample the incoming data.

The point of synchronization is managed by having the same baud rate on both devices. Failure to do so may affect the timing of sending and receiving data that can cause discrepancies during data handling. In UART, the mode of transmission is in the form of a packet.

The piece that connects the transmitter and receiver includes the creation of serial packets and controls those physical hardware lines.

A packet consists of a start bit, data frame, a parity bit, and stop bits. To start the transfer of data, the transmitting UART pulls the transmission line from high to low for one 1 clock cycle. When the receiving UART detects the high to low voltage transition, it begins reading the bits in the data frame at the frequency of the baud rate. The data frame contains the actual data being transferred.

It can be five 5 bits up to eight 8 bits long if a parity bit is used. If no parity bit is used, the data frame can be nine 9 bits long. In most cases, the data is sent with the least significant bit first. Parity describes the evenness or oddness of a number. The parity bit is a way for the receiving UART to tell if any data has changed during transmission.

Bits can be changed by electromagnetic radiation, mismatched baud rates, or long-distance data transfers. After the receiving UART reads the data frame, it counts the number of bits with a value of 1 and checks if the total is an even or odd number. If the parity bit is a 0 even parity , the 1 or logic-high bit in the data frame should total to an even number.

If the parity bit is a 1 odd parity , the 1 bit or logic highs in the data frame should total to an odd number. When the parity bit matches the data, the UART knows that the transmission was free of errors.

But if the parity bit is a 0, and the total is odd, or the parity bit is a 1, and the total is even, the UART knows that bits in the data frame have changed. To signal the end of the data packet, the sending UART drives the data transmission line from a low voltage to a high voltage for one 1 to two 2 bit s duration.

The receiving UART samples the data line at the preconfigured baud rate. Fifth: The receiving UART converts the serial data back into parallel and transfers it to the data bus on the receiving end. One key feature that is available in UART yet not fully used is the implementation of a frame protocol. The main use and importance of this is an added value for security and protection on each device.

For instance, when two devices use the same UART frame protocol, there are tendencies that, when connecting to the same UART without checking the configuration, the device will be connected to different pins that may cause malfunctions in the system. On the other hand, implementing this ensures security because of the need to parse the information received in alignment with the design frame protocol.

Each frame protocol is specifically designed to be unique and secure. In designing a frame protocol, designers can set the desired headers and trailers, including CRC, to different devices. In Figure 13, two 2 bytes are set as part of the header. Header is the unique identifier that determines if you are communicating with the correct device. Command will depend on the list of command designed to create the communication between two devices.

Data length will be based on the command chosen. You can maximize the length of data depending on the command chosen, so it can vary based on the selection. In that case, the data length can be adjusted.



0コメント

  • 1000 / 1000