基于FPGA的CAN總線與以太網(wǎng)協(xié)議轉(zhuǎn)換卡的實現(xiàn)
本文選題:CAN總線 + 以太網(wǎng); 參考:《北京郵電大學(xué)》2014年碩士論文
【摘要】:將現(xiàn)場總線技術(shù)與以太網(wǎng)技術(shù)相結(jié)合是當(dāng)今工業(yè)控制領(lǐng)域的熱點,現(xiàn)場總線的穩(wěn)定性實時性與以太網(wǎng)的靈活性都能得到體現(xiàn)。目前應(yīng)用最廣泛的現(xiàn)場總線是CAN總線,CAN總線有成熟的國際標(biāo)準(zhǔn),被視為最有前途的現(xiàn)場總線之一。本文在Altera公司的FPGA平臺上,用RTL設(shè)計完成了CAN總線的軟核,方便進行功能裁剪和移植,并通過配置Altera公司提供的三速以太網(wǎng)IP核(triple-speed-megacore)來實現(xiàn)以太網(wǎng)的協(xié)議,降低開發(fā)成本,減少開發(fā)周期,最后使用SDRAM轉(zhuǎn)存數(shù)據(jù)來實現(xiàn)兩個協(xié)議間的轉(zhuǎn)換。本文一共完成了以下幾個方面的工作: 1.完成了CAN協(xié)議的RTL設(shè)計,包括讀寫寄存器的設(shè)計、位同步設(shè)計、位流管理器設(shè)計。其中,讀寫寄存器按照SJA1000的運行機制來設(shè)計,通過讀寫寄存器來配置CAN總線的工作模式和波特率等;位同步設(shè)計中,用狀態(tài)機實現(xiàn)了同步段和相位緩沖段1,相位緩沖段2之間的跳轉(zhuǎn),從而完成了對采樣點和發(fā)送點的捕捉;位流管理器設(shè)計主要實現(xiàn)數(shù)據(jù)鏈路層的位編碼、CRC校驗以及驗收濾波的功能。每一部分都給出了仿真結(jié)果及詳細(xì)分析。 2.利用Altera公司提供的三速以太網(wǎng)IP核來實現(xiàn)以太網(wǎng)協(xié)議,本文詳細(xì)介紹了三速以太網(wǎng)IP核內(nèi)部的寄存器以及內(nèi)部FIFO,通過配置內(nèi)部的寄存器,來最終實現(xiàn)以太網(wǎng)的功能,詳細(xì)分析了以太網(wǎng)功能實現(xiàn)的仿真結(jié)果。除此之外,介紹了如何配置PHY端的接口,包括管理接口MDIO和數(shù)據(jù)接口,并用PHY芯片DP83658實現(xiàn)了以太網(wǎng)通信。 3.用SDRAM作為緩存數(shù)據(jù)的媒介來完成兩個協(xié)議的轉(zhuǎn)換。SDRAM的控制模塊分為狀態(tài)控制模塊、命令控制模塊和讀寫控制模塊,其中狀態(tài)控制模塊主要實現(xiàn)控制SDRAM狀態(tài)的轉(zhuǎn)移,包括上電初始化和工作狀態(tài),工作狀態(tài)分為讀、寫、自刷新等狀態(tài)。命令控制模塊實現(xiàn)對SDRAM的接口控制,通過接口信號控制SDRAM正常工作。讀寫控制模塊,實現(xiàn)對SDRAM的讀寫控制,與SDRAM進行數(shù)據(jù)交換,本文詳細(xì)介紹了每個模塊的設(shè)計,并分析了兩個協(xié)議轉(zhuǎn)換實現(xiàn)的波形仿真圖。 本論文實現(xiàn)了基于FPGA的CAN協(xié)議到以太網(wǎng)協(xié)議的轉(zhuǎn)換方案,在實際應(yīng)用中具有現(xiàn)實意義。
[Abstract]:The combination of fieldbus technology and Ethernet technology is a hot spot in the field of industrial control. The stability of fieldbus and the flexibility of Ethernet can be realized. At present, the most widely used fieldbus is CAN bus and can bus, which has mature international standard and is regarded as one of the most promising fieldbus. In this paper, the soft core of CAN bus is designed with RTL on the FPGA platform of Altera, which is convenient for function cutting and transplanting. The protocol of Ethernet is realized by configuring triple-speed-megacore, a three-speed Ethernet IP core provided by Altera, and the development cost is reduced. Reduce the development cycle, and finally use SDRAM to store data to achieve the conversion between the two protocols. This paper has completed the following aspects of work: 1. The RTL design of CAN protocol is completed, including the design of read and write register, bit synchronization and bit stream manager. The read and write register is designed according to the running mechanism of SJA1000, and the working mode and baud rate of the CAN bus are configured by the read and write register. The state machine is used to realize the jump between the synchronization segment and the phase buffer segment 1 and the phase buffer section 2, thus the capture of the sampling point and the transmitting point is completed. The design of bit stream manager mainly realizes the function of bit coding CRC check and acceptance filter in data link layer. The simulation results and detailed analysis are given in each part. 2. The Ethernet protocol is realized by using the three-speed Ethernet IP core provided by Altera Company. This paper introduces the register inside the three-speed Ethernet IP core and the internal FIFO in detail, and finally realizes the function of Ethernet by configuring the inner register. The simulation results of Ethernet function realization are analyzed in detail. In addition, this paper introduces how to configure the interface of PHY, including management interface MDIO and data interface, and realizes Ethernet communication with PHY chip DP83658. 3. The control module of SDRAM is divided into three modules: state control module, command control module and read and write control module, in which the state control module mainly controls the transfer of SDRAM state. Including power-on initialization and working state, working state is divided into read, write, self-refresh and so on. The command control module realizes the interface control of SDRAM, and controls the normal operation of SDRAM through interface signal. The read-write control module realizes the read / write control of SDRAM and the data exchange with SDRAM. This paper introduces the design of each module in detail, and analyzes the waveform simulation diagram of two protocol conversion implementation. This paper realizes the conversion scheme from CAN protocol to Ethernet protocol based on FPGA, which has practical significance in practical application.
【學(xué)位授予單位】:北京郵電大學(xué)
【學(xué)位級別】:碩士
【學(xué)位授予年份】:2014
【分類號】:TP273;TP393.11
【參考文獻】
相關(guān)期刊論文 前10條
1 侯宏錄;張文芳;;基于FPGA的SDRAM控制器設(shè)計方案[J];兵工自動化;2012年02期
2 楊海濤;蘇濤;巫^j;;基于FPGA的SDRAM控制器的設(shè)計和實現(xiàn)[J];電子科技;2007年01期
3 陸明浩;現(xiàn)場總線的發(fā)展趨向——工業(yè)以太網(wǎng)的應(yīng)用[J];智能建筑與城市信息;2004年10期
4 詹俊鵬;李鵬;;基于Altera FPGA的千兆以太網(wǎng)實現(xiàn)方案[J];電子設(shè)計工程;2009年02期
5 徐木水;劉金國;;基于FPGA的CAN總線通信接口的設(shè)計[J];電子設(shè)計工程;2010年10期
6 陳榮軍;鐘秀媚;譚洪舟;丁顏玉;;一種基于FPGA的SDRAM數(shù)據(jù)讀取方法設(shè)計[J];電腦知識與技術(shù);2012年36期
7 劉存;周曉波;;基于FPGA的嵌入式千兆以太網(wǎng)接口設(shè)計[J];光通信技術(shù);2013年02期
8 鹿海霞;王丹麟;楊衛(wèi)民;;CAN總線協(xié)議到EtherCAT從站協(xié)議的轉(zhuǎn)換網(wǎng)關(guān)設(shè)計[J];單片機與嵌入式系統(tǒng)應(yīng)用;2013年02期
9 李壽強;;MATLAB和ModelSim聯(lián)合仿真在FPGA開發(fā)中的應(yīng)用[J];電子制作;2013年12期
10 王躍飛;侯亮;劉菲;;基于FPGA的汽車CAN網(wǎng)絡(luò)實時管理系統(tǒng)設(shè)計[J];電子測量與儀器學(xué)報;2013年08期
,本文編號:1956702
本文鏈接:http://sikaile.net/guanlilunwen/ydhl/1956702.html