Embedded Protocol – UART

  • Serial Communication
  • UART (Universal Asynchronous Receiver Transmitter)
  • Type of Communication : Asynchronous- No clock.
  • UART is full duplex communication, But its will works half duplex and simplex method.
  • Transmitter and receiver should same baud rate
  • Data format and transmission speed is configurable.
  • UART contains a shift register, which is the fundamental method of conversion between serial and parallel forms.

UART Speed (Baud Rate)

Bit/Second

UART supports many baud rate are 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400.

 

UART Definition

  •  Auto baud rate
  • DUART (Dual UART)
  • Parity error (Single bit error only can identify, can’t find two or more bits’ error)
  • Over run error
  • TX register
    •   TX shift Register (TSR) à in PIC16F8X
  • RX resister
    • RX Shift Register (RSR) à in PIC16F8X
  •   1 Start bit, (LSB to MSB) 8bit data, 1-parity check bit, 1stop bit,

 

UART Packet Rate

 

 

  • Start Bit
    • The UART data transmission line is normally held at a high voltage level when it’s not transmitting data. To start the transfer of data, the transmitting UART pulls the transmission line from high to low for one 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 start bit is logical low. The start bit signals the receiver that a new character is coming.

 

  • Data Frame – The data frame contains the actual data being transferred. It can be 5 bits up to 8 bits long if a parity bit is used. If no parity bit is used, the data frame can be 9 bits long. In most cases, the data is sent with the least significant bit first.

 

  • Parity Bit – 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 bits in the data frame should total to an even number. If the parity bit is a 1 (odd parity), the 1 bits 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.

 

  • UART Error
    • A framing error occurs when the designated start and stop bits are not found. If the data line is not in the expected state when the stop bit is expected, a framing error will occur.
    • An Under run error occurs when UART transmitter has completed sending a character and the transmit buffer is empty. In asynchronous mode this is treated as an indication that no data remains to be transmitted.
    • A parity error occurs when the parity of the number of 1 bits disagrees with that specified by the parity bit. Using parity is optional, so this error will only occur if parity checking has been enabled.
    • A break condition occurs when the receiver input is at the space level for longer than some duration of time, typically, for more than a character time.

 

  • Stop Bit – 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 at least two bit duration.

UART Uses

  • Serial communication over a computer or peripheral device serial port.

 

UART IC

  • WD1402A is the first single chip UART on general sale. Introduced about 1971.
  • Compatible chip included the Fairchild TR1402A and the general instruments AY-5-1013.
  • What is the speed of the 8250 UART?
    • The 8250 UART has one character buffer for the receiver and the transmitter each, which meant that communications software performed poorly at speed above 9600bits/sec, especially it operating under a multitasking system or if handling interrupts from disk controllers.

 


UART Advantage & Disdavantages

Advantages

  • Only two wires intereface
  • No clock signal is necessary
  • Error checking Feature allow : Has a parity bit check
  • The structure of the data packet can be changed as long as both sides are set up for it
  • Widely Used method and well documented

Disadvantage

  • Data frame maximum only 9 bits limitted
  • Does not support multiple slave or multiple master systems
  • The baud rates of each UART must be within 10% of each other

 



 

UART Communication between Two Computers

 


 

UART Communication between Mobile and Computers

 


UART Communication between Two Mobiles

 



UART Protocol Interview Questions

What is UART?

UART is Serial Communication or parallel communication?

UART is synchronous communication or asynchronous communication?

UART is half duplex communication or full-duplex communication?

What is Baud Rate of UART supports??

What is the maximum length of the UART Cable can communicate?

  •  We was working upto 2 meters RJ45 cable(LAN cable).

 

What are the devices use UART protocol ?

  •  GPS module like SIM900/800 uses UART protocol
  • Finger print sensor uses the UART protocol
  • RFID modules uses the UART protocols

 

 



UART Interface Examples

 



Reference

 



 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

if you have any queries call us +918300026060 or WhatsApp Dismiss

0

Your Cart

%d bloggers like this: