【正文】
的組合應(yīng)用 把 FPGA 程序和單片機(jī)程序分別調(diào)試好后再組合起,鎖定引腳、編譯、下載進(jìn)行聯(lián)合調(diào)試。此外,等精度頻率計(jì)設(shè)計(jì)、單片機(jī) C 語言的編寫,也讓我受益很多。 clr:in std_logic。 architecture behav of etester is signal bzq:std_logic_vector(31 downto 0)。 bzh:process(bclk,clr) begin if clr=39。 then if bena=39。 then tsq=(others=39。 then tsq=tsq+1。 elsif tclk39。 clk2=ma and q1。 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 25 elsif clk139。139。end if。139。039。039。 sbit sel0=P0^4。 define d P2 //等精度頻率計(jì)的數(shù)據(jù)口 define Data P1 //液晶的數(shù)據(jù)口 char data Test1[]={ }。 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 27 DelayUs(250)。 E=0。 E=0。 l=line4。 WriteCommand(0x01)。 InitLcd()。 cl=1。 sel2=0。 b=8。 sel1=1。 sel2=1。 t=8。 39。039。039。Z39。 if(k4==0) { spul=0。 sel2=0。 n1=n1+d。 sel0=0。 clr=0。 sel2=0。 n2=8。 TimeNum[0]=39。 TimeNum[4]=39。 TimeNum[8]=39。 TimeNum[12]=39。 InitLcd()。 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 35 sprintf(Test1,DUTY: )。 TimeNum[13]=39。 TimeNum[9]=39。 TimeNum[5]=s/10+39。 TimeNum[1]=39。 sel2=0。 sel0=0。 cl=1。 n1=n1+d。 sel1=0。 sel0=1。 clr=1。 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 32 DelayMs(15)。039。039。 39。 s=(40000000/b)*t。 sel0=1。 t=d。 sel2=0。 sel0=0。 cl=0。 //初始化界面顯示 ShowString(0,Test1)。 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 29 clr=1。i16。 } void ShowChar(unsigned char pos,unsigned char c) 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 28 { unsigned char p。 E=0。 E=0。 void DelayUs(unsigned int us) { unsigned int ust。 sbit eend=P0^3。 end behav。139。139。 dd3:process(clk3,clr) begin if clr=39。039。139。 ss=q2amp。139。 end if 。)。 then bzq=bzq+1。 then bzq=(others=39。 signal ena:std_logic。 spul:in std_logic。物理學(xué)院全體電子教研組的老師都為我們?nèi)嗤瑢W(xué)的畢業(yè)設(shè)計(jì)付出了辛勤的勞動(dòng)。 圖 313 總體框圖 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 17 第四章 程序調(diào)試 等精度頻率計(jì)程序 把等精度頻率計(jì)模塊與單片機(jī)系統(tǒng)正確確連接,鎖定好引腳,特別注意不用的單片機(jī) I/O 口要接地。 E端為使能端,當(dāng) E端由高電平跳變成低電平時(shí),液晶模塊執(zhí)行命令。 液晶顯示 液晶顯示器以其微功耗、體積小、顯示內(nèi)容豐富、超薄輕巧的諸多優(yōu)點(diǎn),在袖珍式儀表和低功耗應(yīng)用系統(tǒng) 中得到越來越廣泛的應(yīng)用。測(cè)試開始前,首先發(fā)出一個(gè)清零信號(hào) CLR,使兩個(gè)計(jì)數(shù)器和 D 觸發(fā)器置 0,同時(shí) D 觸發(fā)器通過信號(hào) ENA,禁止兩個(gè)計(jì)數(shù)器計(jì)數(shù)。標(biāo)準(zhǔn)頻率越高,測(cè)量的相對(duì)誤差越小。 圖 34 等精度測(cè)頻實(shí)現(xiàn)原理 等精度測(cè)頻方法是在直接測(cè)頻方法的基礎(chǔ)上發(fā)展起來的。高 128字節(jié)須用間接尋址方式訪問。載入鎖相環(huán),設(shè)置其輸入頻率為 20MHz,輸出頻率為40MHz, 8051V1 能接受的工作時(shí)鐘頻率上限取決于 FPGA 的速度級(jí)別。然而普通 8051 芯片的內(nèi)部 RAM 是在芯片內(nèi)的,而外部 ROM 的連接必須以總線方式與其 P0、 P2 口相接( AT89S51 的 ROM 在芯片內(nèi), CPU 核外)。此單片機(jī)的任務(wù)是將測(cè)得的頻率在 LCD 顯示。 FPGA 編程器、字符型液晶驅(qū)動(dòng)口(可直接接多種類型字符型液晶)、點(diǎn)陣型液晶驅(qū)動(dòng)口(可直接接數(shù)字彩色或黑白點(diǎn)陣型液晶)。 主要任務(wù) 在了解數(shù)字頻率計(jì)的基礎(chǔ)上分析等精度頻率計(jì)相對(duì)于傳統(tǒng)頻率計(jì)的優(yōu)越性,研究等精度頻率計(jì) 的工作原理和實(shí)現(xiàn)方法,在 FPGA 開發(fā)板提供的硬件環(huán)境上設(shè)計(jì)程序運(yùn)行的流程框圖。隨著 FPGA的規(guī)模越來越大,設(shè)計(jì)越來越復(fù)雜,使用 IP 核是一個(gè)發(fā)展趨勢(shì)。隨著 FPGA 的規(guī)模越來越大,使用 IP 核是一個(gè)發(fā)展趨勢(shì)。 關(guān) 鍵詞: FPGA, 8051IP 核 ,等精度頻率計(jì)設(shè)計(jì) Abstract Field Programmable Gate Array(FPGA)is one of the most weled programmable logic devices. IP core is a module which has changeable parameters. With the IP core we can implement some plex functional module in digital circuits. With the increasing scale in the FPGA, Using IP core is being more and more popular. Traditional frequency measurement principle of the frequency accuracy will decline with the decline of the signal Has a greater limitations in use. Equal precision frequency meter not only has high measurement accuracy, and the whole frequency region can maintain a constant test accuracyCombining the advantages of FPGA and 805 l MCU, the paper mainly realize the application of 8051 IP core based on FPGA that design a same accuracy frequency. Key words: FPGA, 8051 IP core, same accuracy frequency 目錄 大學(xué)本科生畢業(yè)設(shè)計(jì)(論文) 2 第一章 緒論 .............................................................. 3 課題研究背景及意義 ................................................ 3 主要任務(wù) .......................................................... 3 第二章 杭州康芯公司 KX2C5F+開發(fā)板介紹 ..................................... 5 KX2C5F+系統(tǒng)簡(jiǎn)介 ................................................... 5 主要應(yīng)用 .......................................................... 5 第三章 系統(tǒng)設(shè)計(jì) .......................................................... 7 8051 單片機(jī)介紹 ................................................... 7 8051 單片機(jī)