Source: CSDN: https://blog.csdn.net/an520_/article/details/125479812, copyright belongs to the author, please contact for removal! Because it is a good article, I hope to share it with more people!
UART, SPI, I2C and other serial communications are very common communication methods in embedded development. The underlying communication principles of these protocols are actually not difficult, but many beginners struggle to understand them.
Today, I will share some common underlying data transmission principles of these communication methods.
1. UART Serial Port
UART: Universal Asynchronous Receiver/Transmitter. The UART serial port is the most common type of serial communication. Below is an animation of the serial port connection to a host computer and RS232 application.
▲ Debugging MCU via UART on PC
▲ RS-232 communication with MCU through level conversion chip
2. SPI Serial Communication
SPI: Serial Peripheral Interface. SPI is a common serial synchronous communication protocol, widely used in various applications.
Below is the timing diagram for SPI data transmission:
▲ SPI Data Transmission (1)
▲ SPI Data Transmission (2)
▲ SPI Timing Signal
3. I²C Communication
I²C: Inter-Integrated Circuit. The term literally means communication between integrated circuits, abbreviated as I²C Bus. I²C mainly distinguishes slave devices through addressing, and its communication principle is relatively simple.
▲ I2C Bus and Addressing Method
4. Infrared Remote Control
Infrared remote controls are quite common in our daily lives, as most household remote controls are infrared. Infrared remote control achieves communication 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).
Infrared remote controls are quite common in our daily lives, as most household remote controls are infrared. Infrared remote control achieves communication 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).
▲ Infrared control signal is also a serial communication signal
▲ Infrared signal receiving and amplification shaping circuit
▲ A circuit using an infrared receiver to control a relay for fish feeding
5. Serial to Parallel Conversion Circuit
Serial to parallel conversion means converting serial data into parallel data, controlled by a clock to transmit serial data bit by bit, assembling (8 bits) into one parallel data. There are many ready-made chips for this type of converter, and the principle is very simple.
▲ Serial In, Parallel Out Shift Register
▲ Shift Register composed of eight D flip-flops
▲ Serial Transmission Schematic
6. Others
Here are some other principles of serial transmission (waveforms):
Here are some other principles of serial transmission (waveforms):
▲ PWM Control of LED Brightness
▲ PWM Control of LED Brightness
▲ Amplitude Modulation and Frequency Modulation Signals
▲ Phase Modulation Signal
▲ Square Wave Edge Jitter Waveform