RS232 seriële poortlijn, communicatietoepassing in PC en microcontrollercommunicatie

1 Introduction

With the rapid development of science and technology and information technology in our country, advanced technology has been applied to various industries. In modern control systems, data must be unified and analyzed, and equipment must be controlled in real time. Therefore, microcontrollers are necessary An indispensable part of the industrial control system, the microcontroller has the characteristics of low price, small size and strong adaptability. If the data is difficult, the microcontroller cannot be used. This article discusses the application of RS232 serial communication in the communication between PC and microcontroller. A brief analysis was conducted.

In control systems with more complex functions, the host computer is an industrial computer, and the slave computer is a single-chip microcomputer. In these applications, the single-chip computer faces the bottom layer of the controlled object, and further collection and analysis of data is completed by using a PC. Data exchange needs to be carried out between the microcontroller and the PC. In the configuration of the PC, there are one to multiple RS232 serial ports. This serial port is responsible for data exchange. The RS232 standard

quasi represents the American Electronics Industry Association, 232 is the identification number, and C represents the latest modification of 232. The RS232C standard interface has 25 lines, namely status line, contact line, data line, and ground line. This article analyzes the application of RS232 serial communication in communication between PC and microcontroller.

2. Application of RS232 serial port communication in communication between PC and microcontroller

2.1 RS232 serial communication concept

The concept of serial communication is very simple and can be equipped on any personal computer. It is a standard interface. The most common types include DB-9 and DB-25. There will be two RS232 interfaces on the computer, and parallel Compared with the communication speed, the sending and receiving speed of serial communication is a little slower, but it can send and receive at the same time, and long-distance communication can also be achieved (2

2.2 RS232 serial communication principle

RS232 serial communication is mainly transmitted through ASCII codes, and the ground wire is used to complete the corresponding reception and transmission. The serial communication end transmits on one line, and then can receive 0 on another line. Some of the more important parameters include: 1) Baud rate.It can reflect the speed of communication. The baud rate is the same as the clock cycle, but it is worth mentioning that the baud rate is related to the distance.

Inversely proportional to the distance, the baud rate is only required between closely related instruments. 2) Data bits. This parameter can reflect the data in communication. The general standard is 5, 7. 8 bits. The standard value should be selected depending on what kind of information is sent. The standard ASCII code is 7 or 8 bits. The last bit of a single packet is the stop bit. The data is transmitted through the transmission line during timing, so the devices have different clocks. During the communication process, the devices The transmission is asynchronous, so the difference is relatively small. At this time, stop bits can be used to resolve the out-of-synchronization between devices. Stop bits can also be used to express the end of the transmission. The more stop bits, the better. , appropriate number of bits should be added to ensure the data transfer rate. 3) Parity bit. This parameter can check whether the serial communication is correct or wrong. The main methods include even, odd, high , and low. When performing parity check, the last bit of the data is the check bit. For the device, it is important to know the meaning of one bit. The status can determine whether the data transmission is interfered by other devices.

2.3 Serial communication RS232C standard

With the continuous advancement of science and technology, the use of communication equipment in life has also

More widely, there are many serial communication interface standards, all of which are modified from the RS232 interface standard. The earliest RS232 standard was promulgated by an American company in the 1960s. This standard has certain requirements for the transmission rate. And this standard has certain instructions for the related equipment of the serial communication interface. At present, this interface has been widely used. The regulations for device characteristics, logic levels and signal line functions are: on RTS, CTS, DTR, DSR and other control lines, if it is 3V-15V, it means the signal is valid, if it is -3V to -15V, it means If it is disconnected, the signal is invalid. There is no clear indication in RS232C, but there are various types of connectors. The DB-9 connector does not support the 20mA current loop interface and can only be connected to the COM1 and COM2 interfaces.

2.4 Interface circuit between RS232 and microcontroller

There are obvious differences between the microcontroller serial port signal and RS232, so conversion is required to ensure level consistency. The most widely used converter is MAX232. Its main power supply source is 5V power supply, which can be conveniently used. The configuration source is obtained, and the signal is converted into TXD, which can be directly connected to the PC. After research on the composition, it is mainly composed of three parts.

The charge pump circuit includes 4 capacitors and pins 1, 2, 3, 4, 5, and 6, which can ensure the continuous operation of the level. The data conversion channel includes pins 7 to 14. The above part is the first data channel from pins 11 to 14, and the second data channel is from pins 7 to 10. It can be input from pin 10, and output from pin 14 after conversion. Of course There are also many shortcomings in RS232, such as: insufficient transmission distance . During operation, the transmission distance may be only 50m, so it cannot meet the corresponding requirements.

The maximum transmission rate is 19200B, so the rate is significantly reduced. The form of transmission is mainly shared ground transmission. In this process, it is easily interfered by other factors, thus affecting the effect.

3Conclusion

In summary, the application of RS232 serial communication in the communication between PC and microcontroller is mainly analyzed. It can be seen that RS232 serial communication plays a very important role in the transmission of microcontroller and PC. It is the method of information transmission. main hub can complete the transmission of data. Of course, there are also many shortcomings. Researchers need to analyze and practice more to find solutions and provide greater help for future work in this area.

Trefwoorden: seriële poort server

X

Schakel JavaScript in je browser in om dit formulier in te vullen.
Voer productgegevens in zoals interfaceconfiguratie, omgeving enz. en andere specifieke vereisten om een nauwkeurige offerte te ontvangen.

nl_NLDutch
Schakel JavaScript in je browser in om dit formulier in te vullen.
Voer productgegevens in zoals interfaceconfiguratie, omgeving enz. en andere specifieke vereisten om een nauwkeurige offerte te ontvangen.