為解決當(dāng)前計(jì)算機(jī)串行通訊接口只有USB,難以滿足舊型號(hào)設(shè)備或某些單片機(jī)要求RS232通訊的問題,設(shè)計(jì)出兩款RS232/USB電路。采用CH341A與MAX223集成電路芯片構(gòu)建標(biāo)準(zhǔn)9線RS232/USB通用接口轉(zhuǎn)換器,無需編程。采用CH341A與PIC16F877A構(gòu)建單片機(jī)與計(jì)算機(jī)之間的USB通訊電路,軟件遵循RS232通訊協(xié)議,硬件進(jìn)行電平轉(zhuǎn)換。實(shí)際使用表明,這兩款產(chǎn)品與計(jì)算機(jī)端Windows 操作系統(tǒng)下的串口應(yīng)用程序完全兼容,且通訊過程中無握手失敗現(xiàn)象。
Abstract: To solve the problem that current computer serial communication only with USB interface can not satisfy with the old type equipments or MCU to communicate with RS232, two kinds of RS232/USB circuit were designed.CH341A and MAX223 integrated circuit chips were used to create a standard 9-line RS232/USB universal interface convertor without programme. CH341A and PIC16F877A chips were adopted to build the USB communication circuit between computers and MCU. The software follows RS232 communication protocol, and the hardware converts electrical levels. Actual practices indicate that the two manufactures are compatible with serial application program of Windows operation system completely,and get avoid of handshake lost.
詳細(xì)介紹工控軟件組態(tài)王與單片機(jī)多機(jī)串口通訊的設(shè)計(jì)原理。分析組態(tài)王提供的直接與單片機(jī)串口通信方法的優(yōu)點(diǎn),給出系統(tǒng)基于RS-485總線傳輸?shù)慕涌陔娐吩韴D。根據(jù)組態(tài)王提供的通訊協(xié)議和單片機(jī)多機(jī)串口通訊的原理,給出程序設(shè)計(jì)流程與思路。
Abstract:
In this paper,the design principle of communication between multi-SCM and KingView by serial ports is described in detail.We analysis the advantage of method supplied by KingView,by which KingView can communicate with serial ports of SCM directly,and provide the system’s interface circuit based on the RS-485transmission line.We provide flow diagram of programming and thinking on the basis of communication protocol supplied by KingView and principle of communication among multi-SCM through serial ports.