| Protocol | Physical Lines | Duplex Mode | Sync/Async | Topology | Typical Application Scenarios | Key Advantages |
|---|---|---|---|---|---|---|
| 1-Wire | 1 (DQ + GND) | Half-Duplex | Asynchronous | One Master, Multiple Slaves | Identity recognition, temperature sensors | Minimal wiring, parasitic power supply |
| IIC | 2 (SDA, SCL) | Half-Duplex | Sync | Multi-Master, Multi-Slave | Onboard chip communication | Hardware addressing, fewer pins |
| SPI | 3+n (SCK, MOSI, MISO, n*CS) | Full-Duplex | Sync | One Master, Multiple Slaves | High-speed peripherals (Flash, ADC) | Very fast speed, simple protocol |
| CAN | 2 (CAN_H, CAN_L) | Half-Duplex | Asynchronous | Multi-Master | Automotive, industrial control | Reliability, anti-interference, multi-master |
| UART | 2 (TX, RX) | Full-Duplex | Asynchronous | Point-to-Point | Simple communication between devices | Simple, universal |
| RS-232 | 3 (TX, RX, GND) | Full-Duplex | Asynchronous | Point-to-Point | PC serial port, legacy devices | Mature standard |
| RS-485 | 2 (A, B) | Half-Duplex | Asynchronous | One Master, Multiple Slaves (Multipoint) | Industrial field bus | Long distance, anti-interference, networkable |
| RS-422 | 4 (Tx+, Tx-, Rx+, Rx-) | Full-Duplex | Asynchronous | One-to-Many (Single Transmit, Multiple Receive) | Long-distance point-to-point | Full-Duplex, anti-interference, high speed |
1. Single Bus (1-Wire)
1-Wire is aserial, half-duplex, asynchronous communication protocol.
Speed
- Standard mode: 15.4 kbps
- High-speed mode: 125 kbps
Start Signal
- Reset pulse + Presence pulse: Communication is always initiated by the master device. The master pulls the bus low for at least 480µs (reset pulse), then releases it. The slave device, after waiting 15-60µs, pulls the bus low for 60-240µs as a response (presence pulse), informing the master “I am online”.
Communication Timing
- Initialization: The master sends a reset pulse, and the slave replies with a presence pulse.
- ROM Command: The master sends a command (such as search ROM, match ROM, etc.) to specify the slave device to operate on.
- Function Command: The master sends a function command to the specified slave device (such as start temperature conversion, read register, etc.).
- Data Transmission: All data read/write is done intime slots. The master synchronizes the start of each time slot by generating a falling edge. Within a single time slot, either the master or the slave outputs one bit of data on the bus.
Communication Characteristics
- Advantages: Extremely simple hardware structure, very low cost, only one data line (DQ) is needed; each device has a unique ID, making addressing easy; supports parasitic power supply, simplifying wiring.
- Disadvantages: Very slow speed; strict timing requirements, sensitive to microcontroller interrupts, complex software implementation; limited bus capacitance and load capacity, restricting the number of devices and distance.
Its biggest feature is that it uses onlyone data line (DQ) to complete data and power supply (via parasitic power), with the ground line (GND) as a reference. It adopts aone master, multiple slaves structure, with each slave having a globally unique 64-bit ROM ID as its address. It is mainly used forshort-distance, low-speed, low-cost identity recognition, sensor networks (such as temperature sensor DS18B20), etc.,with good scalability, allowing multiple devices to be connected on one bus.
2. IIC (Inter-Integrated Circuit) / I²C
IIC is aserial, half-duplex, synchronous communication bus.
Speed
- Standard mode: 100 kbps
- Fast mode: 400 kbps
- High-speed mode: 3.4 Mbps
- Ultra-fast mode: 5 Mbps
Start and Stop Signals
- Start Condition (S): When SCL is high, the SDA line switches from high to low. This indicates the start of a transmission.
- Stop Condition (P): When SCL is high, the SDA line switches from low to high. This indicates the end of a transmission.
Communication Timing
- The master generates astart condition (S).
- The master sends a 7-bit/10-bitslave address frame, followed by 1 bit ofread/write control bit (0 indicates master writes, 1 indicates master reads).
- The addressed slave returns anacknowledge bit (ACK) (low level).
- Data transmission begins, with each 8-bit data frame followed by an acknowledge bit (ACK or NACK).
- After transmission is complete, the master generates astop condition (P).
Communication Characteristics
- Advantages: Few pins required (only 2 wires), supports multi-master and multi-slave, has hardware addressing and acknowledgment mechanisms, and a well-defined protocol standard.
- Disadvantages: Half-duplex, relatively low speed; pull-up resistors and bus capacitance on the bus limit the maximum speed; software implementation is complex; address conflicts may occur.
It consists of onedata line (SDA) and oneclock line (SCL). It supportsone master, multiple slaves ormulti-master modes, with each device connected to the bus having a unique 7-bit or 10-bit address. It is mainly used forshort-distance communication between board-level ICs (such as CPU and sensors, EEPROM),with good scalability, allowing easy connection of multiple slave devices.
3. SPI (Serial Peripheral Interface)
SPI is aserial, full-duplex, synchronous communication protocol.
Speed
- Very high speed, with no standard upper limit, depending on hardware performance. Typically reaches 10Mbps to 100Mbps, or even higher.
Start and Stop Signals
- No explicit start/stop packets. The start of communication is declared by the master pulling theslave select line (CS/SS) low, and the end of communication is declared by the master pulling the select line high.
Communication Timing
- The master configures clock polarity (CPOL) and phase (CPHA).
- The master pulls the target slave’sselect line (CS) low.
- The master generates clock signals (SCK).
- Under the clock drive (sampling on rising or falling edge):
- The master sends data (bits) to the slave via the MOSI line.
- The slave simultaneously sends data (bits) to the master via the MISO line.
Communication Characteristics
- Advantages: Full-duplex, extremely high communication speed; simple protocol, high hardware implementation efficiency; continuous data flow, no additional overhead (no address bits, acknowledgment bits).
- Disadvantages: Requires more pins (4 lines + 1 select line per slave); no hardware addressing mechanism, relies on chip select addressing; no hardware acknowledgment mechanism to confirm data receipt; protocol standard is relatively loose.
It adopts aone master, multiple slaves architecture, typically requiring 4 lines:<span>SCK</span> (clock), <span>MOSI</span> (Master Out Slave In), <span>MISO</span> (Master In Slave Out), <span>CS/SS</span> (chip select). Communication speed is very fast, suitable forshort-distance, high-speed data exchange scenarios (such as FLASH memory, displays, ADC). Itsscalability is managed through chip select signals (CS), with each slave device requiring a separate select line.
4. CAN (Controller Area Network)
CAN is aserial, half-duplex, asynchronous communication protocol.
Speed
- Up to 1 Mbps (within 40 meters). The longer the communication distance, the lower the speed (at 10 kilometers, the speed can drop below 50 kbps).
Start Signal
- Frame Start (SOF): A dominant bit (logic 0) that marks the start of a data frame.
Communication Timing (based on standard data frame)
- Arbitration Field: Contains an 11-bit or 29-bit identifier (ID), with smaller ID values having higher priority. When multiple nodes transmit simultaneously, non-destructive arbitration occurs through a “wired AND” mechanism, allowing the higher priority node to win bus access.
- Control Field: Contains the data length code (DLC, 0-8 bytes).
- Data Field: The actual data to be transmitted (0-8 bytes).
- CRC Field: 15-bit cyclic redundancy check code for error detection at the receiving end.
- Acknowledge Field: The sending node emits two dominant bits (1), and any node that correctly receives the frame (regardless of whether it is the target node) will emit a recessive bit (0) during the acknowledge gap.
- Frame End: 7 recessive bits (1) indicate the end of the frame.
Communication Characteristics
- Advantages: Extremely high reliability, with advanced error detection and handling mechanisms (CRC check, acknowledgment, error frames); strong anti-interference capability (differential signaling); multi-master structure, allowing any node to initiate communication; priority arbitration ensures the timeliness of high-priority information.
- Disadvantages: Complex protocol, relatively high development and hardware costs; small data payload (maximum 8 bytes); software stack usually needs to be purchased or use open-source protocol stacks (such as CANOpen).
It adopts amulti-master mode (no master-slave distinction), with all nodes being equal. It uses differential signaling (CAN_H and CAN_L) forlong-distance communication, with strong anti-interference capability. Widely used in automotive electronics, industrial automation, and other harsh environments. Access to the bus is managed through identifier (ID) arbitration, theoretically allowing up to 110 nodes to be connected,with excellent scalability.
5. UART (Universal Asynchronous Receiver/Transmitter)
UART is aserial, full-duplex, asynchronous communication protocol.
Speed
- Common baud rates: 9600, 19200, 38400, 115200, 921600 bps, etc. The speed is not fixed and depends on hardware performance, usually lower speed (generally below 1 Mbps).
Start Signal
- Start Bit: Before data transmission, the TX line is pulled low for one bit time from the high level (idle state), indicating the start of a data frame.
Communication Timing
- Idle State: The TX line remains high.
- Start Bit: 1 bit low level.
- Data Bits: 5-9 bits of data (usually 8 bits), starting from the least significant bit (LSB).
- Parity Bit (optional): 1 bit for simple error detection.
- Stop Bit: 1, 1.5, or 2 bits high level, indicating the end of a data frame.
Communication Characteristics
- Advantages: Simple hardware, requiring only two wires (excluding ground); simple protocol, easy to implement; extremely widespread application.
- Disadvantages: No clock synchronization, relies on both parties having highly consistent baud rates, otherwise error accumulation may occur; no hardware addressing mechanism, cannot be directly networked; poor anti-interference capability.
It uses two data lines (TX and RX) forpoint-to-point communication between two devices. Due to its asynchronous nature, no clock line is needed, but both parties must agree on the same baud rate in advance. It is typically used forshort-distance simple data exchange between devices, such as communication between microcontrollers and computers, Bluetooth modules, GPS modules.UART itself is a protocol and cannot directly connect multiple devices, but its physical layer standards (such as RS485) can.
6. RS-232
RS-232 is apoint-to-point, full-duplex, usingsingle-ended signaling (unbalanced transmission) serial communication physical layer standard.
Speed
- Standard speed up to 115.2 kbps (in practical applications, the longer the distance, the lower the speed). The RS-232 standard itself defines a maximum of 20 kbps.
Start Signal
- Identical to UART,start bit (low level, in RS-232 logic, is positive voltage, such as +3V to +15V).
Communication Timing
- Identical to UART, following thestart bit-data bit-parity bit-stop bit structure. The difference lies in the electrical levels.
Communication Characteristics
- Advantages: Simple, universal, a hallmark interface of the PC era.
- Disadvantages: High voltage (±3V~±15V), incompatible with modern logic levels requiring level conversion; short transmission distance (<15 meters); low speed; very poor common-mode interference immunity; point-to-point, cannot be networked.
It specifies voltage, impedance, connectors, etc. It usessingle-ended signaling (ground reference),point-to-point full-duplex communication. Communication distance is short, with weak anti-interference capability, typically used for connecting modems, legacy mice, etc. to computer serial ports (COM ports).It is essentially one of the physical layer implementations of the UART protocol.
7. RS-485
RS-485 is amultipoint, half-duplex (or full-duplex requires 4 wires), usingdifferential signaling (balanced transmission) serial communication physical layer standard.
Speed
- Maximum speed can reach 10 Mbps (at 12 meters), with distances up to 1200 meters (speed drops to 100 kbps).
Start Signal
- Identical to UART,start bit (logic 0, corresponding to A-B voltage difference being negative).
Communication Timing
- Identical to UART, with different electrical characteristics.
Communication Characteristics
- Advantages: Extremely strong anti-interference capability (differential transmission cancels common-mode noise); long transmission distance; supports multipoint networking (one master, multiple slaves); bus topology structure.
- Disadvantages: Half-duplex, requires direction switching (controlled by transceiver control pins); termination resistors must be added at both ends of the bus to eliminate signal reflections; software must implement addressing (slave address) mechanisms.
It usesdifferential signaling (A and B lines for transmission),half-duplex communication (full-duplex requires 4 wires). It supportsmultipoint bus topology, allowing one master to connect to up to 32 (or more, depending on the transceiver) slaves (one master, multiple slaves). It featureslong distance and high common-mode interference resistance, making it the foundation of industrial field buses.It is also another implementation of the UART protocol at the physical layer.
Now, let me provide a detailed introduction to the RS-422 protocol.
8. RS-422 (TIA/EIA-422)
RS-422 is apoint-to-point orone-to-many (single transmit, multiple receive), full-duplex, usingdifferential signaling (balanced transmission) serial communication physical layer standard.
Speed
- Maximum speed can reach 10 Mbps (at short distances).
- Distance can reach 1200 meters (speed drops to 100 kbps).
Start Signal
- Identical to UART,start bit (logic 0, corresponding to Tx+ voltage being lower than Tx-).
Communication Timing
- Identical to UART, following thestart bit-data bit-parity bit-stop bit structure. Its core defines the electrical characteristics of differential signaling.
Communication Characteristics
- Advantages:
- Extremely strong anti-interference capability: Uses differential transmission, effectively canceling common-mode noise, making it very suitable for noisy industrial environments.
- Long transmission distance: Much farther than RS-232.
- Full-duplex communication: Has independent sending and receiving channels, allowing simultaneous data transmission and reception without direction switching.
- High transmission speed: Typically supports higher speeds than RS-485 at the same distance.
- Disadvantages:
- Point-to-point communication: Typically can only connect one transmitter and one receiver,not supporting multipoint bus topology like RS-485. Although multiple receivers (up to 10) can be connected, onlyone transmitter is allowed.
- Higher cost: Requires 4 wires (two pairs of differential lines), with cable and connector costs higher than RS-485.
- Termination resistors required: For long-distance transmission, termination matching resistors must be added at both ends of the cable to eliminate signal reflections.
It usesdifferential signaling, employing two independent twisted pairs for transmission and reception (a total of 4 wires: Tx+, Tx-, Rx+, Rx-), achievingfull-duplex communication. It is mainly used forlong-distance, high-noise environmentpoint-to-point high-speed data communication, often serving as an extension and enhancement of RS-232. Itsscalability is relatively poor, not suitable for connecting multiple transmitting devices.
If there are any shortcomings in the summary or any issues, please feel free to point them out!