摘要
叙述基于MAX232和MAX483E实现RS232/RS485转换有源半双工转换器的硬件电路设计和相应的程序设计方法。采用STC11F02E单片机为控制核心实现RS232/RS485总线之间的正确通信。对单片机应用程序设计以及通信协议进行了详细的说明,并给出了相应的试验结果。所设计的转换器设置灵活、体积小巧、成本低廉,可应用于由PC机作为主机的RS485总线的主从式半双工通信系统当中。
The hardware circuit design of the active half-duplex RS232/RS485 converter and the program design of the converter are described in the paper. The level conversion chip MAX232 and MAX483E are used to convert the RS232 level and RS485 level to the TTL level in the converter. The control chip of the converter is a SCM STC11F02E which is used to achieve the right communication between the RS232 bus and RS485 bus. This paper also describes the application program design of the SCM and the communication protocol design, gives the result of the experiment. The converter designed is flexible, compact and low cost. It can be used in master-slave half-duplex communication systems based on RS485 bus whose host computer is a personal computer.