电子设计工程
電子設計工程
전자설계공정
ELECTRONIC DESIGN ENGINEERING
2011年
19期
172-175
,共4页
RS-485%多机通信%AVR单片机%CserialPort类
RS-485%多機通信%AVR單片機%CserialPort類
RS-485%다궤통신%AVR단편궤%CserialPort류
RS-485%multi-computer communication%AVR%CserialPort class
为解决现场工业数据采集系统中远距离多机通信的难题,设计了基于RS-485总线半双工、主从式多机通信网络。采用了以PC机为主机,Visual C++6.0为平台,使用CserialPort类编写了串口通信程序,文中并给出了关键程序;以Atmega16 AVR单片机为从机,使用SN75176芯片实现了RS-485信号电平到TTL电平的转换。最后为了验证设计的可行性.在线阵CCD缝隙测量系统中进行测试,结果表明能够可靠实现采集系统的远距离多机通信,并通过调试提出了信号接地的重要性。
為解決現場工業數據採集繫統中遠距離多機通信的難題,設計瞭基于RS-485總線半雙工、主從式多機通信網絡。採用瞭以PC機為主機,Visual C++6.0為平檯,使用CserialPort類編寫瞭串口通信程序,文中併給齣瞭關鍵程序;以Atmega16 AVR單片機為從機,使用SN75176芯片實現瞭RS-485信號電平到TTL電平的轉換。最後為瞭驗證設計的可行性.在線陣CCD縫隙測量繫統中進行測試,結果錶明能夠可靠實現採集繫統的遠距離多機通信,併通過調試提齣瞭信號接地的重要性。
위해결현장공업수거채집계통중원거리다궤통신적난제,설계료기우RS-485총선반쌍공、주종식다궤통신망락。채용료이PC궤위주궤,Visual C++6.0위평태,사용CserialPort류편사료천구통신정서,문중병급출료관건정서;이Atmega16 AVR단편궤위종궤,사용SN75176심편실현료RS-485신호전평도TTL전평적전환。최후위료험증설계적가행성.재선진CCD봉극측량계통중진행측시,결과표명능구가고실현채집계통적원거리다궤통신,병통과조시제출료신호접지적중요성。
In order to resolve the difficult problem of data acquisition system under the long distance and multi-computer communication, this paper designs a type of half-duplex and master-slave multi-computer communication based on RS-485 bus network. PC with Visual C++6.0 as master and using CserialPort class writes serial communication program, and this paper gives the key program. AVR microcontroller of Atmegal6 as slave and using SN75176 chip realizes the conversion from RS- 485 signal level to TFL level. At last, in order to test the feasibility of designed, application in linear CCD clearance measuring system, the result shows that can realize acquisition system by long-distance and multi-computer communication, and according to debugging, approve the importance of the signal to ground.