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 ConceptsUARTUART: 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²CI²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. SPISPI: 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. CANCAN: Controller Area Network. CAN bus is a widely used field bus with great application prospects in industrial measurement and control and industrial automation. USBUSB: 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 PrinciplesThe basic communication principles of these common serial methods are not difficult, and there are many tutorials online. I will integrate them here for you. UARTUART 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²CI²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: SPISPI 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. CANCAN 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. USBUSB 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. |
Less than four years after the issuance of 4G lic...
CUBECLOUD has launched a promotional activity cal...
Hostodo has launched the Spooky October Sale, off...
According to foreign media reports, ICANN, the or...
GSA released a report that believes that the freq...
ZheyeIO has released a 2020 year-end promotion pl...
[51CTO.com original article] On October 24, CERNE...
Without any warning, the COVID-19 pandemic forced...
The latest version of the 3GPP standard for mobil...
Preface: As a chilled water system with centraliz...
In recent years, commercial real estate owners ha...
This month, ZJI launched a new server cluster in ...
5G is the fastest growing mobile technology in hi...
[[408522]] In recent years, with the popularizati...