Let's talk about the basic principles of common serial communication

Let's talk about the basic principles of common serial communication

Why do we need to talk about serial communication? Because parallel communication is relatively rare nowadays, and basically all communication is serial communication.

Today I will give you a brief introduction to common serial communications and related basic principles, including: UART, I²C, SPI, CAN, USB, etc.

1 Basic Concepts

UART

UART: Universal Asynchronous Receiver/Transmitter.

USART: Universal Synchronous/Asynchronous Receiver/Transmitter, universal synchronous/asynchronous serial receiver/transmitter.

USART can be understood as a two-in-one communication interface of UART and USRT, one is synchronous communication and the other is asynchronous communication.

I²C

I²C: Inter-Integrated Circuit, literally means between integrated circuits. It is actually the abbreviation of I²C Bus, so it should be called integrated circuit bus in Chinese. It is a serial communication bus.

SPI

SPI: Serial Peripheral Interface, a high-speed, full-duplex, synchronous communication bus.

QSPI is the abbreviation of Queued SPI, which is an extension of the SPI interface launched by Motorola and is more widely used than SPI.

QSPI adds a queue transmission mechanism to the SPI protocol. The transmission process does not require CPU intervention, which greatly improves the transmission efficiency.

CAN

CAN: Controller Area Network.

CAN bus is a widely used field bus with great application prospects in industrial measurement and control and industrial automation.

USB

USB: Universal Serial Bus.

USB is an external bus standard used to regulate the connection and communication between computers and external devices. It is an interface technology used in the PC field.

2 Communication Principles

The basic communication principles of these common serial methods are not difficult, and there are many tutorials online. I will integrate them here for you.

UART

UART communication is generally 3-wire, of course there is also a single-wire half-duplex mode.

UART connection method:

UART communication data format:

For more details in this section, please refer to the serial communication chapter in "Communication Tutorial 01".

I²C

I²C is a serial synchronous communication method, generally a 2-wire (SDA data line, SCL clock line), one master and multiple slaves communication method.

I2C connection method:

SDA (serial data line) and SCL (serial clock line) are both bidirectional I/O lines, and the interface circuit is an open-drain output. It needs to be connected to the power supply VCC through a pull-up resistor. When the bus is idle, both lines are high level, and the external devices connected to the bus are all CMOS devices, and the output stage is also an open-drain circuit. The current consumed on the bus is very small.

I2C is generally in the address + data + ACK mode, the basic data format is:

SPI

SPI is a very common interface bus used to send data between microcontrollers and small peripherals such as shift registers, sensors, and SD cards.

SPI communication mainly uses 3 lines (SCK, MOSI, MISO) for communication:

However, SPI is also used for multi-slave communication. In this case, an additional CS chip select signal line will be added.

Multiple slave connection method:

Of course, there are also similar I2C multi-slave, which is achieved through addressing:

The SPI communication protocol is much simpler than I2C and does not require excessive data processing.

CAN

CAN communication is a more complex local area network than the previous three, both in terms of hardware and software protocols.

I won’t go into detail here. You can follow the official account and reply [CANOpen series tutorial], which contains detailed information about CAN from the underlying hardware, protocol to the upper-level software.

USB

USB is a common serial communication interface in life, with 4 main lines (D+ D- VCC GND):

The D- or D+ data line on the USB device is connected to a 1.5K ohm pull-up resistor. When the device is plugged into the PC, the voltage on the D- or D+ end of the PC will be pulled up. When the PC detects a high level on the D- or D+ end, it knows that a device has been plugged in.

If the D- terminal of the PC is pulled high, the connected device is a USB low-speed device; if the D+ terminal of the PC is pulled high, the connected device is a USB full-speed or high-speed device. Whether it is a full-speed device or a high-speed device will be determined by the packet handshake between the PC and the USB device.

USB transmission speeds include: low speed 1.5Mbps (USB1.0 protocol), full speed 12Mbps (USB1.1 protocol), high speed 480Mbps (USB2.0 protocol), ultra high speed 5Gbps (USB3.0 protocol), etc.


<<:  The big "snowflake" light show at the opening ceremony of the Winter Olympics was foolproof, and it was LoRa that ensured it!

>>:  The three major operators did not learn their lesson and announced that 5G messages would be charged. Has WeChat got a new opportunity?

Recommend

5G may disappoint consumers because it has no other advantages except fast speed

Less than four years after the issuance of 4G lic...

...

Hostodo October Promotion: $45/year KVM-3GB/30G NVMe/5TB/three computer rooms

Hostodo has launched the Spooky October Sale, off...

.com domain prices expected to rise for first time in eight years

According to foreign media reports, ICANN, the or...

GSA report: Global application status of LTE and 5G in Sub 1GHz spectrum

GSA released a report that believes that the freq...

5G RedCap: New Cellular IoT Technology Optimization

The latest version of the 3GPP standard for mobil...

What is the environmental impact of 5G and how will it impact the world?

In recent years, commercial real estate owners ha...

5G in 2021: Expectations and Developments

5G is the fastest growing mobile technology in hi...

Is the integrated air-space-ground information network really coming?

[[408522]] In recent years, with the popularizati...