Differences between SPI, I2C, and UART serial bus protocols

Source: Internet
Author: User
Tags sdo

The first difference is of course the name:
SPI (serial peripheral interface: serial peripheral interface );
I2C (Inter IC Bus)
UART (Universal Asynchronous Receiver Transmitter: Universal asynchronous transceiver)

Second, the difference lies in the electrical signal line:
The SPI bus consists of three signal lines: sclk, SDO, and SDI ). The SPI bus allows multiple SPI devices to connect to each other. The SPI device that provides the SPI serial clock is the SPI host or master, and other devices are the SPI slave or slave ). Full duplex communication can be achieved between the master and slave devices. When there are multiple slave devices, you can also add a select line from the device.
If you use a general IO port to simulate the SPI bus, you must have an output port (SDO), one input port (SDI), and the other port depends on the type of the implemented device, if you want to implement a Master/Slave Device, You need to input the output port. If you want to implement only the master device, you need to output the port. If you want to implement only the slave device, you only need to input the port.

I2C bus is a two-way, two-line (SCL, SDA), serial, multi-master interface standard, with bus arbitration mechanism, it is ideal for close-range and non-regular data communication between devices. In its protocol system, the device address of the target device is always included during data transmission. Therefore, devices can be networked.
If you use a general IO port to simulate I2C bus and implement bidirectional transmission, you need an input/output port (SDA) and an output port (SCL ). (Note: I2C data is rarely known, and the description here may be incomplete)

The UART bus is an asynchronous serial port. Therefore, the structure of the two synchronous serial ports is much more complicated than that of the first synchronous serial ports. Generally, it is generated by the baud rate generator (the baud rate is 16 times the Transmission baud rate) UART Receiver, UART transmitter, hardware consists of two wires, one for sending, one for receiving.
Obviously, if a universal IO port is used to simulate the UART bus, an input port and an output port are required.

Third, we can see from the second point that SPI and UART can achieve full duplex, but I2C is not;

Fourth, let's take a look at the opinions of the ox!
Wudanyu: less I2C lines. I think it is more powerful than uart and SPI, but it is more technically troublesome because I2C requires bidirectional Io support and the pull-up resistance is used, I think the anti-interference capability is weak. It is generally used for communication between chips on the same board, and rarely for long-distance communication. SPI implementation is simpler. UART requires a fixed baud rate, that is, the two-digit data interval must be equal, while SPI does not matter because it has a clock protocol.
Quickmouse: the speed of I2C is a little slower than that of SPI. The protocol is a little more complex than SPI, but the connections are also less than standard SPI.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.