I2C, 485, 232, spi are distinguished by half duplex and full duplex

First, in terms of hardware, the electrical characteristics when transmitting data are different, such as the level states corresponding to logic 1 and 0; the timing is different.

Second, their transmission distances are different due to hardware reasons. 485 can be as long as 1500 meters, i2c and spi are also limited to the board-level distance, tens of centimeters. 232 is just over 1 meter.

Third, the transmission speed is different. The highest baud rate of 232 and 485 is 115.2K, and even higher ones are not commonly used. i2c and spi can reach dozens of M, because the distance is very short.

 

Duplex: For example, there are two devices connected to communicate, A and B. If data can only be transmitted in one direction at any time, from A to B, then it is simplex; if one time can go from A to B, and then the next time from B to A, but not both directions at the same time, it is half-duplex; if the same time Data can be sent in both directions at the same time, which is full duplex.

 

 

RS485, I2C and SPI are different.

The RS485 and I2C communication protocols contain the address of the slave. The slave does not actively send data. The master sends data. The data packet contains the address of the slave. The data sent by the master is received by all slaves. for the receiving state. After the slave receives the data packet, it detects that the address is consistent with its own address, and sends the data in response. If the address is inconsistent, it will not be processed. Therefore, the slave addresses in RS485 and I2C bus cannot be repeated.

SPI selects the slave through the chip select signal, and the slave that is not selected does not receive data.

 

RS485 common 2-wire half-duplex

 

There are four-wire full-duplex in the RS485 standard

 

RS232 is 3-wire full duplex


Whether the interface is full-duplex or half-duplex depends on how many lines it has, and at least one line for duplex transmission and reception.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325765898&siteId=291194637