【文章內(nèi)容簡介】
plement asynchronous serial 8250 the initial programming,you can control serial data transmission format and the PC,in general there are two standard RS232C serial interface COM1 and COM21MCS51 serial microcontroller chip includes a fullduple serial interface,can also be realized by programming the serial munications. CMOS smart sensor IC has received wide application for low cost,miniaturization,intelligence and smart sensor IC designs,the munication interface circuits also play an important role other than sensors and signal processing are more serial munication standard interfaces,such as RS232,RS485,USB Interface,IEEE1394,which has itself good features and also has focused on areas of has a antinoise capacity transmitting data,so it is monly used in industrial interface and IEEE1394 have fast speed,but some puters and operating systems do not support such standard is a protocol of asynchronous serial munication and has been widely used in PC and munication short distance municational peripherals of PC such as printers,disks and terminals all municate with PC via RS232 serial interface. RS32C standard RS232C is the American Electronics Industry Association(EIA) formally announced,in the asynchronous serial munication,the most widely used standard standard for DCE and DTE serial binary munication between the maximum data transfer rate of up to ,the longest transmission cables up to 15 meters RS232C standard defines the 25lead,twoway munication in general,just Serial input RXD,serial output TXD and ground GND1RS232C standard levels using negative logic,the provisions of +3V~+15V at any level between a logic ”1” level,with TTL and CMOS levels are the interface circuit and puter interface chip in the mostly level TTL or CMOS,so the munication,the need for level conversion,so with RS232C standard level matching 1MAX232 chip level conversion can be done in this work. RS232 is defined as the singleended standards,which has much characteristic,such as more munication distance in a lowspeed serial munication,moderate price and good practically of the system,so it is most appropriate to be a munication is an essential modern puter interface,it includes ports COM1 and COM2,the port COM1 has 9pin new generation puter has a 9pin connector(DB9)so as to connect with the RS232 munication order to achieve reliable and realtime transmission,the system adopt a threewire connection method,that is to say that the GND pin,RXD pin and TXD pin of RS232 port is connected with the external port,it is shown in Figure 1: Figure 1. The RS232 port III. THE SOFTWARE DESIGN OF SERIAL PORT COMMUNICATION The munication program of the single chip microputer munications with PC puter by interrupt and PC puter is called as main the single chip puter receives the data singles sent by PC puter,then it calls interrupt service flowchart of the interrupt service main subprogram is shown in Figure order to fully exploit the efficiency of single chip puter to minimize CPU time occupied by munication,the control program will be we will promptly respond to and control munication program will be subprogram of serial port interrupt for receiving data,the subprogram for sending stepbystep impulse,the subprogram for judging in