基于FPGA的CAN-USB協(xié)議轉(zhuǎn)換系統(tǒng)的設(shè)計(jì)
發(fā)布時(shí)間:2018-10-08 07:51
【摘要】:CAN總線作為工業(yè)現(xiàn)場(chǎng)中優(yōu)秀總線的代表,自誕生以來(lái)就得到了快速的發(fā)展,在工業(yè)現(xiàn)場(chǎng)、汽車電子以及航天航空等各個(gè)領(lǐng)域都得到了廣泛應(yīng)用。但由于其接口與數(shù)據(jù)報(bào)文的特殊性,其數(shù)據(jù)格式并不能被PC機(jī)識(shí)別,因此在數(shù)據(jù)采集、性能調(diào)試以及故障分析等方面并不方便,這在一定程度上阻礙了CAN總線更大規(guī)模的普及。因此設(shè)計(jì)出一種能夠?qū)AN總線數(shù)據(jù)轉(zhuǎn)換為能被PC機(jī)識(shí)別信號(hào)的系統(tǒng)就顯得十分有必要。傳統(tǒng)的借助于ISA以及PCI板卡方式的數(shù)據(jù)轉(zhuǎn)換設(shè)備雖然能達(dá)到這個(gè)目的,但由于接口復(fù)雜、不支持Laptop、數(shù)據(jù)傳輸速度慢以及造價(jià)昂貴等缺點(diǎn),并不適合在工業(yè)現(xiàn)場(chǎng)中推廣。而USB接口具有接口簡(jiǎn)單、支持熱插拔、使用方便、數(shù)據(jù)傳輸速度快等優(yōu)點(diǎn),現(xiàn)已成為PC機(jī)的標(biāo)準(zhǔn)接口之一;谝陨系倪@些前提,本文以FPGA作為主控制器,設(shè)計(jì)出了一種基于FPGA的CAN-USB協(xié)議轉(zhuǎn)換系統(tǒng)。 本文從四個(gè)方面對(duì)整個(gè)系統(tǒng)的設(shè)計(jì)提出了完整的方案,分別是協(xié)議轉(zhuǎn)換方案的提出、系統(tǒng)的硬件設(shè)計(jì)、系統(tǒng)的軟件設(shè)計(jì)以及系統(tǒng)的仿真與調(diào)試。在整個(gè)系統(tǒng)中,設(shè)計(jì)了以FPGA為主控制器,SJA1000為CAN控制器,CY7C68013為USB控制器的協(xié)議轉(zhuǎn)換系統(tǒng)。該協(xié)議轉(zhuǎn)換系統(tǒng)根據(jù)現(xiàn)場(chǎng)總線中的命令要求來(lái)對(duì)源協(xié)議數(shù)據(jù)進(jìn)行采集,采集到的數(shù)據(jù)存儲(chǔ)在FPGA的異步FIFO中進(jìn)行源協(xié)議的解碼以及目標(biāo)協(xié)議的重新編碼,最終在時(shí)鐘的控制下通過(guò)目標(biāo)協(xié)議的數(shù)據(jù)傳輸方式送至用戶或現(xiàn)場(chǎng)總線節(jié)點(diǎn)。 在該系統(tǒng)的設(shè)計(jì)中充分考慮到了CAN總線協(xié)議的發(fā)展,通過(guò)對(duì)CAN數(shù)據(jù)統(tǒng)一編碼再重新解讀的方式,系統(tǒng)不但適用于傳統(tǒng)的Basic CAN模式,也適用于更高級(jí)的PeliCAN模式,在系統(tǒng)的兼容性上,所設(shè)計(jì)的系統(tǒng)充分達(dá)到了現(xiàn)場(chǎng)總線的應(yīng)用要求。除此之外,由于系統(tǒng)采用了FPGA來(lái)作為系統(tǒng)的主控制器,基于其高速的數(shù)據(jù)采集能力和通信能力,可以在系統(tǒng)的基礎(chǔ)上進(jìn)行拓展,使得系統(tǒng)不單單可以進(jìn)行協(xié)議的轉(zhuǎn)換,還可以實(shí)現(xiàn)工業(yè)現(xiàn)場(chǎng)視頻數(shù)據(jù)、設(shè)備運(yùn)行參數(shù)的監(jiān)控,這使得系統(tǒng)的可擴(kuò)展性得到了大大地提高。仿真結(jié)果表明系統(tǒng)具有硬件設(shè)計(jì)簡(jiǎn)單、系統(tǒng)集成度高、易擴(kuò)展以及成本低廉等優(yōu)點(diǎn),同時(shí)由于在設(shè)計(jì)中引入了信號(hào)可靠性的概念,系統(tǒng)具有較強(qiáng)的穩(wěn)定性,具有較高的應(yīng)用和推廣價(jià)值。
[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.
【學(xué)位授予單位】:安徽理工大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2014
【分類號(hào)】:TP336
本文編號(hào):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.
【學(xué)位授予單位】:安徽理工大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2014
【分類號(hào)】:TP336
【參考文獻(xiàn)】
相關(guān)期刊論文 前5條
1 歐陽(yáng)曉青,黃魯,王榮生;一種嵌入式USB主機(jī)的應(yīng)用[J];電子技術(shù);2004年07期
2 王靜紅;劉教民;于富強(qiáng);王麗娜;王震洲;;采用CY7C68013芯片的系統(tǒng)固件程序設(shè)計(jì)[J];河北師范大學(xué)學(xué)報(bào)(自然科學(xué)版);2008年02期
3 張?jiān)?杜坤梅;鄧浩;;基于CAN總線在衛(wèi)星飛輪系統(tǒng)中通訊的設(shè)計(jì)[J];哈爾濱商業(yè)大學(xué)學(xué)報(bào)(自然科學(xué)版);2006年01期
4 李緒友;盛明;;基于FPGA及USB的數(shù)據(jù)采集系統(tǒng)設(shè)計(jì)[J];黑龍江科技信息;2008年14期
5 宋沛;格雷碼到BCD碼的轉(zhuǎn)換[J];機(jī)電工程技術(shù);2003年05期
,本文編號(hào):2255996
本文鏈接:http://sikaile.net/kejilunwen/jisuanjikexuelunwen/2255996.html
最近更新
教材專著