摘 要
在自动控制领域,有的时候需要多个PC机串口应用,但是许多普通的PC机只有2个标准RS232串口,在许多场合不够用,而现在单片机的广泛应用,可以利用单片机扩展系统通过智能处理扩展设计出多个串口。为解决上述问题,我尝试做了一个“多串口通信控制器扩展系统”主要利用PC机的一个标准RS232串口,采用单片机扩展系统设计一种能够扩展多个串口的系统,为了满足不同型号需要,还将输出接口设计成RS232/RS422兼容型。 PC机采用VC软件编辑按要求发出数据,采用新式USB接口与PC机连接。其中使用Philips公司的PDIUSBD12这种性能优化的USB器件与MCS-51单片机连接,再采用一片串口异步通信器件16C554扩展芯片与MCS-51连接,利用中断性能对MCS-51编程,然后利用它四个出口进行串口的扩展,再加入芯片MAX232与MAX485进行协议通信,从而达到扩展目的。 本系统的突出特点:它可以设计将普通PC机扩展多个串口,满足用户的多串口的连接需要。 关键词:MCS-51单片机;扩展系统;USB;16C554;MAX232/485 ABSTRACT At autocontrol region , a new adopt piece serial port asynchronous communication device 16c554 spread chip and MCS-51 SCM use break performance versus MCS-51 SCM programme,then using it four export proceed serial port spread off of the messrs. The one standard RS232 serial port,adopt SCM spread system to design a sort in a position to spread multi-serial port system,for met the needs of differ type and return export should be designed for RS232 /RS422 compatible type to of the abstract.Some time needs multi-pc machine serial port application,but heap ordinary PC machine none but two loaf standard RS232 serial port,at heap occasion ran low,whereas now SCM 'extensive use,could utilize SCM spread system through the medium of brainpower, getting spread thought out multi-serial port done. for solve above problem.I attempt to make one much serial port CCU spread system" mostly utilize PC machine avail SCM spread system through the medium of brainpower ,getting spread thought out multi-serial port done for need,returnning export be designed for RS232 / RS 422 compatible type. PC machine adopt VC software redact as required emit,adopting modernity USB mouthpiece and PC machine joint from. There use Philips & co. now that SCM' extensive use,could avail SCM spread system through the medium of brainpower, getting spread thought out multi-serial port done of in order to met the needs of differ type need for,return should export be designed for RS232 /RS422 compatible type to PDIUSBD12 such performance optimization.The demand of the rejoin chip MAX232 and MAX485 proceed agreement correspondence, so run up to spread end. these systemic jut point out. It could design commonness PC machine spread multi-serial port,satisfacting user's much serial port. Keywords:MCS-51SCM;Expand system;USB;16C554;MAX232/485 目 录 第1章 绪论 1 1.1 概述 1 1.2 存在的实际问题 2 1.3 串口扩展设想 2 1.4 预期结果及特点 3 1.5 本章小结 4 第2章 设计准备 5 2.1 MCS-51概述 5 2.1.1引言 5 2.1.2单片机的结构 6 2.2 单片机的性能及特点 8 2.2.1单片机硬件结构及引脚 9 2.2.2指令系统 11 2.3 单片机串行端口简介 16 2.4 定时器/计数器 17 2.5 中断系统 18 2.6 时钟电路 19 2.7 复位电路 19 2.8 地址锁存器74ALS373 19 2.9 串口介绍 20 2.10 USB概述 21 2.11 看门狗电路的设计 21 2.12 本章小结 21 第3章 设计方案的选择与论证 22 3.1 总体方案设计 22 3.1.1 串口扩展方式 22 3.1.2 与PC机接口设计 22 3.1.3 PC机数据发送方式 24 3.1.4 输出接口协议设定 24 3.2 具体设计方案 24 3.2.1 概述 24 3.2.2 系统各部分硬件组成 25 3.3 本章小结 25 第4章 硬件的设计 26 4.1 PC机发送方电路 26 4.1.1 USB接口分析 26 4.1.2 USB接口电路设计 27 4.2 单片机电路 30 4.3 中断扩展芯片GAL 30 4.4 16C554扩展输出电路 32 4.5 RS232/422标准接口及硬件设计 35 4.5.1 RS232/422接口规定 35 4.5.2 接口芯片设计 36 4.6 本章小结 37 第5章 系统软件的设计 37 5.1 设计总体思路 38 5.2 PC机端软件设计 38 5.2.1 窗口设计 39 5.3 单片机端软件设计 40 5.4 USB接口驱动设计 44 5.4.1 USB固件编程 44 5.4.2 USB驱动程序设计 46 5.4 单片机与PC机间的数据通信协议 47 5.5 本章小结 48 结论 49 参考文献 51 致谢 52 附录 53 [1] [2] 下一页 |