0% found this document useful (0 votes)
38 views

Appendix On Communication Protocols

Uploaded by

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

Appendix On Communication Protocols

Uploaded by

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

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

School of Electrical and Electronic Engineering


Department of Automation Engineering

EMBEDDED CONTROL SYSTEM

Appendix on communication standards

Instructor: Chu Duc Viet


Group 11:
Tran Le Duc Anh 20202782
Bui Ngoc Tien 20202773
Nguyen Tuan Minh 20202794

Hanoi, 11/2023
Contents
I. SPI (Serial Peripheral Interface) ................................3
II. I2C (Inter-Integrated Circuit): ....................................4
III. UART (Universal Asynchoronus Receiver –
Transmitter) .................................................................5
IV. RS (Reccommended Standard: RS 232/422/485) .......6
a. RS232:....................................................................6
b. RS422:....................................................................7
c. RS485.....................................................................8
V.CAN (Controller Area Network) ………………………………. 9
Summary ................................................................... 10
Contacting our Project ................................................ 11
I. SPI (Serial Peripheral Interface)
• Structure:

• MOSI (Master Out Slave In): Used to


transmit data from master to slave.

• MISO (Master in Slave Out): Used to


transmit data from slave to master.

• SCLK (Serial Clock): Generates a


synchronous clock signal for data
transmission.

• SS/CS (Slave Select/Chip Select): Selects which slave will perform data transmission.

• Advantages:

• Continuous data transmission without interruption.

• Higher data transmission speed compared to I2C.

• Separate MISO and MOSI lines allow for simultaneous data transmission and reception.

• Supports connection to multiple slaves with one master.

• Disadvantages:

• Requires more wires (4 wires).

• No acknowledgment of successfully received data.

• No error-checking mechanism like parity bit in UART.

• Only allows for a single master.


II. I2C (Inter-Integrated Circuit):
• Structure:

• SDA (Serial Data): Transmits and


receives data between devices.

• SCL (Serial Clock): Clock signal for


synchronizing data transmission.

• Advantages:

• Uses only two wires.

• Supports multiple masters and multiple slaves.

• Bit ACK/NACK confirms each frame is successfully transmitted.

• Hardware is less complex compared to UART.

• Widely used and renowned protocol.

• Disadvantages:

• Slower data transmission speed than SPI.

• Frame size limited to 8 bits.

• Requires more complex hardware deployment compared to SPI.


III. UART (Universal Asynchronous Receiver –
Transmitter)
▪ Structure
o Transmitter

▪ Data Register: This is a buffer that holds the data to be transmitted. The
transmitter writes data into this register.
▪ Control Logic: It controls the data flow and synchronization of the transmission
process.
▪ Baud Rate Generator: This component generates the clock signal required for
timing the transmission. It sets the speed of data transmission by determining
the baud rate.
o Receiver

▪ Data Register: Like the transmitter, the receiver has a data register that stores
the received data.
▪ Control Logic: It manages the reception process, including synchronization and
error detection.
▪ Shift Register: The shift register is used for serializing and deserializing the data.
It takes the parallel data from the transmitter or receiver and converts it into a
serial bit stream for transmission or vice versa.
▪ Baud Rate Generator: The receiver also has a baud rate generator to generate
the clock signal for timing the reception process.
o Start and Stop Bits: UART uses start and stop bits to frame each data byte. The start bit
indicates the beginning of a data byte, while the stop bit indicates the end. These bits
provide synchronization between the transmitter and receiver.
o Control Signals:
▪ RTS (Request to Send): It is an output signal used for flow control. The
transmitting device asserts this signal to request permission to send data.
▪ CTS (Clear to Send): It is an input signal used for flow control. The receiving
device asserts this signal to grant permission for data transmission.
▪ Other control signals like DTR (Data Terminal Ready) and DSR (Data Set Ready)
may also be present in some UART implementations.

Figure 1. UART packet.


▪ Advantages
o Easy to implement and integrate into various devices.
o Widely supported communication standard
o Can handle noise and interference.
o Power-efficient, making it suitable for battery-powered devices or low-power
applications.
o Data is transmitted without the need for a shared clock signal between the transmitter
and receiver.
▪ Disadvantages
o Limited Transmission Distance
o Lack of Data Flow Control
o Not provide a standardized protocol for data framing, error detection, or higher-level
communication

IV. RS (Recommended Standard: RS 232/422/485)


a. RS232:
▪ Structure
o Data Transmission:
▪ Data Lines: RS-232 uses two data lines for transmission: a transmit line (TXD)
and a receive line (RXD). The transmitting device sends data on the TXD line,
while the receiving device receives data on the RXD line. These lines carry the
serial data stream in a binary format.
o Control Signals:
▪ Request to Send (RTS): RTS is an output signal used for hardware flow control.
The transmitting device asserts the RTS line to request permission to send data
to the receiving device.
▪ Clear to Send (CTS): CTS is an input signal used for hardware flow control. The
receiving device asserts the CTS line to grant permission for data transmission
from the transmitting device.
▪ Data Terminal Ready (DTR): DTR is an output signal indicating that the
transmitting device is ready to exchange data.
▪ Data Set Ready (DSR): DSR is an input signal indicating that the receiving device
is ready to exchange data.
o Grounding:
▪ Signal Ground (SG): The SG line provides a reference ground connection for the
RS-232 signals. It ensures a common ground potential between the transmitting
and receiving devices.
o Connectors:
▪ DB-9 Connector: The most common connector used for RS-232 is the DB-9
connector, which has nine pins. The pins are assigned specific functions, such as
transmit data (TXD), receive data (RXD), RTS, CTS, DTR, DSR, signal ground (SG),
and others.
▪ Advantages
o Simple and straightforward communication standard
o Longevity
o Does not require complex hardware.
▪ Disadvantages
o Limited Transmission Distance
o Devices cannot be off while the power is on
o Limited data transmission rates
o Large Connector Size and Wiring Complexity
o Power Consumption
o Limited Noise Immunity

b. RS422:
▪ Structures:
▪ Differential Signaling: RS-422 utilizes
differential signaling, where data is
transmitted as a voltage difference
between two lines.
▪ Data Transmission:
o Transmit Data Lines: RS-422
employs two transmit data lines,
commonly referred to as A+ and
B-. The transmitting device sends
data by driving the A+ line with a
positive voltage and the B- line with an equal negative voltage.
o Receive Data Lines: RS-422 also uses two receive data lines, denoted as A- and B+.
The receiving device detects the voltage difference between these lines to interpret
the transmitted data.
▪ Multiple Receivers
▪ Voltage Levels: RS-422 specifies a voltage range for the differential signals. The voltage levels
typically range from +2V to +6V for a logical "0" and -2V to -6V for a logical "1".
▪ Termination: RS-422 often requires termination resistors at the ends of the communication
line to minimize signal reflections and enhance signal quality. The termination resistors
typically match the characteristic impedance of the transmission line.
▪ Connectors: RS-422 connections commonly use DB-9 or DB-25 connectors, like RS-232.
However, the pin assignments for RS-422 connectors differ from those of RS-232 connectors.

▪ Advantages
o Long Range Communication
o Improved Noise Immunity
o Multiple Receivers
o Easy Implementation
▪ Disadvantages
o Require additional interfaces or adapters to connect RS-422 devices to many
equipments.
o Consume more power than RS-232
o Limited Number of Connections
c. RS485
▪ Structures:
o Differential Signaling: Same as
RS422
o Transmit Data Lines: employs
two transmit data lines, usually
labeled A and B. The transmitting
device drives these lines with
complementary voltages to
represent the data being sent.
▪ Receive Data Lines: RS-
485 also uses two receive data lines, denoted as A and B. The receiving
device detects the voltage difference between these lines to interpret the
transmitted data.
o Multi-Drop Network: RS-485 supports multi-drop network topologies, where
multiple devices can be connected to a single bus. Each device on the bus has a
unique address, and communication occurs through a master-slave arrangement.
o Voltage Levels: RS-485 defines a voltage range for the differential signals. A logical
"0" is represented by a positive voltage on the A line and a negative voltage on the B
line, while a logical "1" is represented by a positive voltage on the B line and a
negative voltage on the A line.
o Termination: RS-485 often requires termination resistors at the ends of the
communication line to minimize signal reflections and enhance signal quality.
o Connectors: RS-485 connections can use various types of connectors depending on
the application.
▪ Advantages
o Long-Distance Communication
o Higher Data Rates
o Multi-Drop Capability
o Balanced Transmission
o Cost-Effective Solution
o Low Power Consumption
▪ Disadvantages
o Lack of Plug-and-Play Support
o Limited Power Delivery
o Latency and Delay
V. CAN (Controller Area Network):
▪ Structures:

o Start-of-Frame (SOF): It is a synchronization field that marks the beginning of a CAN


frame. It consists of a fixed bit pattern and helps receivers to synchronize their internal
clocks.
o Arbitration Field: This field contains the identifier (ID) of the message being transmitted.
The ID determines the priority of the message. Lower ID values have higher priority, and
in case of simultaneous transmission, the node with the lowest ID wins the arbitration
process.
o Control Field: The control field includes bits that define the length of the data field (DLC)
and additional control information such as the frame type (data or remote) and error
flags.
o Data Field: This field carries the actual data being transmitted. The length of the data
field depends on the value specified in the DLC bits of the control field. It can range from
0 to 8 bytes.
o CRC Field: The cyclic redundancy check (CRC) field contains a checksum that helps detect
errors during transmission. It allows receivers to verify the integrity of the received data.
o Acknowledgment Field: After receiving a valid data frame, the receiving node sends an
acknowledgment (ACK) bit to indicate successful reception. If any node detects an error
in the frame, it sends an error frame instead.
o End-of-Frame (EOF): The EOF field signals the end of a CAN frame. It consists of several
fixed bits that complete the frame transmission.
▪ Advantages:
o High Reliability: The CAN protocol is very reliable due to its error detection and
correction mechanisms.
o Real-Time Performance: The CAN protocol is a real-time protocol, meaning that it can
meet tight timing requirements.
o Low Cost: The CAN protocol is a relatively low-cost protocol to implement.
o Flexible: The CAN protocol is a flexible protocol that can be adapted to a wide range of
applications.
o High Noise Immunity: The CAN protocol is designed to operate in noisy environments,
suitable for applications where electrical interference is prevalent, such as in automotive
and industrial settings.
o Standardized and Widely Supported: The CAN protocol is a standardized protocol,
ensuring compatibility between components from different manufacturers.
o Scalable: The CAN protocol can be scaled to support a significant number of nodes,
making it suitable for large-scale networks.
▪ Disadvantages:
o Limited Bandwidth: The CAN protocol has a maximum data rate of 1 Mbit/s, which can
be a limiting factor for applications that require high-speed data transmission.
o Non-deterministic Latency: While the CAN protocol is designed for real-time
applications, the exact latency of message delivery can vary depending on the network
load and the arbitration mechanism.
o Complex Software Implementation: The CAN protocol's software implementation can be
relatively complex, especially for applications that require sophisticated message
filtering and prioritization schemes.
o Limited Support for Multicast and Broadcast: The CAN protocol primarily supports point-
to-point communication, and its multicast and broadcast capabilities are limited.

Summary
• SPI: Suitable for applications requiring high data transmission speed, unconcerned about the
number of connecting wires, and not requiring data acknowledgment.
• I2C: A good choice for applications needing a reduction in the number of wires, supporting
multiple masters and slaves, and providing a data acknowledgment mechanism. Particularly
useful in embedded systems and microcontroller applications.
• UART: Although has multiple supported standards, without the shared clock signal → Suitable
for devices using battery or low power applications but cannot control the dataflow and limited
transmission line’s length.
• RS232: Simple, straight-forward transmission lines with high longevity. But cannot control
devices and high-power consumption.
• RS422: RS-422's range capability, noise immunity, higher data rates, and compatibility make it a
preferred choice in applications where reliable, high-speed, and noise-resistant serial
communication is required.
• RS485: RS-485's long-distance capability, multi-drop support, best noise immunity, higher data
rates, and cost-effectiveness make it a preferred choice in various industrial and commercial
applications that require reliable and robust serial communication.
• CAN: The Controller Area Network (CAN) protocol is a robust and widely used communication
protocol designed for real-time applications in the automotive, industrial automation, and
medical industries. It is characterized by its high reliability, real-time performance, low cost,
flexibility, and noise immunity.

Contacting our Project


➢ We employ the I2C communication protocol to facilitate communication between the
microcontroller and the 16x2 LCD through an I2C module.
➢ The decision to use I2C instead of SPI is based on the strengths and weaknesses of each
communication protocol mentioned above.
➢ Using RS485 to make connections between microcontroller and computer or other devices is the
best choice since it has long capability, highest noise reduction, cost-effectiveness and
compatible with our controller.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy