版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、畢業(yè)論文辯論課題名稱:真空鍍膜機控制系統(tǒng) 的專用集成電路設計 目 錄引言總體設計方案單元電路設計總體電路設計外圍接口電路電路的硬件實現(xiàn)及調(diào)試參考文獻 返回一、引 言EDA技術是電子系統(tǒng)(集成電路)自動化設計技術.它是由70年代的CAD和80年代的CAE開展而來的,是適應微電子技術到不斷改進和可編程邏輯器件的復雜程度越來越高的要求而出現(xiàn)的.其特點是高層次設計自動化,引入了VHDL語言.隨著科技的不斷開展、大規(guī)模集成電路的廣泛應用,目前本課題選擇了采用PLD可編程邏輯控制器件設計真空鍍膜機的控制系統(tǒng),采用PLD開發(fā)工具對芯片編程,直接將鍍膜機工藝流程寫入集成芯片中,再外加少許必要的外圍電子元器件構
2、成整個控制局部,選擇標準的數(shù)據(jù)通訊接口就可實現(xiàn)數(shù)據(jù)的交換,從而實現(xiàn)對真空鍍膜機工藝流程的全程監(jiān)控,到達工程應用要求。采用FPGA設計的真空鍍膜機控制系統(tǒng)的優(yōu)點。返回選擇CPLD/FPGA的理由優(yōu)點: 1 真空鍍膜機的控制系統(tǒng)設計趨于簡單、開發(fā)周期相對縮短; 2 整個控制系統(tǒng)的集成度較高、保密性大大提高; 3 控制局部所需元器件少,所占的空間?。?4 數(shù)據(jù)通訊結構更趨于簡單化; 5 系統(tǒng)的抗干擾性高,移植性好,維護更方便、快捷; 6 工程造價本錢大大降低;PLC設計本錢相對較高;單片機在惡劣的環(huán)境下抗干擾性能差,容易死機或進入死循環(huán)(時序指令控制).返回二、設計要求本設計是關于太陽能真空集熱管磁
3、控濺射鍍膜機自動控制系統(tǒng)的設計,太陽能真空集熱管磁控濺射鍍膜機主要用于真空太陽能集熱管生產(chǎn)中鍍制漸變的精確的化學配比氮化鋁膜。如圖2.1所示為鍍膜機的自動操作流程圖,它是自動控制系統(tǒng)的所要完成的對鍍膜過程和鍍膜工藝要求的控制,其中在“按設定工藝自動運行這一步,包括一個參數(shù)設定的過程。參數(shù)設定是指對鍍膜的時間、氮氣的流量、氬氣的流量、靶電流以及靶的選擇的設定,它是在自動控制復位的狀態(tài)下根據(jù)工藝的要求由操作人員來完成的,設定后存儲在存儲器中以等待工藝運行的調(diào)用。圖2.2整體設計的原理框圖。 返回返回返回注釋:表2.2所示為參數(shù)設定的一個樣本,層數(shù)是指鍍膜的層數(shù),也就是每一層所對應的不同工藝參數(shù)的設
4、定,選靶設定的是靶的模式。返回層 數(shù)時 間(s)氬 氣(流量)氮 氣(流量)靶 電 流(A)選 靶 模 式 (備注)第一層56052401 啟動靶1第二層152041453 啟動靶3第三層302585557 啟動靶1、2、3第四層113737345 啟動靶1、3第五層651518476 啟動靶2、3圖2.2整體設計的原理框圖 返回 三、單元電路設計* 工序流程控制模塊設計* 參數(shù)設置及調(diào)用模塊設計* 通訊模塊設計返回1、工序流程控制模塊設計* 設計的原理及思路* 設計的VHDL硬件描述* 設計的功能仿真返回設計的原理及思路“plate2是鍍膜機自動運行的控制系統(tǒng)模塊。其流程圖如圖2.1真空鍍膜
5、機自動操作控制流程圖。此模塊采用了Moor型有限狀態(tài)機來描述的。其狀態(tài)機的狀態(tài)轉換圖如下圖。這是一個17個狀態(tài)的狀態(tài)轉換圖,它包含了整個工序控制的流程。其中“count是一個計數(shù)器,在狀態(tài)轉換中作為定時器用;其他的都是作為狀態(tài)之間轉換的條件,在程序中已做了說明,沒有標條件是一種“無條件的轉換,即當前狀態(tài)運行完成后直接把下一個狀態(tài)作為當前狀態(tài);狀態(tài)“NONE表示第一十七狀態(tài),由于所用的軟件中最多只能編輯16個狀態(tài)。返回返回設計的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; -時鐘 reset : in std_logic; -復位 atom_hand: in std_logic; -自動/手動 runfin : in std_logic; -運行完畢 takefin : in std_logic; -開門信號 vacuity2 : in std_logic; -真空度2 airpressure : in std_logic; -真空度3 返回 buttvoltage : in std_logic; -靶電壓 -craft
7、autorun : in std_logic; machinpump : out std_logic; -機械泵 beforeluntvalve : out std_logic; -預抽閥 prevalve : out std_logic; -前級閥 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; -氮氣控制 argoncontrol : out std_logic; -氬氣控制 workpiecerun : out std_logic; -工件旋轉 buttrun : out std_logic; -靶旋轉 buttcurrent1 : out std_logic; -靶電流 返回craftrun : out std_logic; -工藝自動運行warnin : out std_logic; -報警aeratevalve : out std_logic; -充氣閥 onoffdoor : out std_logic); -
9、關門信號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) -主控時序進程 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(時間)的映射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(氮氣)的映射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(遞減計數(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ù)設置及調(diào)用的譯碼功能仿真1返回圖參數(shù)設置及調(diào)用的功能仿真2如圖,不帶譯碼器的參數(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; -讀寫控制,片選,時鐘的定義 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); -二進制轉換為十進制的地址write: process(wr,cs,adr_in,din,sram,clk) -寫入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; -時鐘,復位 dd:in std_l
32、ogic_vector(7 downto 0); -可預置輸入 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; -復位狀態(tài) sc:=0000; sc1:=sc-1;f=sc; elsif (clkevent and clk=1) then if scnt=00000000 then -置數(shù)計數(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、通訊模塊設計* UART的設計原理* UART的頂層映射的VHDL硬件描述* UART的頂層映射的功能仿真* Pulse的設計* R_UART的設計* T _UART的設計* Comparator的設計返回UART的設計原理我們在這里是作為真空鍍膜機的FPGA控制器同復合真空計的通信接口。圖異步收發(fā)器的原理框圖,分成四個子模塊和一個總模塊:波特率發(fā)生器、接收模塊、發(fā)送模塊、比
36、較器,頂層映射模塊。在這里采用了4800bps的波特率,在采樣是采用了波特周期的1/8的時鐘;接收的是六個八位的數(shù)據(jù),因此每開始接收六幀的數(shù)據(jù)作為并行輸出;發(fā)送機發(fā)送的是八位的握手信號30H。其UART的數(shù)據(jù)幀格式見表。由于串行數(shù)據(jù)幀和接收機時鐘是異步的,把邏輯1轉為邏輯0作為一個數(shù)據(jù)幀的起始位。然而為了防止毛刺影響,能夠得到正確的起始位,必須要求接收到的起始位在波特率時鐘采樣的過程中至少有一半都是屬于邏輯0才認為接收到的是起始位。因此起始位需要至少4個連續(xù)波特時鐘bclk周期的邏輯0被接收,才認為起始位接收到,接著數(shù)據(jù)位和奇偶校驗位將隔8個連續(xù)bclk周期被采樣一次,即將在每個位的中點處被采
37、樣。返回STARTD0D1D2D3D4D5D6D7PSTOP起始位數(shù)據(jù)位校驗位停止位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; -波特時鐘 reset : in std_logic;
38、 -復位信號 rxd : in std_logic; -接收信號 txd : out std_logic; -發(fā)送信號 ready0:out std_logic; -準備信號 warning1 : out std_logic; -報警提示 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);-提示信號輸出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頂層映射的仿真圖,它是整個RS232通信接口的仿制,在復位reset=1的情況下,接收機接收的數(shù)據(jù)以并行的格式輸出即rtout=“01001101;rtclk為波特時鐘,在這里輸出只是為了仿真的方便和更加正確的分析仿真結果的精確性;zko
43、ut是發(fā)送機發(fā)出的握手信號30H,它以串行的格式發(fā)送到真空計的接收端,使得真空計確認后發(fā)送數(shù)據(jù),在數(shù)據(jù)發(fā)送和接收時,它是置高電平即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的設計圖接收機R_UART的流程圖。接收機根據(jù)UART的數(shù)據(jù)格式,也包括一位的起始位0、八位的數(shù)據(jù)位和一位的停止位1,在起始位到來之前,接收的數(shù)據(jù)都是1,處于高電平,當?shù)碗娖?到來時,表示起始位到來,開始發(fā)送數(shù)據(jù)位,在數(shù)據(jù)位接收完后,對下一位停
46、止位進行檢測此處沒有考慮校驗位,當檢測到停止位1時,表示接收的數(shù)據(jù)正確,此幀的數(shù)據(jù)發(fā)送接收完成,準備下一幀數(shù)據(jù)的接收。圖接收機R_UART的狀態(tài)轉換圖。返回返回圖接收機R_UART的原理圖 圖接收機R_UART的狀態(tài)轉換圖 返回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; -復位信號、波特時鐘 rxd:in std_logic; -接收信號 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);-提示信號輸出 ready,warning1:out std_logic); -準備信號、報警提示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 -復位狀態(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 -預備開始狀態(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 -開始狀態(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 -停止狀態(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;返回圖為接收機R_UART的仿真圖 1返回圖為接收機R_UART的仿真圖 2返回T _UART的設計原理及思路圖為發(fā)送機的狀態(tài)轉換圖 返回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; -波特時鐘、復位信號 ready:in std_logic; -接收機發(fā)出的準備信號 txd:out std_logic ); -握手信號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 -復位狀態(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ā)送機的仿真圖 返回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的功能仿真 返回四、總體電路設計圖4.1總體電路系統(tǒng)設計的映射原理圖 返回五、外圍接口電路* 先進的HMI觸摸屏 * 復合真空計 * 質(zhì)量流量計 * 恒流源電路* 報警器及保護電路 返回先進的HMI觸摸屏觸摸顯示器是將觸摸屏和顯示器集成于一體的觸摸顯示設備,是最簡單、方便、自然的人機交互設備。有CRT觸摸顯示器和LCD觸摸顯示器。主要應用于辦公室、家庭、會議場
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度車間租賃安全協(xié)議書(含安全生產(chǎn)責任險)
- 二零二五年度茶業(yè)投資合作框架協(xié)議
- 2025年度解除婚約協(xié)議書(情感修復與法律支持)
- 二零二五年度油茶種植基地承包與生態(tài)修復協(xié)議
- 2025年度食堂食品安全風險評估與監(jiān)督執(zhí)行協(xié)議
- 施工現(xiàn)場施工防生物污染制度
- 施工日志填寫中的施工材料消耗記錄方法
- 個人商鋪抵押借款合同范本
- 云服務器托管服務合同(三)
- 二手廠房買賣合同
- 職業(yè)暴露與防護
- 年產(chǎn)15噸透明質(zhì)酸生產(chǎn)車間的初步工藝設計
- 大模型在航空航天領域的應用:智能探索宇宙的無限可能
- 酒店行業(yè)客源渠道分析
- 2024年中國陪診服務行業(yè)市場發(fā)展趨勢預測報告-智研咨詢重磅發(fā)布
- AVL-CRUISE-2019-整車經(jīng)濟性動力性分析操作指導書
- 腸道醫(yī)學解剖和生理學
- 人教版九年級英語動詞時態(tài)專項練習(含答案和解析)
- 蘭州市規(guī)范醫(yī)療服務價格項目基準價格表
- 火災隱患整改登記表
- 普通地質(zhì)學教材
評論
0/150
提交評論