VHDL洗衣機設計_第1頁
VHDL洗衣機設計_第2頁
VHDL洗衣機設計_第3頁
VHDL洗衣機設計_第4頁
VHDL洗衣機設計_第5頁
已閱讀5頁,還剩29頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、EDAM程實訓報告、實訓課題:洗衣機控制器的設計、設計的內(nèi)容及要求:1 設計一個洗衣機控制器,要求為:1) 洗衣機控制器可以驅動洗衣機進行洗滌、漂洗或烘干;2) 洗衣機控制器可以設置洗衣機的工作時間,工作時間最短1分鐘,最長30分鐘,在工作過程中,工作時間以倒計時顯示,若時間為0洗衣機停止工作;3) 洗衣機在待機狀態(tài)時,洗衣機控制器可以設置洗衣機的工作方式和工作時間;4) 可以暫停或停止洗衣機工作;5) 利用四個數(shù)碼管顯示洗衣機待機時的設置時間和工作時的運行時間,利用一位數(shù)碼管顯示洗衣機待機時所設置的工作方式運行時的工作方式;6)利用三個LED分別表示驅動洗衣機進行洗滌、漂洗或烘干。2洗衣機控

2、制器可以劃分為狀態(tài)機模塊、計時器模塊、設置模塊和顯示選擇模塊。在QuartusII中輸入各個模塊的代碼,編譯綜合,仿真,完成各個模塊的軟件設計;4把各個模塊組合起來,綜合編譯,仿真,完成整個交通燈控制器系統(tǒng)的軟件設計;5. 選擇電路方案鎖定管腳,把程序下載到實驗箱中,利用實驗箱進行硬件實現(xiàn);6. 完成實訓報告。實訓報告包括:1) 設計的任務和要求;2) 模塊的劃分和系統(tǒng)總框圖;3) 各個模塊的實現(xiàn),包括模塊的作用,模塊的輸入與輸出情況,模塊狀態(tài)圖,模塊的代碼以及注釋,模塊的波形圖;4) 系統(tǒng)的實現(xiàn),包括系統(tǒng)總原理圖,系統(tǒng)的波形圖;5) 管腳的鎖定關系;三.設計思路:狀態(tài)切換>>&g

3、t;w限狀態(tài)機按定時時間及時>>>定時計數(shù)器顯示時間>>>數(shù)碼管譯碼驅動器接收設置時間>>濯寸間設置鍵盤掃描器接收設置模式>>>模式設置鍵盤掃描器切換顯示運行時間和設置時間>>>二路選擇器切換顯示運行模式和設置模式>>>二路選擇器整體設計示意圖:四.系統(tǒng)組成以及系統(tǒng)各部分的設計:1.狀態(tài)機的設計:狀態(tài)機要完成的功能:能設置工作模式;控制洗滌、漂洗、干衣的驅動輸出;能啟動、暫停、停止洗衣機控制器;能重啟、暫停和停止定時器;能接收定時器的到時標志;能使能鍵盤掃描計數(shù)器;能控制二路選擇器狀態(tài)圖分析設

4、計如下:模塊設計圖如下:;JVVASHMACHNE*1modein20!一CLK;!一pauseE,astart:!stop!tcinwdec<2.Qlwout2.0kenseiten刈邛;mst3i狀態(tài)機仿真圖如下:l*o1應L1T5m1iklarlpui£eHhktjnjiemiiZIsnUta*3RvaSL.一>ppj.BC.OaJ&Olpjiz2知.口.H5E5HjuuVLrLrLnnRrLrLTLn(rl_jc3£JWL:J一打"口jrrmnrirLnL4SS.0>LLJuinJ_TL,叫uWg皿TjLTJ:rJULI二nfl&

5、#171;.p皿空”叫0皿Inwnuwcnnnjw工:一ITS一L_n1rn-'.總1匚11Y.3:nAJ5也一】【而】、ih)JLOL4VLEiii1L1、一口:miXPl先J國工n工匚imi;2.定時器設計:定時器的功能:能通過使能端暫停和允許定時器工作;能停止并復位定時器;能進行定時;能輸出定時標志模塊設計圖如下:rdingshidktentstop ims3,0 iss3.0img30is町0jmstcinomg3.06sg30oms3.,0oss3.0定時器波形圖如下:3 .時間設置:時間設置鍵盤掃描器的功能:能響應按鍵;能在使能端的控制下工作模式設計圖如下:kinkenim

6、s3.,0iss3.Oimg3.O*、g3.i-instprfiOOniLGODm期.口住電.。哂皿。珀帽。工如L0總戰(zhàn)DieT300th況工附腳.1E960.0ns確也站as®-1-.0 tL邛jmnnwLWWLjwwmnwLwwwinmw3鵬51!4 .模式設置:模式設置鍵盤掃描器的功能:預設工作模式,“000”為待機,“001”為洗滌,“010”為漂洗,“022”為干衣,“100”為暫停模式設計圖如下:陛叫和照唧M華吁即ffllB中叫也邛唧M型波形圖如下:二-EirnAmrmnr二工丁_皿1-二iir_r二b林麗卿1ST婀師阿而1麗網(wǎng)Qip阿7r軻碰曠ii虹|川【回匚;回|:1

7、【由的3區(qū)通幽購國蛔國酶皿咽頻顧胭®©曲邨D顫D©郎18*I5 .二路選擇器二路選擇器的功能:設置顯示運行時間還是設置時間,顯示運行模式還是設置模式。模式設計圖如下:sms|1 .0mgdts3.OMdis2.Dsgdisfl.C* rnoiedis2.G|oag£mulselbom51.0,o&s2.010mg.0LLs昌s2I一sm53.Qy5S33»QmodeseT2.0:modeout2.0seiinsts-4I!4ia!«Ii«iib-i*rEMiri#+土«,n-airi*SBH!»i

8、fleiiriIAiB;«iriiftad-«SB!>rTcesefi-Jr£t工w整體波形圖:哧*叫中味】滬?口曰;喻穹wBCq江削Me二H59(P5JB6H3S產(chǎn);浮達*U;H£任口5沌7Tiwmi硼:mwn則rmTnrmwnnn皿mmmiMrmmi皿皿itTLjn;_;_in:niTmiinrmmmi;fl!310五.下載時選擇的開發(fā)系統(tǒng)模式以及管腳1.管教配置:ToAssignmentNameValueEnabled卷1PartitionHi*潑chyroot_partit)onYes上dkLLocationPIN_153YesLocati

9、onPIN_2SYesLegationPIN_16Yes好回之LocationPI忖_15Yesf>igdi5lLocationFIN_HYes<igdisOLocationPIN_13YesE>l£dl£3LficatiorPIN_2DYes<isdts2LocatioriPIN_19Yes5Ei疝Lo0gnPIN_13Yes2MLitLocationPIN_159YesW'JDUt口LocationPIN_153Yesti>'Z-outQLocationPIN_141YesstartLocationPIN_237Yes加加口

10、LectionPIN_Z39Yestrie5etLorationPIN_233YespauseLocationPIN_240tL>TTSdlsOLccstianPIN美Yes0rHs痂1LocationPIN_13WYesmsdisLocationPIN_155Yes6gfc同LocationPIN_13&YestmodedisDaLocationPIN_137Yes好m3d白金口JLocatariPIN_139Yes0nxxkd5LectionPIN_1J9YesIrnodeLocationPIN/36Yes<>mgdiE01LocationPIN_21Yestmg

11、disflLocationPIN_4LYes0mg北同Lflc=tionPIN_123Yes<>mgdi53LorationPIN32Yes<>iE-dicOLocationPIN_17YesLocationPIN161-1Ves«FledlLocatioriPIN_I5;Yes3唇d網(wǎng)Locatiori=IN_163Yes譯碼器譯碼器揚聲器ZZEZIl器譯碼器譯碼器譯碼器平8PIO47xfD7PIO46PIO45XAD14D13D16D1518鍵7|6I5D6PIO44PIO43D3PIO42PIO411D9_r單里沖單脈沖D12141312I1EPIO19

12、-PIO16KPIO23-PIO20'APIO27-PIO24SPIO31-PIO28PIO35-PIO32PIO39-PIO36FPGA/CPLD目標芯片PIO47-PIO40PIO7PIO6PIO5PIO4PIO3PIO2PIO0PIO40'實驗電路結構圖NO.7附錄代碼:1.狀態(tài)機LIBRARYieee;USESHELL_WASHMACHINEISPORT(CLK,modein0,modein1,modein2,pause,start,stop,tcin:INstd_logic;ken,modeout0,modeout1,modeout2,sel,ten,tstop,wo

13、ut0,wout1,wout2:OUTstd_logic);END;ARCHITECTUREBEHAVIOROFSHELL_WASHMACHINEISTYPEtype_sregIS(dry,ready,rinse,waitup,wash);SIGNALsreg,next_sreg:type_sreg;SIGNALnext_ken,next_modeout0,next_modeout1,next_modeout2,next_sel,next_ten,next_tstop,next_wout0,next_wout1,next_wout2:std_logic;SIGNALmodeout:std_lo

14、gic_vector(2DOWNTO0);SIGNALwout:std_logic_vector(2DOWNTO0);BEGINPROCESS(CLK,stop,next_sreg,next_ken,next_sel,next_ten,next_tstop,next_modeout2,next_modeout1,next_modeout0,next_wout2,next_wout1,next_wout0)BEGINIF(stop='1')THENsreg<=ready;sel<='0'ken<='1'ten<='1

15、'tstop<='1'modeout2<='0'modeout1<='0'modeout0<='0'wout2<='0'wout1<='0'wout0<='0'ELSIFCLK='1'ANDCLK'eventTHENsreg<=next_sreg;ken<=next_ken;sel<=next_sel;ten<=next_ten;tstop<=next_tstop;modeout2

16、<=next_modeout2;modeout1<=next_modeout1;modeout0<=next_modeout0;wout2<=next_wout2;wout1<=next_wout1;wout0<=next_wout0;ENDIF;ENDPROCESS;PROCESS(sreg,modein0,modein1,modein2,pause,start,tcin,modeout,wout)BEGINnext_ken<='0'next_modeout0<='0'next_modeout1<='

17、;0'next_modeout2<='0'next_sel<='0'next_ten<='0'next_tstop<='0'next_wout0<='0'next_wout1<='0'next_wout2<='0'modeout<=std_logic_vector'("000");wout<=std_logic_vector'("000");next_sreg<

18、=dry;CASEsregISWHENdry=>IF(pause='0'ANDtcin='0')THENnext_sreg<=dry;next_ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("011");wout<=(std_logic_vector'("100");ENDIF;IF(tci

19、n='0'ANDpause='1')THENnext_sreg<=waitup;next_ten<='0'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("100");wout<=(std_logic_vector'("000");ENDIF;IF(tcin='1')THENnext_sreg<

20、;=ready;next_ten<='1'next_tstop<='1'next_ken<='1'next_sel<='0'modeout<=(std_logic_vector'("000");wout<=(std_logic_vector'("000");ENDIF;WHENready=>IF(modein1='0'ANDmodein0='0')OR(modein2='1')OR(st

21、art='0')THENnext_sreg<=ready;next_ten<='1'next_tstop<='1'next_ken<='1'next_sel<='0'modeout<=(std_logic_vector'("000");wout<=(std_logic_vector'("000");ENDIF;IF(modein0='1'ANDmodein1='1'ANDmodein2=

22、'0'ANDstart='1')THENnext_sreg<=dry;next_ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("011");wout<=(std_logic_vector'("100");ENDIF;IF(modein0='0'ANDmodein1='1&#

23、39;ANDmodein2='0'ANDstart='1')THENnext_sreg<=rinse;next_ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("010");wout<=(std_logic_vector'("010");ENDIF;IF(modein0='1'AND

24、modein1='0'ANDmodein2='0'ANDstart='1')THENnext_sreg<=wash;next_ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("001");wout<=(std_logic_vector'("001");ENDIF;WHENrinse=

25、>IF(pause='0'ANDtcin='0')THENnext_sreg<=rinse;next_ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("010");wout<=(std_logic_vector'("010");ENDIF;IF(tcin='0'ANDpause

26、='1')THENnext_sreg<=waitup;next_ten<='0'next_tstop<='0'next_ken<='0'next_sel<='1'wout<=(std_logic_vector'("000");ENDIF;IF(tcin='1')THENnext_sreg<=ready;next_ten<='1'next_tstop<='1'next_ken<=&#

27、39;1'next_sel<='0'modeout<=(std_logic_vector'("000");wout<=(std_logic_vector'("000");ENDIF;WHENwaitup=>IF(modein1='0'ANDmodein0='0')OR(modein2='1')OR(pause='1')THENnext_sreg<=waitup;next_ten<='0'next_ts

28、top<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("100");wout<=(std_logic_vector'("000");ENDIF;IF(modein0='1'ANDmodein1='1'ANDmodein2='0'ANDpause='0')THENnext_sreg<=dry;next_ten<='

29、;1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("011");wout<=(std_logic_vector'("100");ENDIF;IF(modein0='0'ANDmodein1='1'ANDmodein2='0'ANDpause='0')THENnext_sreg<=rinse;n

30、ext_ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("010");wout<=(std_logic_vector'("010");ENDIF;IF(modein0='1'ANDmodein1='0'ANDmodein2='0'ANDpause='0')THENnext_

31、sreg<=wash;next_ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("001");wout<=(std_logic_vector'("001");ENDIF;WHENwash=>IF(pause='0'ANDtcin='0')THENnext_sreg<=wash;next_

32、ten<='1'next_tstop<='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("001");wout<=(std_logic_vector'("001");ENDIF;IF(tcin='0'ANDpause='1')THENnext_sreg<=waitup;next_ten<='0'next_tstop&

33、lt;='0'next_ken<='0'next_sel<='1'modeout<=(std_logic_vector'("100");wout<=(std_logic_vector'("000");ENDIF;IF(tcin='1')THENnext_sreg<=ready;next_ten<='1'next_tstop<='1'next_ken<='1'next_sel<

34、='0'wout<=(std_logic_vector'("000");ENDIF;WHENOTHERS=>ENDCASE;next_modeout2<=modeout(2);next_modeout1<=modeout(1);next_modeout0<=modeout(0);next_wout2<=wout(2);next_wout1<=wout(1);next_wout0<=wout(0);ENDPROCESS;ENDBEHAVIOR;LIBRARYieee;USEWASHMACHINEISPOR

35、T(modein:INstd_logic_vector(2DOWNTO0);modeout:OUTstd_logic_vector(2DOWNTO0);wout:OUTstd_logic_vector(2DOWNTO0);CLK,pause,start,stop,tcin:INstd_logic;ken,sel,ten,tstop:OUTstd_logic);END;ARCHITECTUREBEHAVIOROFWASHMACHINEISCOMPONENTSHELL_WASHMACHINEPORT(CLK,modein0,modein1,modein2,pause,start,stop,tcin

36、:INstd_logic;ken,modeout0,modeout1,modeout2,sel,ten,tstop,wout0,wout1,wout2:OUTENDCOMPONENT;BEGINSHELL1_WASHMACHINE:SHELL_WASHMACHINEPORTMAP(CLK=>CLK,modein0=>modein(0),modein1=>modein(1),modein2=>modein(2),pause=>pause,start=>start,stop=>stop,tcin=>tcin,ken=>ken,modeout0=

37、>modeout(0),modeout1=>modeout(1),modeout2=>modeout(2),sel=>sel,ten=>ten,tstop=>tstop,wout0=>wout(0),wout1=>wout(1),wout2=>wout(2);ENDBEHAVIOR;2定時器:libraryieee;usedingshiisport(clk,ten,tstop:instd_logic;ims:instd_logic_vector(3downto0);iss:instd_logic_vector(3downto0);img:i

38、nstd_logic_vector(3downto0);isg:instd_logic_vector(3downto0);cin:outstd_logic;omg,osg:bufferstd_logic_vector(3downto0);oms:bufferstd_logic_vector(3downto0);oss:bufferstd_logic_vector(3downto0);end;architecturecmlofdingshiisbeginPROCESS(clk,ten,tstop)BEGINIFtstop='1'THENosg<=isg;ELSIFclk&#

39、39;EVENTANDclk='1'THENIFosg="0000"THENIFoss>"0000"ORomg>"0000"ORoms>"0000"THENosg<="1001"ELSEosg<="0000"ENDIF;ELSEosg<=osg-1;ENDIF;ENDIF;ENDIF;ENDPROCESS;PROCESS(clk,ten,tstop,osg)BEGINIFten='1'THENIFtstop=

40、'1'THENoss<=iss;ELSIFclk'EVENTANDclk='1'THENIFosg="0000"THENIFoss=0THENIFomg>"0000"ORoms>"0000"THENoss<="0101"ELSEoss<="0000"ENDIF;ELSEoss<=oss-1;ENDIF;ENDIF;ENDIF;ENDIF;ENDPROCESS;PROCESS(clk,ten,tstop,osg,oss)B

41、EGINIFten='1'THENIFtstop='1'THENomg<=img;ELSIFclk'EVENTANDclk='1'THENIFoss=0andosg=0THENIFomg=0THENIFoms>0THENomg<="1001"ELSEomg<="0000"ENDIF;ELSEomg<=omg-1;ENDIF;ENDIF;ENDIF;ENDIF;ENDPROCESS;PROCESS(clk,ten,tstop,osg,oss,omg)BEGINIFten=

42、'1'THENIFtstop='1'THENoms<=ims;ELSIFclk'EVENTANDclk='1'THENIFomg=0andosg=0andoss=0THENIFoms=0THENoms<="0000"ELSEoms<=oms-1;ENDIF;ENDIF;ENDIF;ENDIF;ENDPROCESS;PROCESS(clk,ten,tstop,osg,oss,omg,oms)BEGINIFten='1'THENIFtstop='0'THENIFclk

43、9;EVENTANDclk='1'THENIFoms=0ANDomg=0ANDoss=0ANDosg=1THENcin<='1'ELSEcin<='0'ENDIF;ENDIF;ENDIF;ENDIF;ENDPROCESS;ENDcml;3. 時間設置:libraryieee;usekeyISport(kin:instd_logic;ken:instd_logic;ims,iss,img,isg:bufferstd_logic_vector(3downto0);endkey;ARCHITECTUREcmlOFkeyISBEGINPROC

44、ESS(kin,ken)BEGINIFken='1'THENIFkin'EVENTANDkin='1'THENisg<="0000"ELSEisg<=isg+1;ENDIF;ENDIF;ENDIF;ENDPROCESS;PROCESS(kin,ken,isg)BEGINIFken='1'THENIFkin'EVENTANDkin='1'THENIFisg=9THENIFiss="0101"THENiss<="0000"ELSEiss<

45、;=iss+1;ENDIF;ENDIF;ENDIF;ENDIF;ENDPROCESS;PROCESS(kin,ken,isg,iss)BEGINIFken='1'THENIFiss="0101"ANDisg="1001"THENIFimg="1001"THENimg<="0000"ELSEimg<=img+1;ENDIF;ENDIF;ENDIF;ENDIF;ENDPROCESS;PROCESS(kin,ken,isg,iss,img)BEGINIFken='1'THENIFkin'EVENTANDkin='1'THENIFimg="1001"ANDiss="0101"ANDisg="1001"THENIFims="0010"THENims<="0000"ELSEims<=ims+1;ENDIF;ENDIF;ENDIF;E

溫馨提示

  • 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

提交評論