0% found this document useful (0 votes)
7 views9 pages

Appendix On Communication Standards

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 9

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

School of Electrical and Electronic Engineering


Department of Automation Engineering

EMBEDDED CONTROL SYSTEM

Appendix on communication protocol.

Instructor: Chu Duc Viet

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

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
Summary......................................................................9
Contacting our Project..................................................9
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 Asynchoronus 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 (Reccommended 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
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.

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