關(guān)于FPGA的畢業(yè)論文_第1頁(yè)
關(guān)于FPGA的畢業(yè)論文_第2頁(yè)
關(guān)于FPGA的畢業(yè)論文_第3頁(yè)
關(guān)于FPGA的畢業(yè)論文_第4頁(yè)
關(guān)于FPGA的畢業(yè)論文_第5頁(yè)
已閱讀5頁(yè),還剩129頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、畢業(yè)論文辯論課題名稱:真空鍍膜機(jī)控制系統(tǒng) 的專用集成電路設(shè)計(jì) 目 錄引言總體設(shè)計(jì)方案單元電路設(shè)計(jì)總體電路設(shè)計(jì)外圍接口電路電路的硬件實(shí)現(xiàn)及調(diào)試參考文獻(xiàn) 返回一、引 言EDA技術(shù)是電子系統(tǒng)(集成電路)自動(dòng)化設(shè)計(jì)技術(shù).它是由70年代的CAD和80年代的CAE開(kāi)展而來(lái)的,是適應(yīng)微電子技術(shù)到不斷改進(jìn)和可編程邏輯器件的復(fù)雜程度越來(lái)越高的要求而出現(xiàn)的.其特點(diǎn)是高層次設(shè)計(jì)自動(dòng)化,引入了VHDL語(yǔ)言.隨著科技的不斷開(kāi)展、大規(guī)模集成電路的廣泛應(yīng)用,目前本課題選擇了采用PLD可編程邏輯控制器件設(shè)計(jì)真空鍍膜機(jī)的控制系統(tǒng),采用PLD開(kāi)發(fā)工具對(duì)芯片編程,直接將鍍膜機(jī)工藝流程寫(xiě)入集成芯片中,再外加少許必要的外圍電子元器件構(gòu)

2、成整個(gè)控制局部,選擇標(biāo)準(zhǔn)的數(shù)據(jù)通訊接口就可實(shí)現(xiàn)數(shù)據(jù)的交換,從而實(shí)現(xiàn)對(duì)真空鍍膜機(jī)工藝流程的全程監(jiān)控,到達(dá)工程應(yīng)用要求。采用FPGA設(shè)計(jì)的真空鍍膜機(jī)控制系統(tǒng)的優(yōu)點(diǎn)。返回選擇CPLD/FPGA的理由優(yōu)點(diǎn): 1 真空鍍膜機(jī)的控制系統(tǒng)設(shè)計(jì)趨于簡(jiǎn)單、開(kāi)發(fā)周期相對(duì)縮短; 2 整個(gè)控制系統(tǒng)的集成度較高、保密性大大提高; 3 控制局部所需元器件少,所占的空間??; 4 數(shù)據(jù)通訊結(jié)構(gòu)更趨于簡(jiǎn)單化; 5 系統(tǒng)的抗干擾性高,移植性好,維護(hù)更方便、快捷; 6 工程造價(jià)本錢(qián)大大降低;PLC設(shè)計(jì)本錢(qián)相對(duì)較高;單片機(jī)在惡劣的環(huán)境下抗干擾性能差,容易死機(jī)或進(jìn)入死循環(huán)(時(shí)序指令控制).返回二、設(shè)計(jì)要求本設(shè)計(jì)是關(guān)于太陽(yáng)能真空集熱管磁

3、控濺射鍍膜機(jī)自動(dòng)控制系統(tǒng)的設(shè)計(jì),太陽(yáng)能真空集熱管磁控濺射鍍膜機(jī)主要用于真空太陽(yáng)能集熱管生產(chǎn)中鍍制漸變的精確的化學(xué)配比氮化鋁膜。如圖2.1所示為鍍膜機(jī)的自動(dòng)操作流程圖,它是自動(dòng)控制系統(tǒng)的所要完成的對(duì)鍍膜過(guò)程和鍍膜工藝要求的控制,其中在“按設(shè)定工藝自動(dòng)運(yùn)行這一步,包括一個(gè)參數(shù)設(shè)定的過(guò)程。參數(shù)設(shè)定是指對(duì)鍍膜的時(shí)間、氮?dú)獾牧髁?、氬氣的流量、靶電流以及靶的選擇的設(shè)定,它是在自動(dòng)控制復(fù)位的狀態(tài)下根據(jù)工藝的要求由操作人員來(lái)完成的,設(shè)定后存儲(chǔ)在存儲(chǔ)器中以等待工藝運(yùn)行的調(diào)用。圖2.2整體設(shè)計(jì)的原理框圖。 返回返回返回注釋:表2.2所示為參數(shù)設(shè)定的一個(gè)樣本,層數(shù)是指鍍膜的層數(shù),也就是每一層所對(duì)應(yīng)的不同工藝參數(shù)的設(shè)

4、定,選靶設(shè)定的是靶的模式。返回層 數(shù)時(shí) 間(s)氬 氣(流量)氮 氣(流量)靶 電 流(A)選 靶 模 式 (備注)第一層56052401 啟動(dòng)靶1第二層152041453 啟動(dòng)靶3第三層302585557 啟動(dòng)靶1、2、3第四層113737345 啟動(dòng)靶1、3第五層651518476 啟動(dòng)靶2、3圖2.2整體設(shè)計(jì)的原理框圖 返回 三、單元電路設(shè)計(jì)* 工序流程控制模塊設(shè)計(jì)* 參數(shù)設(shè)置及調(diào)用模塊設(shè)計(jì)* 通訊模塊設(shè)計(jì)返回1、工序流程控制模塊設(shè)計(jì)* 設(shè)計(jì)的原理及思路* 設(shè)計(jì)的VHDL硬件描述* 設(shè)計(jì)的功能仿真返回設(shè)計(jì)的原理及思路“plate2是鍍膜機(jī)自動(dòng)運(yùn)行的控制系統(tǒng)模塊。其流程圖如圖2.1真空鍍膜

5、機(jī)自動(dòng)操作控制流程圖。此模塊采用了Moor型有限狀態(tài)機(jī)來(lái)描述的。其狀態(tài)機(jī)的狀態(tài)轉(zhuǎn)換圖如下圖。這是一個(gè)17個(gè)狀態(tài)的狀態(tài)轉(zhuǎn)換圖,它包含了整個(gè)工序控制的流程。其中“count是一個(gè)計(jì)數(shù)器,在狀態(tài)轉(zhuǎn)換中作為定時(shí)器用;其他的都是作為狀態(tài)之間轉(zhuǎn)換的條件,在程序中已做了說(shuō)明,沒(méi)有標(biāo)條件是一種“無(wú)條件的轉(zhuǎn)換,即當(dāng)前狀態(tài)運(yùn)行完成后直接把下一個(gè)狀態(tài)作為當(dāng)前狀態(tài);狀態(tài)“NONE表示第一十七狀態(tài),由于所用的軟件中最多只能編輯16個(gè)狀態(tài)。返回返回設(shè)計(jì)的VHDL硬件描述library IEEE;use IEEE.STD_LOGIC_1164.ALL;-use IEEE.STD_LOGIC_ARITH.ALL;use IE

6、EE.STD_LOGIC_UNSIGNED.ALL;entity plate2 is Port ( clock : in std_logic; -時(shí)鐘 reset : in std_logic; -復(fù)位 atom_hand: in std_logic; -自動(dòng)/手動(dòng) runfin : in std_logic; -運(yùn)行完畢 takefin : in std_logic; -開(kāi)門(mén)信號(hào) vacuity2 : in std_logic; -真空度2 airpressure : in std_logic; -真空度3 返回 buttvoltage : in std_logic; -靶電壓 -craft

7、autorun : in std_logic; machinpump : out std_logic; -機(jī)械泵 beforeluntvalve : out std_logic; -預(yù)抽閥 prevalve : out std_logic; -前級(jí)閥 highvalve : out std_logic; -高閥 maintainvalve : out std_logic; -維持閥 maintainpump : out std_logic; -維持泵 lightbarriervalve : out std_logic; -光欄閥 cutvalve : out std_logic; -截止閥 n

8、itrogencontrol : out std_logic; -氮?dú)饪刂?argoncontrol : out std_logic; -氬氣控制 workpiecerun : out std_logic; -工件旋轉(zhuǎn) buttrun : out std_logic; -靶旋轉(zhuǎn) buttcurrent1 : out std_logic; -靶電流 返回craftrun : out std_logic; -工藝自動(dòng)運(yùn)行warnin : out std_logic; -報(bào)警aeratevalve : out std_logic; -充氣閥 onoffdoor : out std_logic); -

9、關(guān)門(mén)信號(hào)end plate2;architecture Behavioral of plate2 istype state is -狀態(tài)的枚舉定義(state1,state2,state3,state4,state5,state6,state7,state8,state9,state10,state11,state12,state13,state14,state15,state16,state17);signal presentstate: state;signal int,int0: integer;signal clk:std_logic;-signal clock:std_logic;b

10、egin返回p0: process(clk,reset) -主控時(shí)序進(jìn)程 variable count,count0: integer; begin if reset=0 then count:=0;count0:=0; presentstate if atom_hand=1 thenpresentstate count:= count+1; if count=3 then count:=0;presentstatecount:=count+1;int=count; if count360 and vacuity1=1 then count:=0; presentstate count:=co

11、unt+1; if count=2 then count:=0; presentstate count:=count+1; if count=2 then count:=0;返回 presentstate presentstatecount0:=count0+1;int0=count0; if count02700 and vacuity2=1 then count0:=0;presentstate if airpressure=1 thenpresentstate if buttvoltage=1 then返回 presentstate if runfin=1 then presentsta

12、te presentstate presentstate count:=count+1; if count=2 then count:=0;presentstate count:=count+1;返回 if count=2 then count:=0; presentstate count:=count+1; int65 then count:=0;presentstate if takefin=1 then presentstate presentstate presentstate=360 then warning0:=1; end if; elsif presentstate=state

13、4 then beforeluntvalve0:=0;elsif presentstate=state5 then prevalve0:=1; elsif presentstate=state6 then highvalve0:=1;返回maintainvalve0:=0;elsif presentstate=state7 then maintainpump0:=0;if int0=2700 then warning0:=1;end if;elsif presentstate=state8 then lightbarriervalve0:=1; cutvalve0:=1; nitrogenco

14、ntrol0:=1; argoncontrol0:=1;elsif presentstate=state9 then workpiecerun0:=1; buttrun0:=1;buttcurrent10:=1; elsif presentstate=state10 then craftrun0:=1;elsif presentstate=state11 then返回 buttcurrent10:=0; lightbarriervalve0:=0; craftrun0:=0; cutvalve0:=0; nitrogencontrol0:=0; argoncontrol0:=0; buttru

15、n0:=0; elsif presentstate=state12 thenhighvalve0:=0;maintainpump0:=1; elsif presentstate=state13 then maintainvalve0:=1; elsif presentstate=state14 then prevalve0:=0; elsif presentstate=state15 then machinpump0:=0; if int=5 then返回 aeratevalve0:=1; end if;if int=65 then aeratevalve0:=0; end if;elsif

16、presentstate=state16 then onoffdoor0:=1;elsif presentstate=state17 then onoffdoor0:=0; workpiecerun0:=0; end if; end if;warnin=warning0;machinpump=machinpump0;beforeluntvalve=beforeluntvalve0;prevalve=prevalve0;highvalve=highvalve0;返回maintainvalve=maintainvalve0;maintainpump=maintainpump0;lightbarri

17、ervalve=lightbarriervalve0; cutvalve=cutvalve0;nitrogencontrol=nitrogencontrol0; argoncontrol=argoncontrol0;workpiecerun=workpiecerun0;buttcurrent1=buttcurrent10; craftrun=craftrun0; aeratevalve=aeratevalve0; onoffdoor=onoffdoor0; buttrun=buttrun0;end process p2;counter: process(clock) -32兆的分頻器 vari

18、able count2: integer; variable clk0: std_logic;begin返回 if clockevent and clock=1 then count2:=count2+1; if count2=16000000 then clk0:=0; elsif count2=32000000 then count2:=0; clk0:=1; end if;end if;clkfin,b=fout1,c=ca,s=wrt); -“con2的映射u2:con1port map(x=cssz,y(0)=cs1,y(1)=cs2,y(2)=cs3,y(3)=cs4, y(4)=

19、cs5);-“con1的映射u3:sram1 port map(cs=cs1,wr=wrt,adr=ca,din=dint,dout=douts1,clk=clkj); -“sram1(時(shí)間)的映射u4:sram1 port map(cs=cs2,wr=wrt,adr=ca,din=dint,dout=doutb,clk=clkj); -“sram1(氬氣)的映射u5:sram1 port map(cs=cs3,wr=wrt,adr=ca,din=dint,dout=doutc,clk=clkj); -“sram1(氮?dú)?的映射u6:sram1 port map(cs=cs4,wr=wrt,a

20、dr=ca,din=dint,dout=doutd,clk=clkj); -“sram1(靶電流)的映射u7:sram1 port map(cs=cs5,wr=wrt,adr=ca,din=dint, dout=douts2,clk=clkj); -“sram1(靶數(shù))的映射返回u8:sconter port map(dd=douts1,clk=clk1,f=fout1, f0=fout,en=wrt,qq=douta); -“sconter(遞減計(jì)數(shù)器)的映射u9:con3 port map(m=douts2,n=yt,over=ov); -“con3的映射u10:pulse port ma

21、p(en=wrt,clock=clkj,clk=clk1); -“pulse的映射u11:decoder port map(seg(3)=douta(7),seg(2)=douta(6),seg(1)=douta(5), seg(0)=douta(4),q3=douta1); -“decoder的映射u12:decoder port map(seg(3)=douta(3),seg(2)=douta(2),seg(1)=douta(1),seg(0)=douta(0),q3=douta2);u13:decoder port map(seg(3)=doutb(7),seg(2)=doutb(6),

22、seg(1)=doutb(5),seg(0)=doutb(4),q3=doutb1);u14:decoder port map(seg(3)=doutb(3),seg(2)=doutb(2),seg(1)=doutb(1),seg(0)=doutb(0),q3=doutb2);返回u15:decoder port map(seg(3)=doutc(7),seg(2)=doutc(6),seg(1)= doutc(5),seg(0)=doutc(4),q3=doutc1);u16:decoder port map(seg(3)=doutc(3),seg(2)=doutc(2),seg(1)= d

23、outc(1), seg(0)=doutc(0),q3=doutc2);u17:decoder port map(seg(3)=doutd(7),seg(2)=doutd(6),seg(1)= doutd(5),seg(0)=doutd(4),q3=doutd1);u18:decoder port map(seg(3)=doutd(3),seg(2)=doutd(2),seg(1)= doutd(1),seg(0)=doutd(0),q3=doutd2);end struct; 返回設(shè)計(jì)的功能仿真返回圖參數(shù)設(shè)置及調(diào)用的譯碼功能仿真1返回圖參數(shù)設(shè)置及調(diào)用的功能仿真2如圖,不帶譯碼器的參數(shù)設(shè)置及調(diào)

24、用的功能仿真Pulse的VHDL硬件描述library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity pulse is Port ( clock,en:in std_logic; clk:out std_logic );end pulse;architecture Behavioral of pulse isbegincounter: process(clock,en) variable count2: integer;variable c

25、lk0: std_logic;返回begin if en=0 then count2:=0; clk0:=0; elsif clockevent and clock=1 then count2:=count2+1; if count2=16000000 then clk0:=1; elsif count2=32000000 then count2:=0; clk0:=0;end if;end if;clk=clk0; end process counter;end Behavioral;返回圖分頻器仿真 返回con1的VHDL硬件描述library IEEE;use IEEE.STD_LOGI

26、C_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity con1 isport(x: in std_logic_vector(3 downto 0); y:out std_logic_vector(4 downto 0);end con1;architecture one of con1 isbeginwith x selecty=11110 when 0001,11101 when 0010,返回11011when 0011,10111when 0100,01111when 0101,111

27、11when others;end one;返回圖 con1的仿真 返回Con2的VHDL硬件描述library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity con2 isport(a,b:in std_logic_vector(3 downto 0); s:in std_logic; c:out std_logic_vector(3 downto 0);end con2;architecture one of con2 isbeginp

28、rocess(s,a,b)beginif s =0 then c=a;返回else cn=000;overn=001;overn=010;overn=100;overn=011;overn=101;overn=110;overn=111;overn=000;overn=000;end case;end process;end one;返回圖的功能仿真 返回Sram1的VHDL硬件描述library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entit

29、y sram1 isport (wr,cs,clk: in std_logic; -讀寫(xiě)控制,片選,時(shí)鐘的定義 adr:in std_logic_vector(3 downto 0); -地址的定義 din:in std_logic_vector(7 downto 0); -數(shù)據(jù)輸入的定義 dout:out std_logic_vector(7 downto 0); -數(shù)據(jù)輸出的定義end sram1;architecture behav of sram1 issubtype word is std_logic_vector(7 downto 0);-數(shù)組定義word type memory

30、is array(0 to 15) of word;返回signal sram: memory;signal adr_in: integer range 0 to 15;beginadr_in =conv_integer(adr); -二進(jìn)制轉(zhuǎn)換為十進(jìn)制的地址write: process(wr,cs,adr_in,din,sram,clk) -寫(xiě)入srambegin if clkevent and clk=1 then if cs=0 and wr=0 then sram(adr_in)=din; end if; end if;end process;read: process(adr_in,

31、wr,sram,clk) -讀出srambegin if clkevent and clk=1 then 返回if (wr=1) then dout=sram(adr_in); else doutZ); end if; end if;end process;end behav;返回圖的功能仿真 返回Sconter的VHDL硬件描述library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity sconter isport(clk,en:in std_logic; -時(shí)鐘,復(fù)位 dd:in std_l

32、ogic_vector(7 downto 0); -可預(yù)置輸入 qq:out std_logic_vector(7 downto 0); -遞減的輸出 f,f0:out std_logic_vector(3 downto 0); -層數(shù)的輸出end sconter;architecture behav of sconter isbeginprocess(en,clk)variable scnt:std_logic_vector(7 downto 0);返回variable sc,sc1:std_logic_vector(3 downto 0 );beginif en=0 then scnt:=

33、00000000; -復(fù)位狀態(tài) sc:=0000; sc1:=sc-1;f=sc; elsif (clkevent and clk=1) then if scnt=00000000 then -置數(shù)計(jì)數(shù)狀態(tài) scnt:=dd; sc1:=sc1+1; f=sc1; f0=sc1; qq=scnt;elsif scnt=“00010000 then scnt:=“00001001;qq=scnt; -輸出層數(shù) -譯碼器顯示elsif scnt=00100000 then scnt:=00011001;qq=scnt;返回elsif scnt=00110000 then scnt:=0010100

34、1;qq=scnt;elsif scnt=01000000 then scnt:=00111001;qq=scnt;elsif scnt=01010000 then scnt:=01001001;qq=scnt;elsif scnt=01100000 then scnt:=01011001;qq=scnt;elsif scnt=01110000 then scnt:=01101001;qq=scnt;elsif scnt=10000000 then scnt:=01111001;qq=scnt;elsif scnt=10010000 then scnt:=10001001;qq=scnt;el

35、se scnt:=scnt-1;qqq3q3q3q3q3q3q3q3q3q3q3=1111111; -0 end case;end process;end Behavioral;返回圖為“decoder的功能仿真 返回3、通訊模塊設(shè)計(jì)* UART的設(shè)計(jì)原理* UART的頂層映射的VHDL硬件描述* UART的頂層映射的功能仿真* Pulse的設(shè)計(jì)* R_UART的設(shè)計(jì)* T _UART的設(shè)計(jì)* Comparator的設(shè)計(jì)返回UART的設(shè)計(jì)原理我們?cè)谶@里是作為真空鍍膜機(jī)的FPGA控制器同復(fù)合真空計(jì)的通信接口。圖異步收發(fā)器的原理框圖,分成四個(gè)子模塊和一個(gè)總模塊:波特率發(fā)生器、接收模塊、發(fā)送模塊、比

36、較器,頂層映射模塊。在這里采用了4800bps的波特率,在采樣是采用了波特周期的1/8的時(shí)鐘;接收的是六個(gè)八位的數(shù)據(jù),因此每開(kāi)始接收六幀的數(shù)據(jù)作為并行輸出;發(fā)送機(jī)發(fā)送的是八位的握手信號(hào)30H。其UART的數(shù)據(jù)幀格式見(jiàn)表。由于串行數(shù)據(jù)幀和接收機(jī)時(shí)鐘是異步的,把邏輯1轉(zhuǎn)為邏輯0作為一個(gè)數(shù)據(jù)幀的起始位。然而為了防止毛刺影響,能夠得到正確的起始位,必須要求接收到的起始位在波特率時(shí)鐘采樣的過(guò)程中至少有一半都是屬于邏輯0才認(rèn)為接收到的是起始位。因此起始位需要至少4個(gè)連續(xù)波特時(shí)鐘bclk周期的邏輯0被接收,才認(rèn)為起始位接收到,接著數(shù)據(jù)位和奇偶校驗(yàn)位將隔8個(gè)連續(xù)bclk周期被采樣一次,即將在每個(gè)位的中點(diǎn)處被采

37、樣。返回STARTD0D1D2D3D4D5D6D7PSTOP起始位數(shù)據(jù)位校驗(yàn)位停止位UART的數(shù)據(jù)幀格式 圖異步收發(fā)器的原理框圖 返回圖異步收發(fā)器的映射原理圖 返回UART頂層映射的VHDL硬件描述此頂層映射的VHDL程序不包含比較器“comparator。library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity toprt is Port (clk : in std_logic; -波特時(shí)鐘 reset : in std_logic;

38、 -復(fù)位信號(hào) rxd : in std_logic; -接收信號(hào) txd : out std_logic; -發(fā)送信號(hào) ready0:out std_logic; -準(zhǔn)備信號(hào) warning1 : out std_logic; -報(bào)警提示 rout0 : out std_logic_vector(7 downto 0); -接收數(shù)據(jù)的輸出 rout1 : out std_logic_vector(7 downto 0);返回rout2 : out std_logic_vector(7 downto 0); rout3 : out std_logic_vector(7 downto 0);rou

39、t4 : out std_logic_vector(7 downto 0);rout5 : out std_logic_vector(7 downto 0); d_out : out STD_LOGIC_VECTOR(6 downto 0);-提示信號(hào)輸出end toprt;architecture Behavioral of toprt iscomponent pulsetr port(clk:in std_logic; reset:in std_logic; bclk:out std_logic);end component;component t_uart port(bclk,reset

40、:in std_logic; ready:in std_logic; txd:out std_logic);end component;返回component r_uart port(reset,bclk:in std_logic; rxd:in std_logic; rout0 : out std_logic_vector(7 downto 0); rout1 : out std_logic_vector(7 downto 0); rout2 : out std_logic_vector(7 downto 0); rout3 : out std_logic_vector(7 downto 0

41、); rout4 : out std_logic_vector(7 downto 0); rout5 : out std_logic_vector(7 downto 0); RxdInRegout:out std_logic_vector(6 downto 0); ready,warning1:out std_logic);end component;signal ready,bclk:std_logic;signal RxdInRegout : std_logic_vector(3 downto 0);beginu1:r_uart port返回map(reset,bclk,rxd,rout0

42、,rout1,rout2,rout3,rout4,rout5,d_out,ready,warning1);u2:t_uart port map(bclk,reset,ready,txd);u3: pulsetr port map(clk,reset,bclk);ready0=ready;end Behavioral;返回UART的頂層映射的功能仿真圖 UART頂層映射的仿真圖,它是整個(gè)RS232通信接口的仿制,在復(fù)位reset=1的情況下,接收機(jī)接收的數(shù)據(jù)以并行的格式輸出即rtout=“01001101;rtclk為波特時(shí)鐘,在這里輸出只是為了仿真的方便和更加正確的分析仿真結(jié)果的精確性;zko

43、ut是發(fā)送機(jī)發(fā)出的握手信號(hào)30H,它以串行的格式發(fā)送到真空計(jì)的接收端,使得真空計(jì)確認(rèn)后發(fā)送數(shù)據(jù),在數(shù)據(jù)發(fā)送和接收時(shí),它是置高電平即zkout=1。返回圖 UART頂層映射的仿真1 返回圖 UART頂層映射的仿真2 返回圖 UART頂層映射的仿真3 返回Pulse的VHDL硬件描述library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity pulsetr is generic(bitl:integer:=1; n:integer:=8);

44、Port (clk:in std_logic; reset:in std_logic; bclk:out std_logic);end pulsetr;architecture Behavioral of pulsetr isbegin返回process(clk,reset)variable count:integer;variable rclk:std_logic;begin if reset=0 then count:=1; rclk:=0; elsif clkevent and clk=1 then if count=320000000/(bitl*n) then rclk:=not r

45、clk; count:=count+1; elsif count=320000000/(bitl*n*2) then rclk:=not rclk; count:=1; else返回count:=count+1;end if;end if;bclk=rclk;end process;end Behavioral;返回如圖分頻器的功能仿真 返回R_UART的設(shè)計(jì)圖接收機(jī)R_UART的流程圖。接收機(jī)根據(jù)UART的數(shù)據(jù)格式,也包括一位的起始位0、八位的數(shù)據(jù)位和一位的停止位1,在起始位到來(lái)之前,接收的數(shù)據(jù)都是1,處于高電平,當(dāng)?shù)碗娖?到來(lái)時(shí),表示起始位到來(lái),開(kāi)始發(fā)送數(shù)據(jù)位,在數(shù)據(jù)位接收完后,對(duì)下一位停

46、止位進(jìn)行檢測(cè)此處沒(méi)有考慮校驗(yàn)位,當(dāng)檢測(cè)到停止位1時(shí),表示接收的數(shù)據(jù)正確,此幀的數(shù)據(jù)發(fā)送接收完成,準(zhǔn)備下一幀數(shù)據(jù)的接收。圖接收機(jī)R_UART的狀態(tài)轉(zhuǎn)換圖。返回返回圖接收機(jī)R_UART的原理圖 圖接收機(jī)R_UART的狀態(tài)轉(zhuǎn)換圖 返回R_UART的VHDL硬件描述library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity R_UART is generic(bitn:integer :=4; n:integer :=8); Port (rese

47、t,bclk:in std_logic; -復(fù)位信號(hào)、波特時(shí)鐘 rxd:in std_logic; -接收信號(hào) rout0 : out std_logic_vector(7 downto 0); -接收數(shù)據(jù)的輸出 rout1 : out std_logic_vector(7 downto 0); rout2 : out std_logic_vector(7 downto 0); rout3 : out std_logic_vector(7 downto 0);返回 rout4 : out std_logic_vector(7 downto 0); rout5 : out std_logic_v

48、ector(7 downto 0); RxdInRegout:out std_logic_vector(6 downto 0);-提示信號(hào)輸出 ready,warning1:out std_logic); -準(zhǔn)備信號(hào)、報(bào)警提示end R_UART ;architecture Behavioral of R_UART istype states is (pstart,rstart,rwait,rsample,rstop);signal cstate:states; signal int:std_logic_vector( 0 to 2); beginp0:process(bclk,reset,r

49、xd)SUBTYPE BYTE IS STD_LOGIC_VECTOR(7 DOWNTO 0);type RAM_type IS ARRAY (0 TO 7)of byte; variable sRAM:RAM_type;variable rcntb,rcntd,rcnt,cnt:integer range 0 to 9;返回 variable cnt1:std_logic_vector(3 downto 0); variable count:integer range 0 to integerhigh;variable r0: std_logic;variable reg: std_logi

50、c_vector(15 downto 0);variable RxdInReg: std_logic_vector(3 downto 0);begin if reset=0 then -復(fù)位狀態(tài) reg:=0000000000000000; rcntb:=0; int=000; rcntd:=0; warning1=0; cstate=pstart; RxdInRegout = 0110000; rout0=00000000; rout1=00000000; rout2=00000000;返回 rout3=00000000; rout4=00000000; rout5 -預(yù)備開(kāi)始狀態(tài) rcnt

51、b:=0; SRAM(0):=00000000; SRAM(1):=00000000; SRAM(2):=00000000; SRAM(3):=00000000; SRAM(4):=00000000; SRAM(5):=00000000; RxdInRegout=0110000; cnt:=0;返回int=000;cnt1:=0000;count:=0;rcntd:=0;r0:=0; reg:=0000000000000000;ready=1; cstate -開(kāi)始狀態(tài) RxdInReg:=0000; ready=0; if rxd=0 then if cnt=4 then cstate=rw

52、ait;返回 cnt:=0; else cnt:=cnt+1; end if; else cstate=rstart; cnt:=0; end if;r0:=0;- rd -等待狀態(tài) if rcntb=6 then rcntb:=0; cstate RxdInRegout RxdInRegout RxdInRegout RxdInRegout RxdInRegout RxdInRegout RxdInRegout RxdInRegout RxdInRegout RxdInRegout RxdInRegout = 0110000; end case; end if;rcntb:=rcntb+1;

53、返回 cstate -采樣狀態(tài)reg(conv_integer(cnt1):=rxd; if cnt1=8 then cstate=rstop; cnt1:=0000; else cstate -停止?fàn)顟B(tài) if reg(8)=0 then if rcnt=2 then warning1=1; rcnt:=0;返回int=000; else cstate=5 THEN int=000; if count=0 then rout0=SRAM(0); rout1=SRAM(1); rout2=SRAM(2); rout3=SRAM(3); rout4=SRAM(4); rout5=SRAM(5);返

54、回 end if; if count=bitn*n/2 then -分頻等待0.5秒 cstate=pstart;count:=0; else cstate=rstop; count:=count+1; end if; else int=int+1; CSTATE cstate=pstart;end case;end if;end process p0;end Behavioral;返回圖為接收機(jī)R_UART的仿真圖 1返回圖為接收機(jī)R_UART的仿真圖 2返回T _UART的設(shè)計(jì)原理及思路圖為發(fā)送機(jī)的狀態(tài)轉(zhuǎn)換圖 返回T _UART的VHDL硬件描述library IEEE;use IEEE.

55、STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity t_uatr isPort (bclk,reset:in std_logic; -波特時(shí)鐘、復(fù)位信號(hào) ready:in std_logic; -接收機(jī)發(fā)出的準(zhǔn)備信號(hào) txd:out std_logic ); -握手信號(hào)30H輸出end t_uatr;architecture Behavioral of t_uatr istype states is(tidle,twait,tshift);signal cstate:sta

56、tes;返回beginp0:process(reset,ready,bclk)variable handsign:std_logic_vector(9 downto 0);variable ttout:std_logic;variable tcnt:std_logic_vector(3 downto 0);variable tcntd:integer range 0 to 9;begin if reset=0 then -復(fù)位狀態(tài) cstate -空閑狀態(tài)ttout:=1;返回 tcntd:=0;txd=ttout; handsign:=1001100000; if ready=1 then

57、cstate=tshift; else cstate -等待狀態(tài) if tcnt=6 then cstate=tshift; tcnt:=0000;tcntd:=tcntd+1; else tcnt:=tcnt+1; cstate -發(fā)送數(shù)據(jù)狀態(tài) ttout:=handsign(tcntd); txd=ttout; if tcntd=9 then cstate=tidle; tcntd:=0; else cstate=twait; end if; -txd=ttout;end case;end if;end process;end Behavioral;返回圖為發(fā)送機(jī)的仿真圖 返回Compar

58、e的VHDL硬件描述library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity compare is Port ( cutvalve:in std_logic; Din1 : in std_logic_vector(7 downto 0); Din2 : in std_logic_vector(7 downto 0); Din3 : in std_logic_vector(7 downto 0); v1 : out std_logic;

59、v2 : out std_logic; v3 : out std_logic);end compare;返回architecture Behavioral of compare issignal Din:std_logic_vector(15 downto 0);begin Din=Din1&Din2; process(Din,Din3,cutvalve) begin if cutvalve=0 and Din=x8909 then v1=1; else v1=0; end if; if cutvalve=0 and Din=2 then v2=1;else v2=x8300 and (Din

60、3(7)=1and Din3(6 downto 0)=1)or Din3(7)=0) then v3=1;else v3=0; end if;end process; end Behavioral;返回圖3.3.5.4.1 compare的功能仿真 返回四、總體電路設(shè)計(jì)圖4.1總體電路系統(tǒng)設(shè)計(jì)的映射原理圖 返回五、外圍接口電路* 先進(jìn)的HMI觸摸屏 * 復(fù)合真空計(jì) * 質(zhì)量流量計(jì) * 恒流源電路* 報(bào)警器及保護(hù)電路 返回先進(jìn)的HMI觸摸屏觸摸顯示器是將觸摸屏和顯示器集成于一體的觸摸顯示設(shè)備,是最簡(jiǎn)單、方便、自然的人機(jī)交互設(shè)備。有CRT觸摸顯示器和LCD觸摸顯示器。主要應(yīng)用于辦公室、家庭、會(huì)議場(chǎng)

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論