Comparing All Serial Communications Protocols
In this series of articles, we’ve been looking at some of the different Serial Communication Protocols available to transfer information between microcontrollers, data-producing, data-processing peripherals, and other smart devices. Each article has covered one of the more popular protocols in common usage, and here, at the end of this series, we have summarized the advantages and disadvantages of each. We hope this resource will prove valuable next time you find yourself needing to implement a serial communication bus, helping you choose the best option for your particular circumstances.
Serial communication protocols and standards are fantastic, especially with many smart digital or mixed (analog-digital) devices; incorporating microcontrollers is popular. Serial communications buses allow the exchange of information between many devices and perform this communication using a much smaller pin count than needed for parallel communications. Although serial communications are several orders of magnitude slower than the parallel option, the rates achieved are sufficient for most ICs and devices to perform the required information exchange or sending of commands.
UART is quite a simple asynchronous serial communication, which allows full-duplex mode. It is very useful for communication between two devices.
I2C is probably my favorite option. It allows many devices to be connected using just two pins. However, the more devices you connect, the more you need to reduce the data rate to maintain operation. Also, we like that the data rate can be controlled by hardware and that the slave addresses are also set by hardware.
SPI is a fast communication protocol that allows many slaves, although with an increase in the pin count. SPI communication speeds are great, and in addition to that, it does not need any special termination impedance matching. We have seen that in some applications, the use of termination resistors can be beneficial.
1-Wire is great. It allows communication and the supply of power using just one wire or trace, using a parasitic power supply technique. However, not that many devices are available that can use it.
CAN is very robust in an environment with high electromagnetic interference levels and has good error correction. It should come as no surprise that it is mostly used for critical applications.
LIN is a CAN variant, developed as a subsystem to CAN. LIN is typically used for less critical applications in cars. It is good because it is cheap and straightforward. LIN devices do not utilize quartz or resonators for timing; they only use a simple internal RC circuit to save costs.
RS-485 is a protocol standard used in many devices, especially in automation and PLC. It is a robust standard that uses one or two differential pairs. Also, it can reach relatively high speeds or long distances.
RS-232 is an old serial protocol standard that was extremely popular. Although modern devices do not use this standard anymore, vast numbers of legacy devices still use it, so we feel it will be beneficial to have some knowledge about it.