ES Module 3
ES Module 3
Communication Interfaces
UART (Universal Asynchronous Receiver Transmitter Protocol)
• UART is used for serial communication from the name itself we can understand
the functions of UART, where
U: Universal which means this protocol can be applied to any transmitter and
receiver
A: Asynchronous which means one cannot use clock signal for communication of
data
R and T refers to Receiver and Transmitter
• Hence UART refers to a protocol in which serial data communication will happen
without clock signal
• UARTs transmit data asynchronously, which means there is no clock signal to
synchronize the output
• Instead of a clock signal, the transmitting UART adds start and stop bits to the
data packet being transferred. These bits define the beginning and end of the
data packet so the receiving UART knows when to start reading the bits
• In UART communication, two UARTs communicate directly with each other
• The transmitting UART converts parallel data from a controlling device like a CPU into serial
form, transmits it in serial to the receiving UART, which then converts the serial data back
into parallel data for the receiving device
• Only two wires are needed to transmit data between two UARTs
• Data flows from the Tx pin of the transmitting UART to the Rx pin of the receiving UART
• Communication in UART can be simplex (data is sent in one direction only), half-
duplex (each side speaks but only one at a time), or full-duplex (both sides can transmit
simultaneously)
• Data in UART is transmitted in the form of frames
• Working of UART
• The UART that is going to transmit data receives the data from a data bus
• The data bus is used to send data to the UART by another device like a CPU, memory, or
microcontroller
• Data is transferred from the data bus to the transmitting UART in parallel form
• After the transmitting UART gets the parallel data from the data bus, it adds a start bit, a parity bit,
and a stop bit, creating the data packet
• Next, the data packet is output serially, bit by bit at the Tx pin
• The receiving UART reads the data packet bit by bit at its Rx pin
• The receiving UART then converts the data back into parallel form and removes the start bit, parity
bit, and stop bits
• Finally, the receiving UART transfers the data packet in parallel to the data bus on the receiving end
• UART transmitted data is organized into packets. Each packet contains 1
start bit, 5 to 9 data bits, an optional parity bit, and 1 or 2 stop bits
• 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
• 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
• 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 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
• STOP BITS
• To signal the end of the data packet, the sending UART drives the data transmission line
from a low voltage to a high voltage
RS422/RS485
• RS-422 and RS-485 are both standards for serial communication, often
used in industrial and long-distance applications
• They differ in how they manage data transmission and network
configuration
• Here's an illustration of their differences:
Parameter RS-422 RS-485
Purpose A communication method for serial data An advanced version of RS-422, designed to
transmission. It’s designed for point-to-point or support multi-point communication with
point-to-multipoint communication with 1 multiple devices on the same bus. It allows up
transmitter and up to 10 receivers to 32 transmitters and 32 receivers on a single
bus, making it suitable for complex, multi-drop
networks
Signal Operates in a full-duplex mode, meaning it has Typically operates in a half-duplex mode,
Configuration separate pairs of wires for transmitting and meaning it uses a single pair of wires for both
receiving data. This allows simultaneous two-way transmitting and receiving data. Only one
communication between the transmitter and the device can transmit at a time. However, RS-485
receiver can also be configured for full-duplex with
additional wiring
Wiring Requires 4 wires (two twisted pairs) for full- Requires only 2 wires (a single twisted pair) for
duplex communication: one pair for transmitting half-duplex communication: one pair shared
(Tx+ and Tx-) and one pair for receiving (Rx+ and for both transmit and receive. For full-duplex
Rx-). operation, it would require 4 wires
Network Primarily designed for point-to-point or point-to- Designed for multi-point networks, allowing
Topology multipoint configurations, with one transmitter multiple devices (up to 32 transmitters and 32
and up to 10 receiver receivers) to share the same communication
line
Parameter RS-422 RS-485
Distance and Typically supports communication over Similar to RS-422, it supports
Speed distances up to 1,200 meters at speeds distances up to 1,200 meters, but it
of up to 10 Mbps is more commonly used at speeds
up to 35 Mbps for short distances &
100 kbps for maximum distance
Common Use Often used in applications where a Widely used where multiple devices
Cases single master device needs to need to communicate over long
communicate with multiple slave distances and a shared bus system is
devices in a controlled environment required
USB (Universal serial bus )
• USB is defined as a standard that mentions the specifications used
by cables, ports, and protocols that enable universally accepted
connectivity between a host and peripheral device
• The working of a USB can be broken down as follows:
• Data transfer in bulk: This type of transmission is employed for
huge quantities of data. It is generally a low-priority transmission
and is not time-sensitive. The operation may be delayed if the host
machine has many USB devices attached.
• Small packets for critical device connections: This feature is used
to transmit tiny quantities of data. The remote device generates
requests and waits for the host to enquire about the precise data it
would need. The requests will be reattempted if the first request
for transaction fails