What communication technologies do you need to master to learn microcontroller?

7a58099a9dc3f659758749c212c3a81a.gif

Author | strongerHuang

WeChat public account | strongerHuang

Today, a reader probably asked this question: What kind of communication technical knowledge do you need to master to work on a microcontroller?

With the development of technology, there are more and more communication technologies, but in the embedded field, there are actually not many common communication technologies. UART, I²C, SPI, CAN, USB and TCP/IP are some of the most common ones.

These communication technologies are easy to say and difficult to say. Here is a brief introduction to the basic contents from the perspective of a beginner.

Common communication technologies

UART

UART: Universal Asynchronous Receiver/Transmitter, Universal Asynchronous Receiver and 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, which 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, serial peripheral interface, is a high-speed, full-duplex, synchronous communication bus.

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

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

CAN

CAN: Controller Area Network, controller area network.

CAN bus is a widely used field bus and has great application prospects in fields such as industrial measurement and control and industrial automation.

USB

USB: Universal Serial Bus, Universal Serial Bus.

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

TCP/IP

TCP/IP: Transmission Control Protocol/Internet Protocol, Transmission Control Protocol/Internet Protocol.

TCP/IP is a transmission protocol. Of course, this mainly refers to the Internet network, but TCP/IP is the most important layer of transmission protocol.

Of course, these are just common communication technologies. There are many wired and wireless communication technologies, so I won’t describe them in detail here.

communication principle

The basic communication principles of these common serial methods are not difficult, and there are many online tutorials. Here we will summarize them for you.

UART

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

UART connection method:

e5c22917e9f7adbc62e9ef5fbb3b0f4e.png

UART communication data format:

44f445658bd5f5f0b12a57d1df1ac1a4.png

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

I²C

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

I2C connection method:

75c6ca3a4f6afeb3e50d255883c26df9.png

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, 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 address + data + ACK mode, the basic data format:

11f0b8f4f178cbdf66c243dc8a42100a.jpeg

SPI

SPI is widely used and is often used as an interface bus for sending 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:

a2fd3761f5f8f0aee3baf433389e2f97.png

But SPI is also used for multi-slave communication. At this time, there will be an extra CS chip select signal line.

80b72bf036b392d2848bd03d10643a8c.png

Multi-slave wiring method:

5536a8a5c2f9e9060cff561bed8a40a7.png

Of course, there are also multi-slave devices similar to I2C, which are implemented through addressing:

f7f39ad25486f57cceba9e4fbc0f0613.png

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 the hardware and software protocols are more complex.

I won’t go into details here. You can follow the official account reply [ CANOpen Series Tutorials ], which contains detailed content about CAN from the underlying hardware, protocol, to the upper-layer software.

USB

USB is a common serial communication interface in life, mainly 4 wires (D+ D- VCC GND):

cb958f6891726e136b34feadfe0ed780.png

The D- or D+ data line on the USB device side is connected to a 1.5K ohm pull-up resistor. When the device is plugged into the PC, it will pull up the voltage at the D- or D+ terminal of the PC. When the PC detects a high level at the D- or D+ terminal, it will know that a device is inserted.

If the D- terminal of the PC is pulled high, a USB low-speed device is connected; if the D+ terminal of the PC is pulled high, a USB full-speed or high-speed device is connected. Whether it is a full-speed device or a high-speed device, will It is determined by the PC and USB device sending packets and handshaking.

4604b5811c9fbfbb1afc67996c1590ec.jpeg

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.

------------ END ------------

5f37383607b22aa53ee57bdf3f477670.gif

●Column "Embedded Tools "

●Column "Embedded Development"

●Column "Keil Tutorial"

●Embedded column selected tutorials

Follow the official account and reply " Add Group " to join the technical exchange group according to the rules, and reply " 1024 " to view more content.

06837f9c4ef4d0e03ffead2616e7c36b.jpeg

908e4551cdbe3ee3afbea70fdbfc2130.png

Click " Read the original text " to view more sharing.

Guess you like

Origin blog.csdn.net/ybhuangfugui/article/details/133108798