The information exchange between a microcomputer and the outside world is called communication. The basic modes are parallel and serial. This article mainly explains the serial mode, mainly grasps the connection method of microcomputer serial communication, is familiar with its working mode and functions, and uses a program flow chart to explain its working process. [Keywords] Microcomputer communication program flow chart The Mcs-51 series microcontroller has a powerful full-duplex serial asynchronous communication interface inside, which can be used for URAT, can easily form a dual-machine or multi-machine communication system, and can also be expanded into a parallel I/O port after connecting an external shift register. As can be seen from the figure: both communicating parties are 8031 microcontrollers, connecting the TXD of one party to the RXD of the other party, and the RXD to the TXD of the other party. The ground is connected to the ground, because the output of the serial port is TTL level. Therefore, this connection method is only suitable for short-distance communication. When sending data, just write the data into SUBF and the data to be sent can be serially output from the TXD terminal according to the pre-set mode and baud rate. When receiving data, first make REN=1. After a frame of data is output from the RXD terminal to SBUF, the serial port sends an interrupt request to notify the CPU to read the data. The data transmission rate depends on the working mode of the serial port and the baud rate setting.
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore