Click the blue text to follow us
0. Introduction:
Computer communication is divided into serial communication and parallel communication.
Parallel communication: Typically transmits data bytes simultaneously using multiple data lines.
Serial communication: Transmits data bytes one bit at a time over a single transmission line.
Each has its own advantages and disadvantages:
Parallel communication: Simple control, fast transmission speed, but many transmission lines, high cost for long-distance transmission, and difficulties in simultaneous reception, consuming many pin resources.
Serial communication: Data transmission control is more complex than parallel communication, slower transmission speed, fewer transmission lines, lower cost for long-distance transmission, and fewer pin resources consumed.
Next, I will discuss my understanding of the various modes of STM32 serial communication.
1. Synchronous and Asynchronous Communication:
a. Synchronous communication: The sender controls the clock line to ensure that both parties’ clocks are completely synchronized.
[Image]
b. Asynchronous communication: A character frame consists of eight (or nine) bits of data plus a start bit and a stop bit (optional parity bit), with arbitrary spacing between frames, but the transmission time for each bit (baud rate) is fixed, and the clock does not require strict consistency.
[Image]
2. STM32 Serial Ports: USART and USRT:
-
USART: A serial port that supports synchronous communication.
- USRT: A serial port that only supports asynchronous communication.
3. Transmission Direction of Serial Communication:
[Image]
[Image]
[Image]
Scroll to see more
4. Modes Corresponding to STM32 Serial Ports:
a. Asynchronous Communication Asynchronous
b. Synchronous Communication Synchronous
c. Half-Duplex Mode Single Wire (Half-Duplex)
d. Multiprocessor Communication
e. Infrared Communication IrDA
f. Local Internet LIN
g. Smart Card Mode SmartCard
h. Smart Card + Clock SmartCard with Card Clock
5. Conclusion:
The author has always learned by applying knowledge where needed; if not used temporarily, even if you learn it now, you will gradually forget it over time. This article focuses solely on asynchronous communication via serial ports, discussing the basic format for sending and receiving data, full-duplex asynchronous communication, and briefly introducing other areas. If there are any errors or questions in the article, please feel free to leave a message.
[Image]
Light it up and share with your friends!
Learn Embedded Systems QQ Group: 1093852264
A place for collaborative learning!!!