LED點(diǎn)陣屏上文字顯示實(shí)驗(yàn)_第1頁(yè)
LED點(diǎn)陣屏上文字顯示實(shí)驗(yàn)_第2頁(yè)
LED點(diǎn)陣屏上文字顯示實(shí)驗(yàn)_第3頁(yè)
LED點(diǎn)陣屏上文字顯示實(shí)驗(yàn)_第4頁(yè)
LED點(diǎn)陣屏上文字顯示實(shí)驗(yàn)_第5頁(yè)
已閱讀5頁(yè),還剩15頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、LED點(diǎn)陣屏上文字顯示實(shí)驗(yàn)李宇 pb09013011實(shí)驗(yàn)要求:在試驗(yàn)板的8×8的LED點(diǎn)陣屏上分別顯示“PLD電子技術(shù)”。編程思想:1.首先定義控制LED點(diǎn)陣屏的端口組a,b,及時(shí)鐘和復(fù)位端口Port ( a : inout STD_LOGIC_VECTOR (7 downto 0;b : inout STD_LOGIC_VECTOR (7 downto 0;clk : in STD_LOGIC;reset : in STD_LOGIC;2.字的跳變顯示是通過改變整型變量m的值來選擇掃描的程序段3.對(duì)LED點(diǎn)陣屏的工作方式清楚,XUP板子上采用的是共陰極8x8點(diǎn)陣LED。8X8點(diǎn)陣L

2、ED結(jié)構(gòu)如下圖所示 從圖中可以看出,8X8點(diǎn)陣共需要64個(gè)發(fā)光二極管組成,且每個(gè)發(fā)光二極管是放置在行線和列線的交叉點(diǎn)上,當(dāng)對(duì)應(yīng)的某一列置0電平,某一行置0電平,則相應(yīng)的二極管就亮;本程序中是通過對(duì)行掃描,并對(duì)當(dāng)前行中需要亮燈的列置0來實(shí)現(xiàn)顯示過程。示例程序段如下:if(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11101111"b<="10111111"count<

3、=count+1;elsif(count=3*N/8 thena<="11101111"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101111"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11101111"b<="11110111"count<=count+1;elsif(count=N*3/4

4、thena<="11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101111"b<="11111101"count<=count+1;elsif(count=Nthena<="11100011"b<="11111110"count<=0;VHDL代碼:- Company:- Engineer:- Create Date: 10:09:58 0

5、5/24/2012- Design Name:- Module Name: expp8 - Behavioral- Project Name:- Target Devices:- Tool versions:- Description:- Dependencies:- Revision:- Revision 0.01 - File Created- Additional Comments:-library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;-

6、 Uncomment the following library declaration if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity expp8 isgeneric(N: integer :=16000;Port ( a : inout STD_LOGIC_VECTOR (7 downto 0;b : inout STD_LOGIC_VECTOR (7 downto 0;clk : in STD_LOGIC;reset : in S

7、TD_LOGIC;end expp8;architecture Behavioral of expp8 issignal count:INTEGER RANGE 0 to N:=0;-count用來對(duì)LED掃描分頻用 -count1用來產(chǎn)生1HZ的分頻信號(hào)signal count1:INTEGER RANGE 0 to 49999999:=0;signal m:integer:=0;-用m的數(shù)值來選擇該掃描顯示那個(gè)字beginprocess(reset,clkbegin-復(fù)位時(shí)的表現(xiàn)為屏上的燈全部點(diǎn)亮if(reset='0' thena<="00000000&q

8、uot;b<="00000000"count<=0;m<=0;count1<=0;elseif(rising_edge(clk thenif count1=49999999 then -一赫茲的分頻信號(hào)產(chǎn)生m<=m+1;count1<=0;else count1<=count1+1;end if;-m=0時(shí)采用掃描的方式顯示第一個(gè)字母“P”if m=0 then-所選行中點(diǎn)亮的燈的時(shí)間為N/8個(gè)周期 if(count=N/8 thena<="11111111"b<="01111111&quo

9、t;count<=count+1;elsif(count=N/4 thena<="11100111"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11101011"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101011"b<="11101111"count<=count+1;elsif(cou

10、nt=N*5/8 thena<="11100111"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101111"b<="11111101"count<=count+1;elsif(count=Nthena<="1110

11、1111"b<="11111110"count<=0;elsecount<=count+1;end if;-m=1時(shí)顯示“L”,時(shí)長(zhǎng)同樣為1秒elsif m=1 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11101111"b<="10111111"count<=count+1;elsif(count=3*

12、N/8 thena<="11101111"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101111"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11101111"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="1110111

13、1"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101111"b<="11111101"count<=count+1;elsif(count=Nthena<="11100011"b<="11111110"count<=0;elsecount<=count+1;end if;-m=2顯示“D”,時(shí)長(zhǎng)為一秒 elsif m=2 thenif(count=N/8 then

14、a<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11100111"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11101011"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101101"b&l

15、t;="11101111"count<=count+1;elsif(count=N*5/8 thena<="11101101"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11101101"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101011"b<="11111101"c

16、ount<=count+1;elsif(count=Nthena<="11100111"b<="11111110"count<=0;elsecount<=count+1;end if;-m=3顯示“電”,時(shí)長(zhǎng)為一秒elsif m=3 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11101111"b<="

17、;10111111"count<=count+1;elsif(count=3*N/8 thena<="10000011"b<="11011111"count<=count+1;elsif(count=N/2thena<="10000011"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="10000011"b<="11110111"count<=co

18、unt+1;elsif(count=N*3/4 thena<="11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101011"b<="11111101"count<=count+1;elsif(count=Nthena<="11100011"b<="11111110"count<=0;elsecount<=count+1;end if;

19、-m=4顯示“子”,時(shí)長(zhǎng)為一秒 elsif m=4 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11100011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11111011"b<="11011111"count<=count+1;e

20、lsif(count=N/2thena<="11000001"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11110111"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11110111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<=

21、"11100111"b<="11111101"count<=count+1;elsif(count=Nthena<="11110111"b<="11111110"count<=0;elsecount<=count+1;end if;-m=5顯示“技”,時(shí)長(zhǎng)為一秒elsif m=5 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(coun

22、t=N/4 thena<="11011011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="10000001"b<="11011111"count<=count+1;elsif(count=N/2thena<="11000001"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11010

23、101"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="10011111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="10011011"b<="11111101"count<=count+1;elsif(count=Nthena<="11010101"b<="11111110

24、"count<=0;elsecount<=count+1;end if;-m=6顯示“術(shù)”,時(shí)長(zhǎng)為一秒elsif m=6 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11110011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11000001"b<="11011111"count<=count+1;elsif(count=N/2thena<="11110111"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11100011"b<="11110111&q

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝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ù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論