1、 1 中文 4700 字 The Designing of Serial Communication Based on RS232 Abstract This paper discussed the principle of serial communication mainly, proposed the design method based on RS232, designed the hard circuit of serial communication, and realized the programming to PC Microcomputer and single chip
2、 microcomputer by using assembly language and C+ Builder separately. Keywords: serial communication; single chip microcomputer; program design. I. INTRODUCTION During working in the control system, the PC microcomputer sends instructions for step-by-step motor to collect the image information. There
3、fore the communication between the PC microcomputer and the driving system is needed for the communication system. In general, a complete communication system consists of transmitter, receiver, converting the data interface and transmitting data channel. The control of the step-by-step motor is real
4、ized through the pulse distribution by single chip microcomputer. On the motor control system, the PC microcomputer is called as upper computer, and the single chip microcomputer for driving step-by-step motor is called as lower computer. The communication between the upper computer and the lower co
5、mputer has two methods, that is to say the parallel communication and serial communication. Parallel interface can transmit much data at the same time and has the fast speed, but when the transmission distance is far and the number of data is much, it needs more the number of transmission lines. In
6、addition, the voltage level may be changed by the transmission line factor and electromagnetic interference. Serial communication is a one way that the data is transmitted by a bit in order, in which two transition lines is needed to realize bidirectional communication. It is taken into consideratio
7、n that the data is much and the transmutation number is little, the serial communication is utilized in the control system so as to simplify the hardware and save the cost. Serial communication is one of the oldest mechanisms for devices to communicate with each other. Starting with the IBM PC and c
8、ompatible computers, almost all computers are equipped with one or more serial ports and one parallel port. As the name implies, a serial 2 port sends and receives data serially, one bit at a time. In contrast, a parallel port sends and receives data eight bits at a time, using eight separate wires.
9、 For serial communication to work, you just need a minimum of three wiresone to send, one to receive, and one signal ground. For parallel communication, you need eight wires. Despite the comparatively slower transfer speed of serial ports over parallel ports, serial communication remains a popular c
10、onnectivity option for devices because of its simplicity and cost-effectiveness. It shows some of the devices that use a serial port to connect to the computer. Using a serial port, you can connect to a modem, a mouse, or a device such as a bridge/router for configuration purposes. II. THE BRIEF DES
11、CRIPTION OF SERIAL PORT COMMUNITION Serial communication is the communication between sender and receiver data transfer is in the single data line, to move each time a bit. The advantage is that only a pair of transmission lines to send information, so its low cost, suitable for long-distance commun
12、ications; its disadvantage is that transmission speed is low. As mentioned, a serial device sends and receives data one bit at a time. Some devices can send and receive data at the same time and are known as full-duplex devices. Others that can either send or receive at any one time are known as sin
13、gle-duplex. To initiate transmission, a device first transmits a start bit, followed by the data bits. The data bits can be five, six, seven, or eight bits, depending on what has been agreed upon. Both the sender and the receiver must be set to the same data bits for communication to take place corr
14、ectly. Once the data bits are sent, a stop bit is sent. A stop bit can be one, one and a half, and two bits. The baud rate is the speed of transmission of data from one device to another. Baud rate is usually measured in bits per second (bps).Most serial devices transmit in seven or eight bits. To d
15、etect that the data has been sent correctly, an optional parity bit can be included together with the data bits. A parity bit can be one of the following: odd, even, mark, space, or none (mark and space parity are almost always used). Using a parity bit provides a basic mechanism to detect corruptio
16、n of data that was sent and does not guarantee that the data received is free from error. Nevertheless, a parity bit is useful for improving the integrity of the data sent. Most serial ports adhere to the RS232C standard, which specifies a connector either with 25 pins or with 9 pins. Most serial de
17、vices use the nine-pin connector. Serial communication with asynchronous communication and synchronous communication are two basic means of communication. Synchronous communication for the case of high transmission speed, the hardware complexity. The asynchronous communication 3 used in transmission
18、 speed between 50 and 19200 baud. Transmission is relatively common. In asynchronous communication, data is transmitted frame by frame, each frame of serial data format by a start bit, 5 to 8 data bits, a parity bit (optional) and a Stop bit of four parts. Before the serial communication, the sender
19、 and receiver to agree the specific data format and baud rate (communication protocol). PC-programmable serial asynchronous communication controller 8250 to implement asynchronous serial communication. By 8250 the initial programming, you can control serial data transmission format and speed. In the
20、 PC, in general there are two standard RS-232C serial interface COM1 and COM21MCS - 51 series microcontroller chip includes a full-duplex serial interface, can also be realized by programming the serial communications. CMOS smart sensor IC has received wide application for low cost, miniaturization,
21、 intelligence and standardization. In smart sensor IC designs, the communication interface circuits also play an important role other than sensors and signal processing circuits. There are more serial communication standard interfaces, such as RS-232, RS-485, USB Interface, IEEE-1394, which has itse
22、lf good features and also has focused on areas of application. RS-485 has a anti-noise capacity transmitting data, so it is commonly used in industrial production. USB interface and IEEE-1394 have fast speed, but some computers and operating systems do not support such interfaces. RS-232 is most wid
23、ely used as a serial interface in a PC computer and communications industries. RS232C standard is a protocol of asynchronous serial communication and has been widely used in PC and communication industries. Many short distance communicational peripherals of PC such as printers, disks and terminals a
24、ll communicate with PC via RS232 serial interface. RS-232C standard RS-232C is the American Electronics Industry Association (EIA) formally announced, in the asynchronous serial communication, the most widely used standard bus. The standard for DCE and DTE serial binary communication between the max
25、imum data transfer rate of up to 19. 2kbps, the longest transmission cables up to 15 meters 1RS - 232C standard defines the 25-lead, two-way communication in general, just Serial input RXD, serial output TXD and ground GND1RS - 232C standard levels using negative logic, the provisions of + 3V + 15V
26、at any level between a logic 0level, - 3V - 15V of Any level between a logic 1 level, with TTL and CMOS levels are different. In the interface circuit and computer interface chip in the mostly level TTL or CMOS, so the communication, the need for level conversion, so with the RS - 232C standard level matching 1MAX232 chip level conversion can be done in this work.