Understanding UART, SPI, and I2C Communication Protocols

Understanding UART, SPI, and I2C Communication Protocols

UART, SPI, and I2C are common serial communication methods in embedded development. The underlying communication principles are not difficult, but many beginners struggle to learn them.

Today, I will share some common low-level data transmission principles of these communication protocols.

1 UART Serial Communication

UART: Universal Asynchronous Receiver/Transmitter.
The UART interface is the most commonly used serial communication method. Below is an animation showing the connection of a serial port to a host computer, along with the application of RS232.
Understanding UART, SPI, and I2C Communication Protocols
▲ Debugging MCU via UART on PC
Understanding UART, SPI, and I2C Communication Protocols
▲ RS-232 communication with MCU through level conversion chip

2 SPI Serial Communication

SPI: Serial Peripheral Interface.
SPI is a common synchronous serial communication protocol that is widely used.
Below is the timing diagram for SPI data transmission:
Understanding UART, SPI, and I2C Communication Protocols
▲ SPI Data Transmission (1)
Understanding UART, SPI, and I2C Communication Protocols
▲ SPI Data Transmission (2)
Understanding UART, SPI, and I2C Communication Protocols
▲ SPI Timing Signals

3 I²C Communication

I²C: Inter-Integrated Circuit, which literally means between integrated circuits, commonly referred to as I²C Bus.

I²C mainly distinguishes and identifies slave devices through addresses, and its communication principle is relatively simple.

Understanding UART, SPI, and I2C Communication Protocols
▲ I2C Bus and Addressing Method

4 Infrared Remote Control

Infrared remote control is quite common in our daily lives; most household remote controls use infrared.

Infrared remote control communicates by controlling pulse width (the duration of high and low levels) and establishes a communication link through infrared wireless signals (it cannot work if blocked, but can reflect).

Understanding UART, SPI, and I2C Communication Protocols
▲ Infrared control signal is also a serial communication signal
Understanding UART, SPI, and I2C Communication Protocols
▲ Infrared signal receiving and amplification circuit
Understanding UART, SPI, and I2C Communication Protocols
▲ A circuit using infrared receiving photodiode to control a relay for fish feeding

5 Serial to Parallel Conversion Circuit

Serial to parallel conversion means converting serial data into parallel data. Serial data is transmitted bit by bit under clock control, and when it gathers into a whole (8 bits), it becomes one parallel data.

There are many ready-made chips for this type of converter, and the principle is very simple.

Understanding UART, SPI, and I2C Communication Protocols

▲ Shift register with serial input and parallel output

Understanding UART, SPI, and I2C Communication Protocols
▲ Shift register composed of eight D flip-flops
Understanding UART, SPI, and I2C Communication Protocols
▲ Serial Transmission Schematic

6 Others

Here are some other principles of serial transmission (waveforms):

Understanding UART, SPI, and I2C Communication Protocols
▲ PWM control of LED brightness
Understanding UART, SPI, and I2C Communication Protocols
▲ PWM control of LED brightness
Understanding UART, SPI, and I2C Communication Protocols
▲ Amplitude Modulation and Frequency Modulation Signals
Understanding UART, SPI, and I2C Communication Protocols
▲ Phase Modulation Signal
Understanding UART, SPI, and I2C Communication Protocols
▲ Square Wave Edge Jitter Waveform
Disclaimer: The materials in this article are sourced from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact me for removal.
Understanding UART, SPI, and I2C Communication Protocols
END
Previous Hot Articles Review
Why Russia’s Domestic Chips Do Not Collaborate with China?
Why Luo Yonghao Lacks the Courage to Make Phones Again, Preparing to Enter This Industry

The First Batch of Whitelisted Companies for Resuming Work in Shanghai

Does Arm Architecture Cause Android Phones to Overheat?

Why Does Your Chip Tape-Out Fail?

Review Center

Understanding UART, SPI, and I2C Communication Protocols

Understanding UART, SPI, and I2C Communication Protocols

Press and hold the image to scan for free

Understanding UART, SPI, and I2C Communication Protocols
Understanding UART, SPI, and I2C Communication Protocols
Share
Understanding UART, SPI, and I2C Communication Protocols
Collect
Understanding UART, SPI, and I2C Communication Protocols
Like
Understanding UART, SPI, and I2C Communication Protocols
View

Leave a Comment