1 PPPP
1 PPPP
Volume 81 (2024)
1. Introduction
In the ever-evolving landscape of modern communication systems, communication protocols have
assumed a progressively integral role within the realm of communication technology. The primary
focus of this investigation centers on three prevalent communication protocols: UART, I2C, and SPI,
which find extensive application within the domain of measurement and control instruments. These
protocols serve as pivotal conduits for data transmission and hold widespread relevance in critical
domains, including embedded systems. To cater to the diverse demands of various application
environments, it becomes imperative to contemplate a spectrum of factors, encompassing not just
performance and stability, but also energy efficiency, system intricacy, and related considerations [1].
In the field of measurement and control instruments, UART, I2C and SPI are widely used by
engineers as the main communication protocols. They allow reliable data transmission between
devices and promote interoperability between hardware components. They are used for serial
communication, peripheral connection, sensor control and other scenarios. They are the core
communication mode of embedded systems. As a common communication protocol, they are widely
used in electronic devices and embedded systems, promoting interoperability between hardware
components and being the core communication mode of embedded systems. However, the
performance of different communication protocols in different application scenarios has its own
advantages and disadvantages, so it is necessary to deeply compare the performance characteristics
of different communication protocols to ensure the optimal pairing of communication protocols and
application scenarios.
This study expects to find out the differences between UART, I2C and SPI communication
protocols in terms of performance, data transmission rate and system complexity, summarize the
applicability of the three communication protocols in different application scenarios, and provide
system comparison and selection guidelines for measurement and control instrument designers.
540
Highlights in Science, Engineering and Technology EMIS 2023
Volume 81 (2024)
541
Highlights in Science, Engineering and Technology EMIS 2023
Volume 81 (2024)
Fig. 1 SDA and SCL conditions to start and stop transmission signals [7]
The selected device responds to the master controller and, with the aid of a clock signal, transmits
data over the data line. The master controller can choose to read or write more data, sending a stop
condition to end the communication if needed. If there are other devices that require communication,
the master controller can resend the start condition and select another device.
3. Verilog simulation
3.1. Experimental principle
3.1.1 UART communication protocol experimental principle
The loop module is used to generate enable signals and data, and then send data cyclically
according to the busy status of the serial port sending module. Its inputs include the sending enable
signal and data to be sent, as well as the sending status of the serial port sending module. The module's
output includes the serial transmit port [8].
In the UART communication protocol simulation, the sending module is used to receive the data
to be sent and the sending enable signal, control the clock according to the baud rate, send data bit by
bit and generate start bits and stop bits to realize UART sending. The output of this module includes
the serial port sending port and sending status flag [9].
The receiving module receives data from the UART receiving port and detects the start bit, count
data bit and stop bit, and finally outputs the received data and reception completion flag. The inputs
to this module include the UART receive port, while the outputs include the receive completion flag,
receive data, and other control signals related to the receive process. The top-level module is used to
integrate different UART modules and realize UART data loopback. Inputs to this module include
the external system clock, system reset signal, and UART receive port.
542
Highlights in Science, Engineering and Technology EMIS 2023
Volume 81 (2024)
543
Highlights in Science, Engineering and Technology EMIS 2023
Volume 81 (2024)
544
Highlights in Science, Engineering and Technology EMIS 2023
Volume 81 (2024)
In addition, since SDA will transition from low to high when SCL is at a high level, the stop signal
is a level transition timing signal rather than a level signal. The performance comparison and
applicable scenarios is shown in table 1.
Table 1. Performance comparison and applicable scenarios
UART SPI I2C
Speed Low High Medium
Pin Two wires Multi-line Two wires
Support multiple slave Support multiple slave
Peer Peer to peer
devices devices
Hardware
Simple Complex Medium
complexity
Distance Long Short Short
Mode Simplex or duplex Full duplex Simplex or duplex
1. High speed data
1. Multi-slave device
1. Long distance transmission.
Application communication.
communication. 2. Memory interface.
scenarios 2. Low power
2. simple sensor 3. Multi-sensor
applications
configuration
The parameters such as the transmission distance set in the experiment are feasible under ideal
circumstances. In practice, problems such as line length limitations, peer equipment configuration
limitations, and transmission errors may be faced. It needs to be measured and verified on the board
to solve it.
4. Conclusion
In summary, this study conducts a multi-faceted comparison and evaluation of UART, I2C and
SPI communication protocols, providing important reference and guidance for designers of
measurement and control instruments. Based on our experimental results and analysis, the following
conclusions can be drawn.
First of all, the UART communication protocol has good stability and reliability. Therefore, the
UART communication protocol is an ideal choice for applications that require stable long-distance
data transmission, especially for simple sensor applications.
Secondly, the SPI communication protocol has excellent performance in applications with large-
scale data transmission or fast response. Therefore, in the design of high-demand measurement and
control instruments, the SPI communication protocol should be highly valued and widely used in
high-speed data transmission, memory interfaces and multi-sensor configuration.
The I2C communication protocol excels in multi-slave communication and low-power
applications, making it the first choice for connecting multiple peripherals or sensors. In a multi-
sensor configuration, the capability of the I2C communication protocol can enable collaborative work
between different sensors and provide more information to the system.
The above conclusions may help designers of measurement and control instruments choose
communication protocols in different application scenarios and help optimize system performance
and complexity. It is hoped that this research can provide valuable guidance for future measurement
and control instrument design and promote the continuous development and progress of measurement
and control instrument technology.
References
[1] Zou L, Wang Z, Hu J, et al. Communication-protocol-based analysis and synthesis of networked systems:
Progress, prospects and challenges. International Journal of Systems Science, 2021, 52(14): 3013-3034.
545
Highlights in Science, Engineering and Technology EMIS 2023
Volume 81 (2024)
[2] Shi Wenqi, Gan Yujing, & Huang Guangming. Data acquisition IP core design based on NanEye 2D
miniature image sensor. China Medical Equipment, 2019, 4(9): 55-58.
[3] Ingaleshwara S S. Heterogeneous architecture for reversible watermarking system for medical images
using Integer transform based Reverse Contrast Mapping[J]. Turkish Journal of Computer and
Mathematics Education (TURCOMAT), 2021, 12(6): 308-315.
[4] H. Kareem and D. Dunaev. The Working Principles of ESP32 and Analytical Comparison of using Low-
Cost Microcontroller Modules in Embedded Systems Design. 2021 4th International Conference on
Circuits, Systems and Simulation (ICCSS), Kuala Lumpur, Malaysia, 2021: 130-135.
[5] Dinesh Sheoran. Assistant Professor, Department of ECE, MSIT, C-4, Janakpuri, New Delhi, India.
Universal asynchronous receiver transmitter. 2020: 36-38.
[6] Wang Zhuangpeng, Xiao Bing, Liu Luoshi, & Ou Ben. Battery management system communication
method based on I2C bus. Applied Science and Technology. 2020, 47(2): 48-52.
[7] C. Liu, Q. Meng, T. Liao, X. Bao and C. Xu. A Flexible Hardware Architecture for Slave Device of I2C
Bus. 2019 International Conference on Electronic Engineering and Informatics (EEI), Nanjing, China,
2019, pp. 309-313.
[8] Peña E, Legaspi M G. Uart: A hardware communication protocol understanding universal asynchronous
receiver/transmitter. Visit Analog, 2020, 54(4).
[9] Sharma P, Kumar A, Kumar N. Analysis of UART Communication Protocol. 2022 International
Conference on Edge Computing and Applications (ICECAA). IEEE, 2022: 323-328.
[10] Trivedi D, Khade A, Jain K, et al. Spi to i2c protocol conversion using verilog. 2018 Fourth International
Conference on Computing Communication Control and Automation (ICCUBEA). IEEE, 2018: 1-4.
[11] Rekha S, Reshma B, Dilipkumar N P, et al. Logically Locked I2C Protocol for Improved Security.
International Conference on Communication, Computing and Electronics Systems: Proceedings of
ICCCES 2019. Springer Singapore, 2020: 707-716.
546