基于FPGA的CAN-USB協(xié)議轉換系統(tǒng)的設計
發(fā)布時間:2018-10-08 07:51
【摘要】:CAN總線作為工業(yè)現(xiàn)場中優(yōu)秀總線的代表,自誕生以來就得到了快速的發(fā)展,在工業(yè)現(xiàn)場、汽車電子以及航天航空等各個領域都得到了廣泛應用。但由于其接口與數(shù)據報文的特殊性,其數(shù)據格式并不能被PC機識別,因此在數(shù)據采集、性能調試以及故障分析等方面并不方便,這在一定程度上阻礙了CAN總線更大規(guī)模的普及。因此設計出一種能夠將CAN總線數(shù)據轉換為能被PC機識別信號的系統(tǒng)就顯得十分有必要。傳統(tǒng)的借助于ISA以及PCI板卡方式的數(shù)據轉換設備雖然能達到這個目的,但由于接口復雜、不支持Laptop、數(shù)據傳輸速度慢以及造價昂貴等缺點,并不適合在工業(yè)現(xiàn)場中推廣。而USB接口具有接口簡單、支持熱插拔、使用方便、數(shù)據傳輸速度快等優(yōu)點,現(xiàn)已成為PC機的標準接口之一。基于以上的這些前提,本文以FPGA作為主控制器,設計出了一種基于FPGA的CAN-USB協(xié)議轉換系統(tǒng)。 本文從四個方面對整個系統(tǒng)的設計提出了完整的方案,分別是協(xié)議轉換方案的提出、系統(tǒng)的硬件設計、系統(tǒng)的軟件設計以及系統(tǒng)的仿真與調試。在整個系統(tǒng)中,設計了以FPGA為主控制器,SJA1000為CAN控制器,CY7C68013為USB控制器的協(xié)議轉換系統(tǒng)。該協(xié)議轉換系統(tǒng)根據現(xiàn)場總線中的命令要求來對源協(xié)議數(shù)據進行采集,采集到的數(shù)據存儲在FPGA的異步FIFO中進行源協(xié)議的解碼以及目標協(xié)議的重新編碼,最終在時鐘的控制下通過目標協(xié)議的數(shù)據傳輸方式送至用戶或現(xiàn)場總線節(jié)點。 在該系統(tǒng)的設計中充分考慮到了CAN總線協(xié)議的發(fā)展,通過對CAN數(shù)據統(tǒng)一編碼再重新解讀的方式,系統(tǒng)不但適用于傳統(tǒng)的Basic CAN模式,也適用于更高級的PeliCAN模式,在系統(tǒng)的兼容性上,所設計的系統(tǒng)充分達到了現(xiàn)場總線的應用要求。除此之外,由于系統(tǒng)采用了FPGA來作為系統(tǒng)的主控制器,基于其高速的數(shù)據采集能力和通信能力,可以在系統(tǒng)的基礎上進行拓展,使得系統(tǒng)不單單可以進行協(xié)議的轉換,還可以實現(xiàn)工業(yè)現(xiàn)場視頻數(shù)據、設備運行參數(shù)的監(jiān)控,這使得系統(tǒng)的可擴展性得到了大大地提高。仿真結果表明系統(tǒng)具有硬件設計簡單、系統(tǒng)集成度高、易擴展以及成本低廉等優(yōu)點,同時由于在設計中引入了信號可靠性的概念,系統(tǒng)具有較強的穩(wěn)定性,具有較高的應用和推廣價值。
[Abstract]:As the representative of excellent bus in industrial field, CAN bus has been developed rapidly since its birth. It has been widely used in many fields such as industrial field, automobile electronics, aerospace and so on. However, because of the particularity of its interface and data packet, its data format can not be recognized by PC, so it is not convenient in data acquisition, performance debugging and fault analysis, which to some extent hinders the popularization of CAN bus on a larger scale. Therefore, it is necessary to design a system that can convert CAN bus data into a signal that can be recognized by a PC machine. Although the traditional data conversion equipment with the aid of ISA and PCI card can achieve this goal, because of the complex interface, the low speed of supporting Laptop, data transmission and the expensive cost, it is not suitable to be popularized in the industrial field. The USB interface has the advantages of simple interface, hot-plug support, convenient use and fast data transmission. It has become one of the standard interfaces of PC machine. Based on these premises, a CAN-USB protocol conversion system based on FPGA is designed with FPGA as the main controller. This paper presents a complete scheme for the whole system design from four aspects, namely, the protocol conversion scheme, the hardware design of the system, the software design of the system, and the simulation and debugging of the system. In the whole system, a protocol conversion system with FPGA as main controller and SJA1000 as CAN controller and CY7C68013 as USB controller is designed. The protocol conversion system collects the source protocol data according to the command requirements in the field bus. The collected data is stored in the asynchronous FIFO of FPGA to decode the source protocol and re-encode the target protocol. Finally, under the control of the clock, the data transmission mode of the target protocol is sent to the user or fieldbus node. In the design of the system, the development of CAN bus protocol is fully taken into account. By rereading the unified encoding of CAN data, the system is not only applicable to the traditional Basic CAN mode, but also to the more advanced PeliCAN mode. In terms of system compatibility, the designed system fully meets the application requirements of fieldbus. In addition, because the system uses FPGA as the main controller of the system, based on its high speed data acquisition ability and communication ability, it can be extended on the basis of the system, so that the system can not only carry out protocol conversion. It can also realize the monitoring of industrial scene video data and equipment operation parameters, which greatly improves the expansibility of the system. The simulation results show that the system has the advantages of simple hardware design, high system integration, easy expansion and low cost. At the same time, because the concept of signal reliability is introduced in the design, the system has strong stability. It has high value of application and popularization.
【學位授予單位】:安徽理工大學
【學位級別】:碩士
【學位授予年份】:2014
【分類號】:TP336
本文編號:2255996
[Abstract]:As the representative of excellent bus in industrial field, CAN bus has been developed rapidly since its birth. It has been widely used in many fields such as industrial field, automobile electronics, aerospace and so on. However, because of the particularity of its interface and data packet, its data format can not be recognized by PC, so it is not convenient in data acquisition, performance debugging and fault analysis, which to some extent hinders the popularization of CAN bus on a larger scale. Therefore, it is necessary to design a system that can convert CAN bus data into a signal that can be recognized by a PC machine. Although the traditional data conversion equipment with the aid of ISA and PCI card can achieve this goal, because of the complex interface, the low speed of supporting Laptop, data transmission and the expensive cost, it is not suitable to be popularized in the industrial field. The USB interface has the advantages of simple interface, hot-plug support, convenient use and fast data transmission. It has become one of the standard interfaces of PC machine. Based on these premises, a CAN-USB protocol conversion system based on FPGA is designed with FPGA as the main controller. This paper presents a complete scheme for the whole system design from four aspects, namely, the protocol conversion scheme, the hardware design of the system, the software design of the system, and the simulation and debugging of the system. In the whole system, a protocol conversion system with FPGA as main controller and SJA1000 as CAN controller and CY7C68013 as USB controller is designed. The protocol conversion system collects the source protocol data according to the command requirements in the field bus. The collected data is stored in the asynchronous FIFO of FPGA to decode the source protocol and re-encode the target protocol. Finally, under the control of the clock, the data transmission mode of the target protocol is sent to the user or fieldbus node. In the design of the system, the development of CAN bus protocol is fully taken into account. By rereading the unified encoding of CAN data, the system is not only applicable to the traditional Basic CAN mode, but also to the more advanced PeliCAN mode. In terms of system compatibility, the designed system fully meets the application requirements of fieldbus. In addition, because the system uses FPGA as the main controller of the system, based on its high speed data acquisition ability and communication ability, it can be extended on the basis of the system, so that the system can not only carry out protocol conversion. It can also realize the monitoring of industrial scene video data and equipment operation parameters, which greatly improves the expansibility of the system. The simulation results show that the system has the advantages of simple hardware design, high system integration, easy expansion and low cost. At the same time, because the concept of signal reliability is introduced in the design, the system has strong stability. It has high value of application and popularization.
【學位授予單位】:安徽理工大學
【學位級別】:碩士
【學位授予年份】:2014
【分類號】:TP336
【參考文獻】
相關期刊論文 前5條
1 歐陽曉青,黃魯,王榮生;一種嵌入式USB主機的應用[J];電子技術;2004年07期
2 王靜紅;劉教民;于富強;王麗娜;王震洲;;采用CY7C68013芯片的系統(tǒng)固件程序設計[J];河北師范大學學報(自然科學版);2008年02期
3 張云;杜坤梅;鄧浩;;基于CAN總線在衛(wèi)星飛輪系統(tǒng)中通訊的設計[J];哈爾濱商業(yè)大學學報(自然科學版);2006年01期
4 李緒友;盛明;;基于FPGA及USB的數(shù)據采集系統(tǒng)設計[J];黑龍江科技信息;2008年14期
5 宋沛;格雷碼到BCD碼的轉換[J];機電工程技術;2003年05期
,本文編號:2255996
本文鏈接:http://sikaile.net/kejilunwen/jisuanjikexuelunwen/2255996.html
最近更新
教材專著