Click the card above to follow for more information
1. Why Do We Prefer Serial Communication?
When working on microcontroller products, the most commonly used method is serial communication. For any microcontroller peripherals, those with serial port functionality are prioritized, such as Bluetooth modules, WIFI modules, 4G modules, electric meters, and displays.
Click the image for a detailed introduction to serial ports
Both parties agree on the same speed, for example, 115200bps, and send data in this packet form, sending 8 bits at a time, which is one byte of data.
2. Disadvantages of Serial Communication
3. Only supports one-to-one communication, cannot do one-to-many communication.
Therefore, to address these shortcomings, we need to adopt other methods to compensate for the deficiencies of serial communication.
3. RS232, RS485, and SPI Communication
3.1. RS232 and RS485
As I mentioned earlier, when the distance between the microcontroller and peripherals is short, communication can proceed normally. However, if we need to transmit data over long distances, it is easily affected by interference, leading to communication anomalies. This is where humans have ingeniously invented RS232 and RS485 communication.
-
RS232 communication can reach a distance of about 30m;
-
RS485 can ideally exceed 1000m in communication distance, and multiple loads can be connected to the 485 bus.
Click the image for a detailed introduction to RS485
Typically, the maximum baud rate for serial communication is 115200.
If there is no parity bit, it should be divided by 10 to get the bytes per second:115200÷10= 11520 (bytes/second). Then divide by 1024 to get the KB per second:11520÷1024=11.25 (KB/second).
If there is a parity bit, it should be divided by 11 to get the KB per second: 115200÷11÷1024= 10.27 (KB/second).
Thus, the speed of serial communication is quite slow. The reason for this slowness is that early microcontrollers had relatively low frequencies and clock precision, so the baud rates of both communicating parties could not be completely consistent; too high a speed would lead to communication anomalies.
3.2. SPI
By adding a clock signal between both communicating parties, we do not need to agree on the same speed; we only need to send and receive data based on the rising edge of the clock signal, greatly increasing the communication speed. This led to the development of SPI communication, which can easily exceed 10M.
Click the image for a detailed introduction to SPI
3.3. I2C
If our microcontroller needs to control multiple peripherals at the same time, connecting many serial ports would be very wasteful. If we can connect multiple peripherals on a single communication line, it would save resources significantly, leading to the creation of I2C.
Click the image for a detailed introduction to I2C
Hardware engineers and practitioners are all following us















Disclaimer:
Disclaimer: This is an original article. Please indicate the source if reproduced. Some images are organized from the internet. This account maintains neutrality regarding all original and reprinted articles’ statements and opinions. The articles and images’ copyrights belong to the original authors. If there is any infringement, please contact for removal.
For submissions/recruitment/promotion, please add WeChat:woniu26a
Disclaimer:
Recommended Reading▼
-
Circuit Design – Circuit Analysis
-
EMC Related Articles
-
Electronic Components
Reply with “Add Group” in the backend, and the administrator will add you to the technical exchange group.