版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、LED數(shù)碼管顯示的VHDL設(shè)計(jì)桂林師范高等??茖W(xué)校羊日飛LED數(shù)碼管顯示實(shí)例運(yùn)行環(huán)境n紅色颶風(fēng)二代XILINX FPGA開(kāi)發(fā)板 RC2-3S400 LED數(shù)碼管的板級(jí)硬件電路n四位8段式共陰數(shù)碼管1位2位3位4位位線位線段線段線LED數(shù)碼管的板級(jí)硬件電路nLED數(shù)碼管位線驅(qū)動(dòng)電路qSEG_LED_S0、 SEG_LED_S1、 SEG_LED_S2 SEG_LED_S3 接FPGA相應(yīng)引腳LED數(shù)碼管的板級(jí)硬件電路n8段式共陰數(shù)碼管的段碼一、LED數(shù)碼管的靜態(tài)顯示LED數(shù)碼管的靜態(tài)顯示n四位數(shù)碼管顯示相同的字符n依次顯示從0F的各個(gè)字符,每隔1s顯示一個(gè)字符。 四位數(shù)碼管器件內(nèi)部復(fù)用了每位數(shù)碼
2、管的8條數(shù)據(jù)線(a,b,c,d,e,f,g,dp) 若同時(shí)將四位數(shù)碼管的位線(共陰公共端)接到低電平,則相當(dāng)于同時(shí)選中數(shù)碼管的4個(gè)位。 此時(shí)若段線輸入某個(gè)段碼,則四位數(shù)碼管顯示段碼對(duì)應(yīng)的同一字符。LED數(shù)碼管靜態(tài)顯示的芯片級(jí)設(shè)計(jì)框圖時(shí)鐘源50MHz分頻器計(jì)數(shù)器數(shù)碼管驅(qū)動(dòng)四位LED數(shù)碼管FPGA1/50000000分頻輸出時(shí)鐘信號(hào)的頻率是1Hz,周期為1s。16進(jìn)制計(jì)數(shù)器即有16種狀態(tài),每經(jīng)過(guò)1s計(jì)數(shù)值加“1”,也即跳到下一個(gè)狀態(tài)。段碼譯碼器將16種狀態(tài)碼轉(zhuǎn)換為相應(yīng)的8位二進(jìn)制LED數(shù)碼管段碼段碼。1/50000000分頻器(Divider)entity clkdiv is port( rese
3、t: in std_logic;clkin: in std_logic;clkout: buffer std_logic );end clkdiv;實(shí)體1/50000000分頻器(Divider)architecture clkdiv_stru of clkdiv is signal count: integer range 0 to 25000000:=0;begin process( reset , clkin) begin if reset=0 then count=0; q=0; elsif clkinevent and clkin=1 then if count=25000000 t
4、hen count=0; clkout= not clkout; else count=count+1; end if; end if; end process; end clkdiv_stru;結(jié)構(gòu)體16進(jìn)制計(jì)數(shù)器entity counter is port( reset: in std_logic; clock: in std_logic; countout: out std_logic_vector(3 downto 0) );end counter;architecture counter_stru of counter is signal count: std_logic_vecto
5、r(3 downto 0);begin process( reset , clock) begin if reset=0 then count=“0000”; elsif clockevent and clock=1 then if count=“1111” then count=“0000”; else count=count+ “0001” ; end if; end if; end process; countout Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y , clkin= , clkout=
6、 ); counter_m:counter port map( reset= , clock= ,countout= ); decoderledout_m:decoderledout port map( state= , Y= ); ledbits=“1111”;end led8seg_stru;三個(gè)子模三個(gè)子模塊的元件塊的元件聲明聲明resetmclki_clkreseti_clki_statei_stateledsegsLED數(shù)碼管顯示的VHDL代碼綜合結(jié)果(頂層)LED數(shù)碼管顯示的VHDL代碼綜合結(jié)果(子模塊)二、LED數(shù)碼管的動(dòng)態(tài)顯示LED數(shù)碼管的動(dòng)態(tài)顯示n四位數(shù)碼管顯示不同的字符,比
7、如“1234”n實(shí)現(xiàn)原理:n由于四位數(shù)碼管器件內(nèi)部復(fù)用了每位數(shù)碼管的8條數(shù)據(jù)線(a,b,c,d,e,f,g,dp),所以若要四位數(shù)碼管顯示不同的字符,則一位顯示時(shí)(占用了段線)其它三位應(yīng)該不能顯示。(通過(guò)控制位線實(shí)現(xiàn))LED數(shù)碼管的動(dòng)態(tài)顯示n實(shí)現(xiàn)原理:n由于人眼的視覺(jué)暫留效應(yīng),當(dāng)循環(huán)時(shí)間很短時(shí),人眼看到的效果如下圖所示:n動(dòng)態(tài)刷新時(shí)間:q電視的場(chǎng)頻:50Hz,即每20ms更新一幅畫(huà)面q刷新頻率太慢則會(huì)有閃爍現(xiàn)象q刷新頻率太快則則亮度不夠q一般在幾ms左右作業(yè):LED數(shù)碼管動(dòng)態(tài)顯示n四位數(shù)碼管顯示不同的字符,比如“1234”修改分頻器architecture clkdiv_stru of clk
8、div is signal count: integer range 0 to 25000000:=0;begin process( reset , clkin) begin if reset=0 then count=0; q=0; elsif clkinevent and clkin=1 then if count=25000000 then count=0; clkout= not clkout; else count=count+1; end if; end if; end process; end clkdiv_stru;結(jié)構(gòu)體architecture clkdiv_stru of
9、clkdiv is signal count: integer range 0 to 50000:=0;begin process( reset , clkin) begin if reset=0 then count=0; q=0; elsif clkinevent and clkin=1 then if count=49999 then count=0; clkout= not clkout; else count=count+1; end if; end if; end process; end clkdiv_stru;修改計(jì)數(shù)器architecture counter_stru of
10、counter is signal count: std_logic_vector(3 downto 0);begin process( reset , clock) begin if reset=0 then count=“0000”; elsif clockevent and clock=1 then if count=“1111” then count=“0000”; else count=count+ “0001” ; end if; end if; end process; countout=count;end counter_stru;architecture counter_st
11、ru of counter is signal count: std_logic_vector(3 downto 0);begin process( reset , clock) begin if reset=0 then count=“0000”; elsif clockevent and clock=1 then if count=“0011” then count=“0000”; else count=count+ “0001” ; end if; end if; end process; countout Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y = “00111111”; ledbits Y = “00000110”; ledbits Y = “
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 企業(yè)內(nèi)部審計(jì)質(zhì)量控制與改進(jìn)指南(標(biāo)準(zhǔn)版)
- 基于生成式AI的中學(xué)語(yǔ)文主題式教研的文學(xué)素養(yǎng)培養(yǎng)研究教學(xué)研究課題報(bào)告
- 傳統(tǒng)節(jié)日慶?;顒?dòng)在小學(xué)數(shù)學(xué)教學(xué)中的應(yīng)用與實(shí)踐教學(xué)研究課題報(bào)告
- 公司治理管理標(biāo)準(zhǔn)
- 小學(xué)道德與法治課程中法治意識(shí)與公民責(zé)任感培養(yǎng)的研究課題報(bào)告教學(xué)研究課題報(bào)告
- 2025年共享經(jīng)濟(jì)行業(yè)商業(yè)模式與監(jiān)管挑戰(zhàn)報(bào)告
- 企業(yè)采購(gòu)流程優(yōu)化與合規(guī)管理手冊(cè)(標(biāo)準(zhǔn)版)
- 2025年食品衛(wèi)生安全操作與管理指南
- 2025年企業(yè)人力資源管理與員工激勵(lì)實(shí)施手冊(cè)
- 城市公共自行車租賃系統(tǒng)開(kāi)發(fā)與運(yùn)營(yíng)合同
- 趙玉平管理領(lǐng)導(dǎo)學(xué)
- JJF 1129-2005尿液分析儀校準(zhǔn)規(guī)范
- GB/T 17941-2008數(shù)字測(cè)繪成果質(zhì)量要求
- 八年級(jí)數(shù)學(xué):菱形-菱形的性質(zhì)課件
- 煙道專項(xiàng)施工方案
- 人力資源統(tǒng)計(jì)學(xué)(第二版)新課件頁(yè)
- 中國(guó)醫(yī)院質(zhì)量安全管理 第4-2部分:醫(yī)療管理 護(hù)理質(zhì)量管理 T∕CHAS 10-4-2-2019
- 水肥一體化施工組織設(shè)計(jì)
- 某辦公樓室內(nèi)裝飾工程施工設(shè)計(jì)方案
- 高考復(fù)習(xí)反應(yīng)熱
- 小學(xué)生常用急救知識(shí)PPT
評(píng)論
0/150
提交評(píng)論