0% found this document useful (0 votes)
17 views25 pages

ES Module 3

The document provides an overview of various communication interfaces including UART, RS422/RS485, USB, I2C, CAN, and LIN Bus. It details the functionalities, data transmission methods, and key features of each protocol, highlighting their applications in serial communication. The document explains how these protocols operate, their architecture, and the specific use cases they are designed for.

Uploaded by

ta2846025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views25 pages

ES Module 3

The document provides an overview of various communication interfaces including UART, RS422/RS485, USB, I2C, CAN, and LIN Bus. It details the functionalities, data transmission methods, and key features of each protocol, highlighting their applications in serial communication. The document explains how these protocols operate, their architecture, and the specific use cases they are designed for.

Uploaded by

ta2846025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Module III

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

• Control packet transfers for USB management: This data


transmission is used to set up and manage USB devices. The host
submits a request to the device, followed by data transmission.
Control transfer is also used for status checks. At any one moment,
only one control request can be processed.
• USB Components:
• Host: The computer or primary device that controls the
communication and provides power. In a typical setup, the host
initiates communication with peripheral devices.
• Hub: Devices that expand a single USB port into multiple ports,
allowing more devices to connect to the host
• Device: The peripheral that connects to the host, such as a keyboard,
mouse, printer, external hard drive, or smartphone
• Data Transfer Modes:
• Control Transfer: Used for sending control commands from the
host to the device, typically for configuration or status requests
• Bulk Transfer: Efficiently moves large amounts of data with no
fixed timing requirement
• Interrupt Transfer: Used for timely data delivery that require
immediate attention
• Isochronous Transfer: Ensures data is delivered at a constant rate,
suitable for real-time applications like audio and video streaming
• Key features of USB
1] Hot swapping
• This functionality enables the removal or replacement of a device without requiring a system
restart or interruption
2] Direct current transfer
• Another aspect of USB is the usage of direct current (DC). Several devices are connected to a DC
current through a USB power connection but do not communicate data. Notable examples
include USB speakers, small refrigerators, keyboard lamps, and even USB-based device chargers
3] The use of multiple contact points
• All USB connections feature at least four contacts used for power, ground, and two data wires (D
+ and D -). The USB connection is intended to transmit 5V at a maximum current of 500mA
4] Shielding and protection
• The USB connection is insulated, providing a metal casing that is not part of the circuit. This
characteristic is crucial for maintaining the signal’s integrity in an electrically “busy”
environment. All USB cables are wrapped in plastic at the connection end to avoid damage to
the cable and electrical connection.
I2C (Inter-Integrated Circuit)
• It was originally designed by Philips Semiconductor in 1982
• Recently, it is a widely used protocol for short-distance communication
• It is also known as Two Wired Interface(TWI)
• I2C combines the best features of SPI and UARTs. With I2C, you can connect multiple
slaves to a single master (like SPI) and you can have multiple masters controlling single, or
multiple slaves
• Like UART communication, I2C only uses two wires to transmit data between devices:
• SDA (Serial Data) – The line for the master and slave to send and receive data.
• SCL (Serial Clock) – The line that carries the clock signal
• I2C is a serial communication protocol, so data is transferred bit by bit along a single wire
(the SDA line)
• WORKING OF I2C
• With I2C, data is transferred in messages. Messages are broken up
into frames of data
• Each message has an address frame that contains the binary address of the
slave, and one or more data frames that contain the data being transmitted
• The message also includes start and stop conditions, read/write bits, and
ACK/NACK bits between each data frame:
• Address Frame: A 7 or 10 bit sequence unique to each slave that identifies
the slave when the master wants to talk to it.
• Read/Write Bit: A single bit specifying whether the master is sending data
to the slave (low voltage level) or requesting data from it (high voltage
level).
• ACK/NACK Bit: Each frame in a message is followed by an acknowledge/no-
acknowledge bit. If an address frame or data frame was successfully
received, an ACK bit is returned to the sender from the receiving device.
CAN (Controller Area Network )
• It is a protocol that was developed by Robert Bosch in around 1986
• The CAN protocol is a standard designed to allow the microcontroller and
other devices to communicate with each other without any host computer
• The feature that makes the CAN protocol unique among other
communication protocols is the broadcast type of bus
• Here, broadcast means that the information is transmitted to all the nodes
• The node can be a sensor, microcontroller, or a gateway that allows the
computer to communicate over the network through the USB cable or
ethernet port
• The CAN is a message-based protocol, which means that message carries
the identifier, and based on the identifier, priority is decided
• It is a serial half-duplex and asynchronous type of communication protocol
• The CAN is a two-wired communication protocol as the CAN network is
connected through the two-wired bus
• CAN layered architecture
• Application Layer: This layer defines the services and
interfaces that are available to the application, such as
sending and receiving messages, and monitoring the
status of the network
• Presentation layer: It acts as a translator for data into a
format used by the application layer at the receiving end
of the station
• Session layer: It allows to establishing, communicating
and terminating sessions between processes running on
two different devices
• Transport layer: It ensures that messages are delivered error-free, in
sequence, and without loss or duplication
• Network layer: It provides end to end logical addressing system so that a
packet of data can be routed across several layers and establishes, connects
and terminates network connections
• Data link layer: This layer is responsible for transferring frames from one
device to another without errors. After sending the frame it waits for the
acknowledgement from receiving device. Data link layer has two sub layers:
MAC (Medium Access Control) layer: It performs frame coding, error
detection, signaling, serialization and de-serialization.
 LLC (Logical Link Control) layer: The LLC sub layer provides multiplexing
mechanisms that make it possible for several network protocols to coexist
within a multipoint network and to be transported over the same network
medium
• Physical Layer − This layer is responsible for the physical transmission of bits
over the communication medium, such as a cable or wireless link
• CAN Framing
• Bus idle: This bit is essentially part of the state of the CAN bus during
interframe spacing, ensuring proper synchronization and avoidance of
collisions in the communication protocol
• SOF: SOF stands for the start of frame, which indicates that the new
frame is entered in a network. It is of 1 bit.
• Identifier: This 11-bit message identifier is used to set the priority of
the data frame.
• RTR: RTR stands for Remote Transmission Request, which defines the
frame type, whether it is a data frame or a remote frame (Requests the
transmission of a data frame from another node in the network). It is of 1-bit.
• Control field:
IDE: An IDE bit in a control field stands for identifier extension. It
indicates whether the frame is in base or extended format
DLC: DLC stands for Data Length Code, which defines the data length
in a data field. It is of 4 bits
• Data field: The data field can contain upto 8 bytes.
• CRC field: The data frame also contains a cyclic redundancy check
field of 15 bit, which is used to detect the corruption if it occurs
during the transmission time. The sender will compute the CRC before
sending the data frame, and the receiver also computes the CRC and
then compares the computed CRC with the CRC received from the
sender. If the CRC does not match, then the receiver will generate the
error.
• ACK field: This is the receiver's acknowledgment. A separate packet
for an acknowledgment is sent after receiving all the packets
• EOF: EOF denotes end of frame
LIN Bus (Local Interconnect Network )

• The LIN bus is a serial communication protocol used primarily in automotive


networks
• It is a lower-cost, simpler alternative to the CAN bus, designed for
applications where the bandwidth, speed, and robustness of CAN are not
necessary
• LIN is typically used for non-critical, low-speed communication tasks in
vehicles, such as controlling door locks, window lifts, or seat adjustment
mechanisms.
• Key Features
• Low Cost: It uses a single-wire communication system, reducing the cost of
wiring and connectors.
• Low Speed: LIN operates at a lower data rate than CAN, typically up to 20
kbps, which is sufficient for many non-critical applications in automotive
systems.
• Master-Slave Architecture: LIN uses a master-slave communication model,
where one master node controls the communication on the bus, and
multiple slave nodes respond to the master’s requests
• Deterministic Communication: LIN ensures deterministic communication,
meaning that the timing of message transmission is predictable
• LIN Frame Structure
• Sync Break: Denotes the start of a new frame. This helps slaves to detect the beginning
of a communication frame
• Sync Field: A predefined 8-bit pattern used by slave nodes to synchronize their baud rate
with the master node
• Identifier Field: A 6-bit identifier field followed by 2 parity bits. The identifier determines
the type of data being transmitted and which slave node should respond
• Data Field: The data field contains between 1 and 8 bytes of data. The length of the data
field is determined by the message type
• Checksum Field: The checksum is used for error detection. There are two types of
checksums in LIN: classic checksum (covers only the data field) and enhanced checksum
(covers both the data field and the identifier field)

You might also like