Buses, buses, they always trap you inside. All the signals in the world are the same, but there are thousands of buses, which can be quite a headache.
In general, there are three types of buses: internal buses, system buses, and external buses. The internal bus is used for interconnecting peripheral chips and the processor within a microcomputer; the system bus is for interconnecting plug-in boards with the system board in a microcomputer; the external bus connects the microcomputer with external devices, allowing the microcomputer to exchange information and data with other devices, facilitating interconnection at the device level.
In addition to buses, there are also some interfaces that are a collection of various buses, or can be said to accept anything.
SPI (Serial Peripheral Interface): A synchronous serial bus method proposed by MOTOROLA. A high-speed synchronous serial port. 3-4 wire interface, independent transmission and reception can occur simultaneously.
Due to its powerful hardware capabilities, it is widely used in intelligent instruments and measurement and control systems composed of microcontrollers. If speed is not a high requirement, using the SPI bus mode is a good choice. It can save I/O ports, increase the number of peripherals, and improve system performance. The standard SPI bus consists of four lines: Serial Clock Line (SCK), Master Input/Slave Output Line (MISO), Master Output/Slave Input Line (MOSI), and Chip Select Signal (CS). Some SPI interface chips may have an interrupt signal line or may not include MOSI.
SPI bus consists of three signal lines: Serial Clock (SCLK), Serial Data Output (SDO), and Serial Data Input (SDI). The SPI bus can connect multiple SPI devices. The SPI device providing the SPI serial clock is called the SPI master, while other devices are referred to as SPI slaves. Full-duplex communication can be achieved between master and slave devices, and when there are multiple slave devices, an additional slave select line can be added. If simulating the SPI bus with general I/O ports, one output port (SDO), one input port (SDI), and another port depending on the type of device being implemented are required. If implementing a master-slave device, input and output ports are necessary; if only a master device is implemented, only an output port is needed; if only a slave device is implemented, only an input port is sufficient.
I2C (Inter-Integrated Circuit): A two-wire serial bus developed by PHILIPS for connecting microcontrollers and their peripheral devices.
The I2C bus transmits information between the bus and devices using two lines (SDA and SCL), enabling serial communication between microcontrollers and external devices, or bidirectional data transfer between master and slave devices. I2C is open-drain output, and most I2C configurations are two-wire (clock and data), generally used for transmitting control signals.
I2C is a multi-master bus, so any device can operate as a master and control the bus. Each device on the bus has a unique address, and depending on their capabilities, they can function as transmitters or receivers. Multiple microcontrollers can coexist on the same I2C bus.
UART: Universal Asynchronous Receiver Transmitter, completing bidirectional communication at standard baud rates, but relatively slow.
The UART bus is asynchronous, thus generally more complex than the previous two synchronous serial structures, typically consisting of a baud rate generator (the generated baud rate is 16 times the transmission baud rate), a UART receiver, and a UART transmitter, with two lines for hardware, one for sending and one for receiving.
UART is a chip used for controlling communication between computers and serial devices. It’s important to note that it provides an RS-232C data terminal equipment interface, allowing computers to communicate with modems or other serial devices using the RS-232C interface. As part of the interface, UART also provides the following functionalities:
Convert parallel data sent from the computer into an output serial data stream. Convert serial data from external sources into bytes for internal use by devices that utilize parallel data. Insert parity bits into the output serial data stream and perform parity checks on incoming data streams from external sources. Add start and stop markers to the output data stream and remove them from the received data stream. Handle interrupt signals from devices like keyboards or mice (which are also serial devices). Manage synchronization issues between the computer and external serial devices. Some high-end UARTs also provide input and output data buffers; the newer UART, 16550, can store 16 bytes of data in its buffer before the computer needs to process it, while the typical UART is 8250. If you purchase a built-in modem today, it typically contains a 16550 UART.
Comparison of SPI, I2C, and UART
Both SPI and I2C are communication methods for short distances, facilitating communication between chips or between chips and other components like sensors. SPI and I2C are used for on-board communication; I2C can sometimes facilitate inter-board communication, but typically over short distances, such as in some touch screens or mobile LCD screens where many thin film connections utilize I2C. I2C can replace standard parallel buses, connecting various integrated circuits and functional modules. I2C is a multi-master bus, allowing any device to act as a master and control the bus. Each device on the bus has a unique address, and depending on their capabilities, they can function as transmitters or receivers. Multiple microcontrollers can coexist on the same I2C bus, and both lines operate at low speeds.
In contrast, UART is used for communication between two devices, such as between a microcontroller-based device and a computer. This type of communication can occur over longer distances. UART operates at higher speeds than the aforementioned two, reaching up to around 100K, and is used for communication between computers and devices or between computers and other computers, although the effective range is limited to about 10 meters. The advantages of UART include broad support and a simple programming structure, but with the development of USB, UART has gradually declined.
I2S (Inter-IC Sound Bus) is a bus standard established by Philips for audio data transmission between digital audio devices.
I2S typically consists of three lines (in addition to clock and data, there is also a left/right channel selection signal), and is primarily used to transmit audio signals, commonly found in devices like STBs, DVDs, and MP3 players.
The I2S standard specifies both hardware interface specifications and the format of digital audio data. I2S has three main signals: 1) Serial Clock SCLK, also known as Bit Clock (BCLK), which corresponds to each bit of digital audio data; SCLK has one pulse for each bit. The frequency of SCLK = 2 × sampling frequency × number of sampling bits. 2) Frame Clock LRCK (also called WS), used to switch between left and right channel data. LRCK is “1” when transmitting left channel data and “0” when transmitting right channel data. The frequency of LRCK equals the sampling frequency. 3) Serial Data SDATA, which represents audio data in binary two’s complement format.
Sometimes, to better synchronize between systems, an additional signal MCLK, known as the master clock or system clock (Sys Clock), may be transmitted, which is 256 or 384 times the sampling frequency.
GPIO (General Purpose Input Output) or bus expander simplifies the expansion of I/O ports using standard industrial I2C, SMBus, or SPI interfaces.
When a microcontroller or chipset does not have enough I/O ports, or when the system needs to employ remote serial communication or control, GPIO products can provide additional control and monitoring functions. Each GPIO port can be individually configured as input or output via software. Maxim’s GPIO product line includes GPIOs ranging from 8 to 28 ports, offering push-pull output or open-drain output. They come in a compact 3mm x 3mm QFN package.
Advantages of GPIO (Port Expander):
Low Power: GPIO consumes very low power (approximately 1μA, while μC operates at 100μA).
Integrated IIC Slave Interface: GPIO has a built-in IIC slave interface, allowing it to operate at full speed even in standby mode.
Small Package: GPIO devices provide the smallest package size—3mm x 3mm QFN!
Low Cost: You don’t pay for unused features!
Quick Market Launch: No need to write extra code, documentation, or maintenance work!
Flexible Lighting Control: Built-in multiple high-resolution PWM outputs.
Predefined Response Time: Shorten or determine the response time between external events and interrupts.
Better Lighting Effects: Matched current output ensures uniform display brightness.
Simple Wiring: Only 2 IIC lines or 3 SPI lines are needed.
SDIO
SDIO is an extended interface of the SD type, which can connect not only SD cards but also devices supporting the SDIO interface; the port is not limited to just storage cards. Devices such as PDAs, laptops, etc., that support the SDIO interface can connect to GPS receivers, Wi-Fi or Bluetooth adapters, modems, LAN adapters, barcode readers, FM radios, TV receivers, RFID readers, or digital cameras that use the SD standard interface.
The SDIO protocol evolved from the SD card protocol, retaining many aspects of the SD card’s read/write protocol while adding CMD52 and CMD53 commands on top of the SD card protocol. As a result, a key difference between the SDIO and SD card specifications is the addition of a low-speed standard, aimed at supporting low-speed I/O capabilities with minimal hardware requirements. Low-speed cards support applications such as modems, barcode scanners, and GPS receivers. High-speed cards support network cards, TV cards, and “combo” cards, which refer to memory + SDIO.
Another significant difference between SDIO and SD card specifications is the addition of a low-speed standard. SDIO cards only require SPI and 1-bit SD transmission mode. Low-speed cards aim to support low-speed I/O capabilities with minimal hardware costs, supporting applications like MODEM, barcode scanners, and GPS receivers. For combo cards, full-speed and 4BIT operations are mandatory for both the card’s memory and SDIO sections.
In non-combo SDIO devices, the maximum speed is only up to 25M, while combo cards can achieve speeds higher than 25M, similar to the maximum speeds of SD cards.
CAN
CAN, short for “Controller Area Network,” is one of the most widely used field buses internationally. Initially, CAN was designed for microcontroller communication in automotive environments, facilitating information exchange between various electronic control units (ECUs) in vehicles, forming an automotive electronic control network. For example, engine management systems, transmission controllers, instrument equipment, and electronic backbone systems all embed CAN control devices.
In a single network constructed by CAN bus, theoretically, countless nodes can be connected. In practical applications, the number of nodes is limited by the electrical characteristics of the network hardware. For instance, when using the Philips P82C250 as the CAN transceiver, up to 110 nodes are allowed on the same network. CAN can provide data transmission rates of up to 1Mbit/s, making real-time control very easy. Additionally, the hardware error detection capabilities enhance CAN’s resistance to electromagnetic interference.
Characteristics of CAN Bus:
1) It can operate in a multi-master mode, allowing any node on the network to actively send information to other nodes at any time, without distinguishing between master and slave, making communication flexible.
2) Nodes on the network can be categorized into different priority levels, meeting various real-time requirements.
3) It employs a non-destructive bit arbitration bus structure mechanism, where if two nodes transmit information simultaneously, the node with the lower priority will actively stop sending data, while the higher priority node continues transmitting without interruption.
4) It supports point-to-point, one-to-many, and global broadcast data transmission methods.
5) The maximum direct communication distance can reach up to 10km (at speeds below 4Kbps).
6) The maximum communication rate can reach 1MB/s (with the longest distance being 40m).
Finally, after discussing these tongue-twisting terms, the question is: do you understand them?
-End-
「If it’s useful, spread it」
Copyright notice: The article is reprinted from the internet, and the copyright belongs to the original author. If there is any infringement, please contact us for removal!
Click below“Hardware Engineer”to follow, choose“Top/Star the Public Account”
Technical content delivered promptly
👇

-
Transitioning from hardware to software requires caution!
-
What circuit implements the key functions of a television remote?
-
What knowledge is needed to start building a microcontroller from scratch? Some users: I’ve given up.
-
A new soldering technique has emerged, this soldering technology is eye-opening…
-
Hardware Bible: 50 commonly used circuit diagrams!
