Uart Srial

Description


This content is about the serial communication network, which has been tried to be presented in a practical way.


Hardware



Data transfer takes place in three ways:

  1. Simplex: In this connection, the sender and the receiver are fixed and the direction of information transfer is always one-way.
  2. Half-Duplex: In this case, each software is either a data receiver or a data transmitter, which sends and receives information from a platform with software and hardware management.
  3. Full-Duplex: In this case, the path of data transmission and reception is separate from each other, this causes the sending and receiving of the same information.

Three standard platforms have been created for UART communication:

  1. RS-232: This platform is three wires, the path of sending and receiving information is separate from each other.

    1. Data signals:All data is transmitted through these signals.
      1. Pin 2: Received Data(RXD)
      2. Pin 3: Transmit Data(TXD)
      3. Pin 5: Ground(GND)
    2. Communication ready signals:
      1. Pin 1: Data Carrier Detect(DCD)
      2. Pin 4: Data Terminal Ready(DTR)
      3. Pin 6: Data Set Ready(DSR)
      4. Pin 9: Ring Indicator(RI)
    3. Handshaking signals to control data flow:
      1. Pin 7: Requet To Sed(RST)
      2. Pin 8: Clear To Send(CTS)

    You may have a question that what is the use of these signals?!

    Answer: Hardware management that makes the "sender and receiver" readiness to be checked. Send and receive data to be validated.

    DTE to DCE Link With Software Handshaking and Loop Back (Straight Cable)
    DTE to DTE (Null Modem) Link With Hardware Handshaking and Loop Back (Crossover Cable)
    DTE to DTE (Null Modem) Link With DTR Handshaking and Loop Back (Crossover Cable)
  2. RS-485: This platform is two-way, the path of sending and receiving information is the same.
  3. RS-422: This platform is four-wire, the path of sending and receiving information is the same.

Balanced vs Unbalanced:



ُSoftware

Frame Uart

  1. Baud Rate:
    1. 110
    2. 150
    3. 300
    4. 1200
    5. 4800
    6. 9600
    7. 19200
    8. 38400
    9. 57600
    10. 115200
    11. 230400
    12. 460800
    13. 921600
  1. Start Bit:
    1. 0
    2. 1
  2. Data:
    1. 9 Bit
    2. 8 Bit
    3. 7 Bit
    4. 6 Bit
    5. 5 Bit
  3. Stop Bit:
    1. 1 Bit
    2. 2 Bit
  1. Parity:
    1. None:The balance bit is not formed.
    2. Odd:If the number of 1's in the data bit is even, the balance bit becomes 1 to make the result odd.
    3. Even:If the number of 1's in the data bit is odd, the balance bit becomes 1 to make the result even.
    4. Mark:The balance bit will always be one.
    5. Space:The balance bit will always be zero.
  2. Flow Control:
    1. None
    2. RTS/CTS
    3. DTR/CTS
    4. RS-485-RST

Packet

Packet Speed= (1 / Baud Rate) * (data + Stop Bit + Start Bit + Parity) * 10
For example:to send 8 characters with a baud rate of 19200, the required time is as follows:
(1/19200)*(8+2)*10=5.20ms


decoding data

After decoding the data from the packet, the data can be displayed in the following formats.