摘 要小局域网多机通信在如食堂刷卡收费管理系统、汽车加油刷卡系统、电能运输秒表管理系统等领域应用广泛。因此,开展本领域的讨论有较好的应用前景。本文主要采纳一种以 PC 机作为上位机,多台 80C51 单片机作为下位机,来进行上位机与下位机以及下位机与下位机的通信的讨论。主要包括:系统总体方案设计;在 PC机端,通过专用的 RS232/485 标准转换芯片 S2-485 将 RS-232 电平转换成 RS-485 电平,在 80C51 单片机端,通过 MAX485 转换芯片将 TTL 电平转换成 RS-485 电平,来实现上位机与下位机以及下位机与下位机的通信;在系统硬件设计的根底上,制定了通信协议。为了到达使传输数据的准确性,开展了数据传输的错误检查与纠正,以及系统可靠性方面的讨论;进行了 PC 机与下位机,以及下位机与下位机的软件编程、程序调试,实现了系统多机通信的数据传输。关键词:PC 机;单片机;RS-485;数据传输;多机通信AbstractMulti-machine communications have a wide range of applications in small local network, such as management system in the canteen for charges of credit card ,in the gas station for refueling, in the transport of energy for stopwatch timing. Therefore,there are good prospects to carry out research in this area . This article uses pc machine as a host computer and multiple 80C51 single-chips as slave microcomputers to carry out the study of communications between PC and lower machine, as well as lower machines. The article includes an overall designing plan. In the port of the PC, using a S2-485,dedicated RS232/485 converter chip , converts the RS-232 level into the RS-485 level. In the port of 80C51 single-chip, MAX485 will be used to convert TTL level into RS-485 level. In this way ,communications can be achieved between PC and lower machine, as well as lower machines. In the basis of hardware design, the communicational protocol is carried out.In order to achieve the accuracy of the data transmission, the error checking and...