QUARTUSII軟件開放性實驗報告_第1頁
QUARTUSII軟件開放性實驗報告_第2頁
QUARTUSII軟件開放性實驗報告_第3頁
QUARTUSII軟件開放性實驗報告_第4頁
QUARTUSII軟件開放性實驗報告_第5頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

開放性實驗報告專業(yè):電子信息工程班級:*電信*班姓名:學(xué)號:指導(dǎo)老師:實驗一:流水燈實驗內(nèi)容利用QUARTUSII軟件,構(gòu)建NIOSII軟核系統(tǒng),編寫程序,實現(xiàn)實驗箱上LED燈的流水功能。實驗原理通過提前設(shè)定NIOSII軟核處理器的相關(guān)寄存器,控制led的IO口的高低電平輸出及響應(yīng)間隔時間,從而改變LED的亮滅并達到流水燈效果。實驗步驟硬件設(shè)計.構(gòu)建NIOSII軟核NIOSII軟核處理器包括cpu,sdram控制器,串行flash控制器,jtag_uart,sysid,pio端口。.PLL模塊的構(gòu)建實驗箱的板載有源晶振頻率為50MHZ,NIOSII及SDRAM需要100MHZ的時鐘源,因此需要用PLL模塊進行倍頻。PLL模塊的配置如圖所示:輸入時鐘頻率為50MHZ輸出時鐘c0為輸入時鐘的2倍頻輸出時鐘c1為輸入時鐘的2倍頻,相位偏移-75度,為SDRAM提供工作時鐘PLL模塊:.系統(tǒng)連線及引腳分配qsf文件中的引腳分配:set_location_assignmentPIN_AF21-tosdram_addr[0]set_location_assignmentPIN_AE20-tosdram_addr[1]set_location_assignmentPIN_AF20-tosdram_addr[2]set_location_assignmentPIN_AE19-tosdram_addr[3]set_location_assignmentPIN_B20-tosdram_addr[4]set_location_assignmentPIN_A21-tosdram_addr[5]set_location_assignmentPIN_B21-tosdram_addr[6]set_location_assignmentPIN_A22-tosdram_addr[7]set_location_assignmentPIN_B22-tosdram_addr[8]set_location_assignmentPIN_A23-tosdram_addr[9]set_location_assignmentPIN_AE21-tosdram_addr[10]set_location_assignmentPIN_B23-tosdram_addr[11]set_location_assignmentPIN_B24-tosdram_addr[12]set_location_assignmentPIN_AE22-tosdram_ba[0]set_location_assignmentPIN_AF22-tosdram_ba[1]set_location_assignmentPIN_AE24-tosdram_cas_nset_location_assignmentPIN_B25-tosdram_ckeset_location_assignmentPIN_AF23-tosdram_cs_nset_location_assignmentPIN_AD25-tosdram_dq[0]set_location_assignmentPIN_AC25-tosdram_dq[1]set_location_assignmentPIN_AC26-tosdram_dq[2]set_location_assignmentPIN_AB25-tosdram_dq[3]set_location_assignmentPIN_AB26-tosdram_dq[4]set_location_assignmentPIN_AA25-tosdram_dq[5]set_location_assignmentPIN_AA26-tosdram_dq[6]set_location_assignmentPIN_Y25-tosdram_dq[7]set_location_assignmentPIN_W26-tosdram_dq[8]set_location_assignmentPIN_V25-tosdram_dq[9]set_location_assignmentPIN_V26-tosdram_dq[10]set_location_assignmentPIN_U25-tosdram_dq[11]set_location_assignmentPIN_U26-tosdram_dq[12]set_location_assignmentPIN_T25-tosdram_dq[13]set_location_assignmentPIN_R25-tosdram_dq[14]set_location_assignmentPIN_P24-tosdram_dq[15]set_location_assignmentPIN_N24-tosdram_dq[16]set_location_assignmentPIN_M25-tosdram_dq[17]set_location_assignmentPIN_L25-tosdram_dq[18]set_location_assignmentPIN_K26-tosdram_dq[19]set_location_assignmentPIN_K25-tosdram_dq[20]set_location_assignmentPIN_J26-tosdram_dq[21]set_location_assignmentPIN_J25-tosdram_dq[22]set_location_assignmentPIN_H26-tosdram_dq[23]set_location_assignmentPIN_G25-tosdram_dq[24]set_location_assignmentPIN_F26-tosdram_dq[25]set_location_assignmentPIN_F25-tosdram_dq[26]set_location_assignmentPIN_E26-tosdram_dq[27]set_location_assignmentPIN_E25-tosdram_dq[28]set_location_assignmentPIN_D26-tosdram_dq[29]set_location_assignmentPIN_D25-tosdram_dq[30]set_location_assignmentPIN_C25-tosdram_dq[31]set_location_assignmentPIN_Y26-tosdram_dqm[0]set_location_assignmentPIN_W25-tosdram_dqm[1]set_location_assignmentPIN_H25-tosdram_dqm[2]set_location_assignmentPIN_G26-tosdram_dqm[3]set_location_assignmentPIN_AE23-tosdram_ras_nset_location_assignmentPIN_AE25-tosdram_we_nset_location_assignmentPIN_F21-toclk_sdram軟件設(shè)計system.h文件中關(guān)于PIO_LED的宏定義#definePIO_LED_NAME"/dev/pio_LED"#definePIO_LED_TYPE"altera_avalon_pio"#definePIO_LED_BASE0x00001800#definePIO_LED_SPAN16#definePIO_LED_DO_TEST_BENCH_WIRING0#definePIO_LED_DRIVEN_SIM_VALUE0#definePIO_LED_HAS_TRI0#definePIO_LED_HAS_OUT1#definePIO_LED_HAS_IN0#definePIO_LED_CAPTURE0#definePIO_LED_DATA_WIDTH8#definePIO_LED_RESET_VALUE0#definePIO_LED_EDGE_TYPE"NONE"#definePIO_LED_IRQ_TYPE"NONE"#definePIO_LED_BIT_CLEARING_EDGE_REGISTER0#definePIO_LED_BIT_MODIFYING_OUTPUT_REGISTER0#definePIO_LED_FREQ100000000#defineALT_MODULE_CLASS_pio_LEDaltera_avalon_pio利用system.h文件編寫sopc.h,通過操作結(jié)構(gòu)體PIO_STR完成對PIO_寄存器的操作。sopc.h文件:#ifndefSOPC_H_#defineSOPC_H_#include"system.h"#define_LEDtypedefstruct{unsignedlongintDATA;unsignedlongintDIRECTION;unsignedlongintINTERRUPT_MASK;unsignedlongintEDGE_CAPTURE;}PIO_STR;#ifdef_LED#defineLED((PIO_STR*)PIO_LED_BASE)#endif#endifMain.c文件全部源碼:#include<stdio.h>#include<unistd.h>#include"../inc/sopc.h"intmain(){inti;while(1){for(i=0;i<8;i++){LED->DATA=~(1<<i);usleep(500000);}}return0;}實驗二:數(shù)碼管顯示實驗內(nèi)容利用QUARTUSII軟件,構(gòu)建NIOSII軟核處理器系統(tǒng),在NIOSIDE軟件中編寫程序,實現(xiàn)實驗箱上數(shù)碼管的動態(tài)顯示。實驗原理在NIOSII軟核處理器中添加段選,位選IO,通過控制PIO寄存器,逐次點亮數(shù)碼管,利用人眼的視覺暫留效應(yīng),實現(xiàn)數(shù)碼管的動態(tài)顯示。實驗步驟硬件設(shè)計.構(gòu)建NIOSII軟核NIOSII軟核包括cpu,sdram控制器,串行flash,jtag_uart,sysid,段選IO,位選IO。.構(gòu)建PLL模塊PLL輸入時鐘頻率為20MHZPLL輸出時鐘c0為輸入的5倍頻PLL輸出時鐘c1為輸入時鐘的5倍頻,相位偏移為-75度PLL模塊:.系統(tǒng)連線及引腳分配利用qsf文件進行引腳分配:set_location_assignment PIN_27 -to RESETset_location_assignment PIN_24 -to CLOCKset_location_assignment PIN_88 -to S_DB[0]set_location_assignment PIN_87 -to S_DB[1]set_location_assignment PIN_86 -to S_DB[2]set_location_assignment PIN_84 -to S_DB[3]set_location_assignment PIN_82 -to S_DB[4]set_location_assignment PIN_81 -to S_DB[5]set_location_assignment PIN_80 -to S_DB[6]set_location_assignment PIN_77 -to S_DB[7]set_location_assignment PIN_45 -to S_DB[8]set_location_assignment PIN_46 -to S_DB[9]set_location_assignment PIN_47 -to S_DB[10]set_location_assignment PIN_48 -to S_DB[11]set_location_assignment PIN_56 -to S_DB[12]set_location_assignment PIN_57 -to S_DB[13]set_location_assignment PIN_58 -to S_DB[14]set_location_assignment PIN_59 -to S_DB[15]set_location_assignment PIN_64 -to S_A[0]set_location_assignment PIN_63 -to S_A[1]set_location_assignment PIN_61 -to S_A[2]set_location_assignment PIN_60 -to S_A[3]set_location_assignment PIN_31 -to S_A[4]set_location_assignment PIN_33 -to S_A[5]set_location_assignment PIN_34 -to S_A[6]set_location_assignment PIN_35 -to S_A[7]set_location_assignment PIN_37 -to S_A[8]set_location_assignment PIN_39 -to S_A[9]set_location_assignment PIN_67 -to S_A[10]set_location_assignment PIN_40 -to S_A[11]set_location_assignment PIN_43 -to S_CLKset_location_assignment PIN_69 -to S_BA[0]set_location_assignment PIN_68 -to S_BA[1]set_location_assignment PIN_74 -to S_nCASset_location_assignment PIN_41 -to S_CKEset_location_assignment PIN_72 -to S_nRASset_location_assignment PIN_75 -to S_nWEset_location_assignment PIN_70 -to S_nCSset_location_assignment PIN_44 -to S_DQM[1]set_location_assignment PIN_76 -to S_DQM[0]set_location_assignment PIN_169 -to DIG[0]set_location_assignment PIN_168 -to DIG[1]set_location_assignment PIN_165 -to DIG[2]set_location_assignment PIN_164 -to DIG[3]set_location_assignment PIN_175 -to DIG[4]set_location_assignment PIN_173 -to DIG[5]set_location_assignment PIN_171 -to DIG[6]set_location_assignment PIN_170 -to DIG[7]set_location_assignment PIN_185 -to SEL[5]set_location_assignment PIN_182 -to SEL[4]set_location_assignment PIN_181 -to SEL[3]set_location_assignment PIN_180 -to SEL[2]set_location_assignment PIN_179 -to SEL[1]set_location_assignment PIN_176 -to SEL[0]軟件設(shè)計system.h中關(guān)于段選IO和位選IO的宏定義#defineDIG_NAME"/dev/DIG"#defineDIG_TYPE"altera_avalon_pio"#defineDIG_BASE0x00001800#defineDIG_SPAN16#defineDIG_DO_TEST_BENCH_WIRING0#defineDIG_DRIVEN_SIM_VALUE0#defineDIG_HAS_TRI0#defineDIG_HAS_OUT1#defineDIG_HAS_IN0#defineDIG_CAPTURE0#defineDIG_DATA_WIDTH8#defineDIG_RESET_VALUE0#defineDIG_EDGE_TYPE"NONE"#defineDIG_IRQ_TYPE"NONE"#defineDIG_BIT_CLEARING_EDGE_REGISTER0#defineDIG_BIT_MODIFYING_OUTPUT_REGISTER0#defineDIG_FREQ100000000#defineALT_MODULE_CLASS_DIGaltera_avalon_pio#defineSEL_NAME"/dev/SEL"#defineSEL_TYPE"altera_avalon_pio"#defineSEL_BASE0x00001810#defineSEL_SPAN16#defineSEL_DO_TEST_BENCH_WIRING0#defineSEL_DRIVEN_SIM_VALUE0#defineSEL_HAS_TRI0#defineSEL_HAS_OUT1#defineSEL_HAS_IN0#defineSEL_CAPTURE0#defineSEL_DATA_WIDTH6#defineSEL_RESET_VALUE0#defineSEL_EDGE_TYPE"NONE"#defineSEL_IRQ_TYPE"NONE"#defineSEL_BIT_CLEARING_EDGE_REGISTER0#defineSEL_BIT_MODIFYING_OUTPUT_REGISTER0#defineSEL_FREQ100000000#defineALT_MODULE_CLASS_SELaltera_avalon_pio利用system.h文件編寫的sopc.h文件:#ifndefSOPC_H_#defineSOPC_H_#include"system.h"#define_DIGtypedefstruct{unsignedlongintDATA;unsignedlongintDIRECTION;unsignedlongintINTERRUPT_MASK;unsignedlongintEDGE_CAPTURE;}SEL_STR;typedefstruct{unsignedlongintDATA;unsignedlongintDIRECTION;unsignedlongintINTERRUPT_MASK;unsignedlongintEDGE_CAPTURE;}DIG_STR;#ifdef_DIG#defineSEL((SEL_STR*)SEL_BASE)#defineDIG((DIG_STR*)DIG_BASE)#endif#endifmain.c文件全部源碼:#include<stdio.h>#include<unistd.h>#include"../inc/sopc.h"unsignecharsegtab[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};unsignedcharbittab[6]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf};intmain(){inti=0;while(1){SEL->DATA=bittab[i];DIG->DATA=segtab[i++];if(i==6)i=0;usleep(500000);}return0;}實驗三.定時器應(yīng)用實驗內(nèi)容在QUARTUSII軟件中構(gòu)建NIOSII軟核系統(tǒng),在NIOSIDE軟件中編寫程序,實現(xiàn)對固定時間段的計數(shù)。實驗原理配置NIOSII軟核的定時器,當定時器溢出時計數(shù),利用數(shù)碼管的動態(tài)顯示技術(shù)值。實驗步驟硬件設(shè)計.構(gòu)建NIOSII軟核系統(tǒng)NIOSII軟核包括cpu,sdram控制器,串行flash,jtag_uart,sysid,段選IO,位選IO,定時器。(2).構(gòu)建PLL模塊PLL輸入時鐘頻率為20MHZPLL輸出時鐘c0為輸入的5倍頻PLL輸出時鐘c1為輸入時鐘的5倍頻,相位偏移為-75度PLL模塊:(3).系統(tǒng)連線及引腳分配利用qsf文件進行引腳分配:set_location_assignment PIN_27 -to RESETset_location_assignment PIN_24 -to CLOCKset_location_assignment PIN_88 -to S_DB[0]set_location_assignment PIN_87 -to S_DB[1]set_location_assignment PIN_86 -to S_DB[2]set_location_assignment PIN_84 -to S_DB[3]set_location_assignment PIN_82 -to S_DB[4]set_location_assignment PIN_81 -to S_DB[5]set_location_assignment PIN_80 -to S_DB[6]set_location_assignment PIN_77 -to S_DB[7]set_location_assignment PIN_45 -to S_DB[8]set_location_assignment PIN_46 -to S_DB[9]set_location_assignment PIN_47 -to S_DB[10]set_location_assignment PIN_48 -to S_DB[11]set_location_assignment PIN_56 -to S_DB[12]set_location_assignment PIN_57 -to S_DB[13]set_location_assignment PIN_58 -to S_DB[14]set_location_assignment PIN_59 -to S_DB[15]set_location_assignment PIN_64 -to S_A[0]set_location_assignment PIN_63 -to S_A[1]set_location_assignment PIN_61 -to S_A[2]set_location_assignment PIN_60 -to S_A[3]set_location_assignment PIN_31 -to S_A[4]set_location_assignment PIN_33 -to S_A[5]set_location_assignment PIN_34 -to S_A[6]set_location_assignment PIN_35 -to S_A[7]set_location_assignment PIN_37 -to S_A[8]set_location_assignment PIN_39 -to S_A[9]set_location_assignment PIN_67 -to S_A[10]set_location_assignment PIN_40 -to S_A[11]set_location_assignment PIN_43 -to S_CLKset_location_assignment PIN_69 -to S_BA[0]set_location_assignment PIN_68 -to S_BA[1]set_location_assignment PIN_74 -to S_nCASset_location_assignment PIN_41 -to S_CKEset_location_assignment PIN_72 -to S_nRASset_location_assignment PIN_75 -to S_nWEset_location_assignment PIN_70 -to S_nCSset_location_assignment PIN_44 -to S_DQM[1]set_location_assignment PIN_76 -to S_DQM[0]set_location_assignment PIN_169 -to DIG[0]set_location_assignment PIN_168 -to DIG[1]set_location_assignment PIN_165 -to DIG[2]set_location_assignment PIN_164 -to DIG[3]set_location_assignment PIN_175 -to DIG[4]set_location_assignment PIN_173 -to DIG[5]set_location_assignment PIN_171 -to DIG[6]set_location_assignment PIN_170 -to DIG[7]set_location_assignment PIN_185 -to SEL[5]set_location_assignment PIN_182 -to SEL[4]set_location_assignment PIN_181 -to SEL[3]set_location_assignment PIN_180 -to SEL[2]set_location_assignment PIN_179 -to SEL[1]set_location_assignment PIN_176 -to SEL[0]軟件設(shè)計軟件全部

溫馨提示

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

最新文檔

評論

0/150

提交評論