EDA課程設計---微波爐定時控制器的設置_第1頁
EDA課程設計---微波爐定時控制器的設置_第2頁
EDA課程設計---微波爐定時控制器的設置_第3頁
EDA課程設計---微波爐定時控制器的設置_第4頁
EDA課程設計---微波爐定時控制器的設置_第5頁
已閱讀5頁,還剩16頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、 課程設計說明書課程:EDA技術基礎題目:微波爐定時控制器的設置 學生姓名: 陳卓學 號: 200965110117班 級: 09光電專 業(yè): 物理學指導教師:賀慧勇 唐立軍 文勇軍 周曉萍 唐俊龍長沙理工大學課程設計任務書物理與電子科學 學院 物理 專業(yè) 光電 班 姓名 陳卓 課程名稱 EDA技術基礎 題 目 微波爐定時控制器的設計 同組設計者:顧曉輝,陳詩遠,王超,文奚,任曉晨,吳勇勇要求:(1)啟動開關;(2)復位開關;(3)烹調(diào)時間設置和顯示;(4)“火力”設置(分大中小三檔); (5)七段碼測試:上電或按TEST鍵可以測試七段碼管,顯示為“8888”;(6)啟動輸出和”火力”輸出(可

2、用LED顯示代表); (7)設定時間后,按啟動鍵開始烹調(diào),同時顯示剩余時間,時間為0時,顯示烹調(diào)完成信息“End”,并輸出提示音;(8) 故障信號有效時,停止輸出,顯示信息“Err”,輸出間歇報警聲音發(fā)揮部分: 1.烹調(diào)方案預設和調(diào)用2. 設計帶燒烤功能微波爐控制器工作計劃(1)時間本課程設計安排2周時間: 2011.12.5 2011.12.16 (2)進度安排第1周周一周二:查閱資料,拿出整體設計方案,劃分模塊;第1周周三至周五:各模塊的設計、調(diào)試、驗證。第2周周三前完成項目整體調(diào)試和測試。第2周周三周四文檔寫作整理第2周周五:答辯討論指導教師:賀慧勇 唐立軍 文勇軍 周曉萍 唐俊龍 20

3、11年11月20 日教研室意見:同意。教研室主任 文勇軍 2011年11月23 日長沙理工大學課程設計成績評定表學生姓名: 陳卓 學號: 200965110117 專業(yè)班級: 09光電 課程設計題目: 微波爐定時控制器的設計 評分項目要求分值得分學習態(tài)度學習態(tài)度認真,遵守紀律。10設計方案調(diào)研充分,方案設計合理。20工作量完成了任務書規(guī)定的工作量。實際設計、調(diào)試效果好。40設計報告完全符合撰寫規(guī)范要求,結構嚴謹,邏輯性強,層次清晰,表述準確,文字流暢。20答辯準備充分,概念清楚,能準確流利地回答各種問題。10總分備注:成績: 指導教師: 年 月 日21目 錄1 設計題目與要求22 硬件描述53

4、 軟件設計思路. . .73程序調(diào)試過程及問題分析104課程設計中的感想及結論11參考文獻13附件131,硬件描述拿到題目后,我們仔細看了我們所需要用到的ALTERA公司的CYCLONE III系列的芯片EP3C16F484C6,FPGA開發(fā)板,這是開發(fā)板的全圖從圖以及查資料得知這塊開發(fā)板包括以下硬件資源Altera Cyclone III 3C16 FPGA device Altera Serial Configuration device EPCS4 USB Blaster (on board) for programming and user API control; both JTAG

5、 and Active Serial(AS) programming modes are supported 8-Mbyte SDRAM 4-Mbyte Flash memory SD Card socket 3 pushbutton switches 10 toggle switches 10 green user LEDs 50-MHz oscillator for clock sources VGA DAC (4-bit resistor network) with VGA-out connector RS-232 transceiver PS/2 mouse/keyboard conn

6、ector Two 40-pin Expansion Headers這里我們要用到的主要就是Cyclone III 3C16芯片,以及green user LED,pushbutton switchs,toggle switchs等控制顯示部分的硬件資源。這是整個開發(fā)板的Block diagram我們用VHDL硬件描述語言寫好程序,然后燒錄進開發(fā)板,利用user LED,pushbutton switchs等硬件資源來實現(xiàn)整個的微波爐定時控制器的設計。這是開發(fā)板的引腳圖:通過設置引腳,我們能控制開發(fā)板上的按鍵讓LED上顯示我們所需要的東西從而實現(xiàn)啟動復位等任務書里面的提到的基本要求。2,軟件設

7、計思路題目要求設計一個微波爐定時控制器,要求有啟動復位開關以及亨調(diào)時間的設置,火力設置高中低檔,七段碼測試,按下測試鍵后顯示四個8,啟動輸出和”火力”輸出; 設定時間后,按啟動鍵開始烹調(diào),同時顯示剩余時間,時間為0時,顯示烹調(diào)完成信息“End”,并輸出提示音;故障信號有效時,停止輸出,顯示信息“Err”,輸出間歇報警聲音。根據(jù)題目要求,經(jīng)過我們的討論,我們做了以下方案:用VHDL語言寫,設定時間采用兩個按鈕分別提供一個移位信號和一個加信號(這與實際比較相符),管腳綁定簡單(特別是數(shù)碼管),這里采用的是動態(tài)掃描位選輸出數(shù)據(jù),不需對四個數(shù)碼管都進行綁定。通過我們的討論,形成了一個初步的思路,如下圖

8、所示:預設初值 倒計時減計數(shù) 輸出數(shù)據(jù)然后增加復位端和測試端: 復位輸出數(shù)據(jù) 預設 倒計時 實現(xiàn)閃爍初值 減計數(shù) 測試在整個程序的設計思路上,我們將程序分成了5個單元模塊,以及一個綜合的ZONGHE頂層模塊,這五個模塊分別為初始化模塊(FIRST),分頻模塊(FENPIN),減計數(shù)模塊(JIANJISHU),顯示模塊(VIEW),位選模塊(CHOICE)。經(jīng)過我們組的討論,決定將每個單元模塊分工到人,然后每個人負責一個模塊,我分到的模塊是減計數(shù)模塊。減計數(shù)(JIANJISHU)模塊的設計: JIANJISHU模塊的主要用于對FIRST模塊的數(shù)據(jù)進行選擇性的處理和輸出: (1)、當JIANJIS

9、HU模塊中的res=0時,由于res作為輸入同樣也連接這FRIST模塊中的res,他們是由一個輸入共同控制的,所以此時輸出的就是“0000”; (2)、當JIANJISHU模塊中的test=0時,同res一樣的道理,此時輸出為“8888”; (3)、當q4=15(輸出為F)或start=0時,LED就不會亮了,表示工作完成或處于等待狀態(tài),此時不對FIRST模塊中的數(shù)據(jù)進行任何處理就直接輸出; (4)、在以上條件都不滿足的情況下,若此時start=1,那么JIANJISHU模塊才開始了真正的工作狀態(tài),即配合FENPIN模塊中時鐘outclk開始每秒減一的記時計數(shù);本程序中復位鍵res和test的

10、詳細說明:這里的res和test和模塊FRIST中的res和test是用同一個控制端,而且JIANJISHU的res和test是必不可少的。因為每次進行計數(shù)完后由于是利用信號進行減計數(shù),在記完一次數(shù)之后q1,q2,q3和q4都會保持最后一次的狀態(tài),如果不及時清零的話,那么下一次的res,test以及加計數(shù)就是只能對前一級的輸入進行復位和測試,輸出的將是前一級的各個位數(shù)減去q1,q2,q3和q4的值,所以在JIANJISHU模塊中進行清零是十分重要的。經(jīng)過上面的分析,大致程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logi

11、c_unsigned.all;entity jianjishu isport(clks,start,res,test:in std_logic; in1,in2,in3,in4:in std_logic_vector(3 downto 0); light:out std_logic; out1,out2,out3,out4:out std_logic_vector(3 downto 0);end;architecture one of jianjishu issignal q1,q2,q3,q4:std_logic_vector(3 downto 0);beginprocess(start,c

12、lks,res,test,q4) variable a:std_logic_vector(1 downto 0); beginif res=0 or test=0 then q1=0000;q2=0000;q3=0000;q4=0000; -對信號都清零設置 elsif q4=(in4-15) or start=0 then a:=00;light=0; -當q4=15或start=0時不進行減計數(shù),同時LED不亮 elsif start=1 then a:=11;lightif clksevent and clks=1 then if (in1-q1)=0 then q1=(in1-9);q

13、2=q2+1;else q1=q1+1;end if; if (in2-q2)=0 and (in1-q1)=0 then q3=q3+1;q2=(in2-5);q1=(in1-9);end if; -當輸出out1=0和out2=0時進位減1,同時out1=9,out2=5;if (in3-q3)=0 and (in2-q2)=0 and (in1-q1)=0 then q4=q4+1;q3=(in3-9);q2=(in2-5);q1=(in1-9);end if;if (in4-q4)=0 and (in3-q3)=0 and (in2-q2)=0 and (in1-q1)=0 then

14、q4=(in4-15);q3=(in3-14);q2=(in2-13);q1null;end case;end if;end process;out1=(in1-q1);out2=(in2-q2);out3=(in3-q3);out4clk1,outclk=a,screen=k);u2: first port map (clk=clk2,res=rest,test=testt,able=move, o1=b,o2=c,o3=d,o4=e,o5=j);u3:jianjishu port map (clks=a,start=startt,res=rest,test=testt,in1=b,in2=

15、c,in3=d,in4=e,light=lighto,out1=f,out2=g,out3=h,out4=i);u4:choice port map (clk=clk1,f1=f,f2=g,f3=h,f4=i,o1=q,o2=p);u5:view port map (able=j,screen=k,f1=q,f2=p,segout=seg,selout=sel);end;第二部分:FENPIN(時鐘分頻)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenpin is port(c

16、lk:in std_logic; outclk,screen:out std_logic);end;architecture first of fenpin is signal Q1,Q2:std_logic; begin one:process(clk) variable count1:integer range 0 to 1002; begin Q11000 then Q1=1;count1:=0; elsif clkevent and clk=1 then count1:=count1+1; end if; end process; - 分出1秒信號two:process(clk)var

17、iable count2:integer range 0 to 500;begin if clkevent and clk=1 then if count2250 then Q2=1;count2:=count2+1;else Q2499 then count2:=0;end if; end process; - 閃爍信號outclk=Q1;screen=Q2;end; 第三部分:FIRST(數(shù)據(jù)初始化)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity first isport(clk

18、,able,res,test:in std_logic; o1,o2,o3,o4,o5:out std_logic_vector(3 downto 0);end;architecture two of first issignal q1,q2,q3,q4,q5:std_logic_vector(3 downto 0);beginprocess(able)beginif ableevent and able=1 then if q54 then q5=q5+1; else q5=0000; end if;end if;end process; -位選信號,選擇相應的位進行初始化,其中“0000”

19、為空位。process(clk,res,test,q4)beginif res=0 then q1=0000;q2=0000;q3=0000;q4=0000; -復位鍵elsif test=0 then q1=1000;q2=1000;q3=1000;q4 if q19 then q1=q1+1;else q1 if q25 then q2=q2+1;else q2 if q39 then q3=q3+1;else q3 if q45 then q4=q4+1;else q4null;end case;end if;end process;o1=q1;o2=q2;o3=q3;o4=q4;o5=

20、q5; -在VIEW模塊中選擇閃爍位end;第四部分:JIANJISHU(數(shù)據(jù)按秒倒計時)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jianjishu isport(clks,start,res,test:in std_logic; in1,in2,in3,in4:in std_logic_vector(3 downto 0); light:out std_logic; out1,out2,out3,out4:out std_logic_vector(3 downto 0);e

21、nd;architecture one of jianjishu issignal q1,q2,q3,q4:std_logic_vector(3 downto 0);beginprocess(start,clks,res,test,q4) variable a:std_logic_vector(1 downto 0); begin if res=0 or test=0 then q1=0000;q2=0000;q3=0000;q4=0000; -對信號都清零設置 elsif q4=(in4-15) or start=0 then a:=00;light=0; -當q4=15或start=0時不

22、進行減計數(shù),同時LED不亮 elsif start=1 then a:=11;lightif clksevent and clks=1 then if (in1-q1)=0 then q1=(in1-9);q2=q2+1;else q1=q1+1;end if; -q1開始為0,當q1=in1時,對q1賦值為(in1-9),為負數(shù),同時對q2進行加1,那么(in2-q2)就可以視線減1,若不是那么q1=q1+1,可以實現(xiàn)(in1-q1)從9開始的倒計數(shù)if (in2-q2)=0 and (in1-q1)=0 then q3=q3+1;q2=(in2-5);q1=(in1-9);end if;

23、-當輸出out1=0和out2=0時進位減1,同時out1=9,out2=5;if (in3-q3)=0 and (in2-q2)=0 and (in1-q1)=0 then q4=q4+1;q3=(in3-9);q2=(in2-5);q1=(in1-9);end if;if (in4-q4)=0 and (in3-q3)=0 and (in2-q2)=0 and (in1-q1)=0 thenq4=(in4-15);q3=(in3-14);q2=(in2-13);q1null;end case;end if;end process;out1=(in1-q1);out2=(in2-q2);ou

24、t3=(in3-q3);out4=(in4-q4);end;第五部分:CHOICE(數(shù)據(jù)選擇模塊)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity choice isport(clk:std_logic; f1,f2,f3,f4:in std_logic_vector(3 downto 0); o1:out std_logic_vector(1 downto 0); o2:out std_logic_vector(3 downto 0);end;architecture one of

25、choice issignal q:std_logic_vector(1 downto 0);beginprocess(clk)beginif clkevent and clk=1 then q o2 o2 o2 o2 null; -選擇輸出數(shù)據(jù)end case;end process;o1=q; -位選信號end;第六部分:VIEW(顯示模塊)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity view isport(screen:in std_logic; f1:in std_log

26、ic_vector(1 downto 0); f2,able:in std_logic_vector(3 downto 0); segout:out std_logic_vector(7 downto 0); selout:out std_logic_vector(2 downto 0);end;architecture one of view issignal seg:std_logic_vector(6 downto 0);signal sel:std_logic_vector(2 downto 0);beginselout=sel;segout(6 downto 0)=seg;sel=0

27、00 when f1=0 else 001 when f1=1 else 010 when f1=2 else 011 when f1=3 else 000; -相應的數(shù)據(jù)選擇對應的位進行輸出segout(7)=1 when f1=2 else 0; -在第三個數(shù)碼管輸出小數(shù)點process(f2,able,sel)beginif (able=0001 and sel=000) or (able=0010 and sel=001) or (able=0011 and sel=010) or (able=0100 and sel=011) thenif screen=1 then seg seg

28、 seg seg seg seg seg seg seg seg seg seg seg seg seg seg segnull;end case; -有輸出end if; -實現(xiàn)閃爍elsecase f2 iswhen 0000 = seg seg seg seg seg seg seg seg seg seg seg seg seg seg seg segnull;end case; -在沒選中的位正常輸出end if;end process;end;附件2:tcl引腳文件#Setup.tcl # Setup pin setting for EP1C12 main board set_gl

29、obal_assignment -name RESERVE_ALL_UNUSED_PINS AS INPUT TRI-STATED set_global_assignment -name ENABLE_INIT_DONE_OUTPUT OFF set_location_assignment PIN_G21 -to clk set_location_assignment PIN_H5 -to sw1 set_location_assignment PIN_H6 -to sw2 set_location_assignment PIN_G4 -to sw3 set_location_assignme

30、nt PIN_G5 -to sw4 set_location_assignment PIN_H2 -to button0 set_location_assignment PIN_G3 -to button1 set_location_assignment PIN_F1 -to button2 set_location_assignment PIN_J1 -to led0 set_location_assignment PIN_J2 -to led1 set_location_assignment PIN_C1 -to led60set_location_assignment PIN_C2 -to led61 set_location_assignment PIN_B2 -to led62 set_location_assignment PIN_B1 -to led9 set_location_assignment PIN_E11 -t

溫馨提示

  • 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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論