




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、微型計算機技術(shù) 課程設(shè)計 指導教師: 班 級: 姓 名: 學 號: 班內(nèi)序號: 課設(shè)日期: _目 錄一、課程設(shè)計題目3二、設(shè)計目的3三、設(shè)計內(nèi)容3四、設(shè)計所需器材與工具3五、設(shè)計思路4六、設(shè)計步驟(含流程圖和代碼)4七、課程設(shè)計小結(jié)36一、課程設(shè)計題目:點陣顯示系統(tǒng)電路及程序設(shè)計利用匯編語言與微型計算機技術(shù)課程中所學的可編程接口芯片8253、8255a、8259設(shè)計一個基于微機控制的點陣顯示系統(tǒng)。二、設(shè)計目的1通過本設(shè)計,使學生綜合運用匯編語言與微型計算機技術(shù)、數(shù)字電子技術(shù)等課程的內(nèi)容,為今后從事計算機檢測與控制工作奠定一定的基礎(chǔ)。2掌握接口芯片8253、8255a、8259等可編程器件、譯碼
2、器74ls138、8路同相三態(tài)雙向總線收發(fā)器74ls245、點陣顯示器件的使用。3學會用匯編語言編寫一個較完整的實用程序。4掌握微型計算機技術(shù)應用開發(fā)的全過程,包括需求分析、原理圖設(shè)計、元器件選用、布線、編程、調(diào)試、撰寫報告等步驟。三、設(shè)計內(nèi)容1點陣顯示系統(tǒng)啟動后的初始狀態(tài)在計算機顯示器上出現(xiàn)菜單:dot matrix display system1.left shift display2.up shift display3.s stop4.esc exit2點陣顯示系統(tǒng)運行狀態(tài)按計算機光標鍵,點陣逐列向左移動并顯示:“微型計算機技術(shù)課程設(shè)計,點陣顯示系統(tǒng),計科11302班,陳嘉敏,彭曉” 。
3、按計算機光標鍵,點陣逐行向上移動并顯示:“微型計算機技術(shù)課程設(shè)計,點陣顯示系統(tǒng),計科11302班,陳嘉敏,彭曉” 。按計算機光標s鍵,點陣停止移動并顯示當前字符。3結(jié)束程序運行狀態(tài)按計算機esc鍵,結(jié)束點陣顯示系統(tǒng)運行狀態(tài)并顯示“?!?。四設(shè)計所需器材與工具1一塊實驗面包板(內(nèi)含時鐘信號1mhz或2mhz)。 2可編程芯片8253、8255、74ls245、74ls138各一片,16×16點陣顯示器件一片。3導線若干。4示波器、萬用表、常用工具等共用(從實驗室現(xiàn)借現(xiàn)還)。五、設(shè)計思路 1利用74ls138設(shè)計地址譯碼電路,8255端口地址:300h303h,8253端口地址:304h3
4、07h。274ls245用于總線和8253、8255之間的雙向傳輸和隔離。3利用面包板上時鐘(1mhz或2mhz)和8253設(shè)計一個1毫秒定時電路,將定時信號(1毫秒方波)接到總線的irq2或irq10送給8259控制點陣左移或上移。4選擇8255的pa0、pa4、pa5和pb4、pb5、pb6、pb7,7個位控制點陣顯示器件行和列的數(shù)據(jù)串行輸入、輸入脈沖、鎖存脈沖(并行輸出脈沖)。六、設(shè)計步驟1.電路原件介紹(1)74ls245數(shù)據(jù)總路線緩沖器 圖6-1-1 74ls245的功能表 圖6-1-2圖6-1-3(2)74ls138 圖6-1-4標準地址譯碼電路 圖6-1-58255cs對應的地址
5、為300h303h, 8253cs對應的地址為304h307h。簡化后的非標準地址譯碼電路 圖6-1-6(3).8253定時/計數(shù)器 圖6-1-7(4).8255a 圖6-1-8(5).點陣顯示器件 圖6-1-9 圖6-1-10 附4、課程設(shè)計所用器件 圖6-1-12 附5、點陣生成圖 圖6-1-13 圖6-1-14 圖6-1-15 圖6-1-16 圖6-1-17 圖6-1-18 圖6-1-19 圖6-1-20開始2.流程圖初始化8253、8255a及8259芯片,選擇計數(shù)器1、2,輸出端口a、b,工作方式0顯示主界面信息,點陣顯示出字模,停止不移動中斷服務(wù)程序,不斷掃描鍵盤,等待有鍵按下(1
6、.2.3.4)并執(zhí)行相應服務(wù)程序按鍵4啟動esc功能,調(diào)用退出程序,點陣顯示“?!保⒔Y(jié)束顯示。按鍵3啟動stopdisplay功能,調(diào)用停止程序,點陣停止移動并顯示當前字符按鍵2啟動upshift功能,調(diào)用上移程序,并顯示在點陣上按鍵1啟動leftshift功能,調(diào)用左移程序,并顯示在點陣上3.電路圖 圖6-3-1注:(1)電路箱總芯片上已集成8259芯片,實際連接時8253的out2直接接到總芯片的irq10處;(2)實際連接時,是由8255a芯片的pa0、pa4、pa5、pb4、pb5、pb6、pb7控制點陣顯示屛;pa0r1、pa4sck、pa5latch、pb4a、pb5b、pb6c
7、、pb7d。gnd和en/oe接地,+5v接電源正極。4.正確運用所給器件布線,搭接硬件電路初始接線圖 圖6-4-1 測試中發(fā)現(xiàn)8255無法正常工作,檢查得知面包板底下有短路,重新申請新的面包板,更改部分線路,最后得到線路圖如下,并測試成功。最終接線圖及測試 圖6-4-25.詳細匯編代碼data segment微db 12h, 10h, 12h, 10h, 2ah, 90h, 4ah, 0a4h, 8ah, 0beh, 1fh, 0c4h,20h, 24h, 7fh, 0a8h, 0a0h, 28h, 2fh, 28h, 29h, 10h, 29h, 50h, 29h, 0a8h, 29h,
8、28h, 30h, 46h, 20h, 84h型 db 01h, 04h, 7fh, 84h, 12h, 24h, 12h, 24h, 12h, 24h, 0ffh, 0a4h, 12h, 24h, 12h, 24h, 12h, 04h, 23h, 14h, 41h, 08h, 7fh, 0fch, 01h,00h, 01h, 04h, 0ffh, 0feh, 00h, 00h計 db 00h, 40h, 20h, 40h, 10h, 40h, 10h, 40h, 00h, 40h, 00h, 44h, 0f7h, 0feh, 10h, 40h, 10h, 40h, 10h, 40h, 10h
9、, 40h, 12h, 40h, 14h, 40h, 18h, 40h, 10h, 40h, 00h, 40h算 db 20h, 80h, 3eh, 0fch, 49h, 20h, 9fh, 0f0h, 10h, 10h, 1fh, 0f0h, 10h, 10h, 1fh, 0f0h, 10h, 10h, 1fh, 0f0h, 08h, 24h, 0ffh, 0feh, 08h, 20h, 08h, 20h, 10h, 20h, 20h, 20h機 db 10h, 00h, 10h, 10h, 11h, 0f8h, 11h, 10h, 0fdh, 10h, 11h, 10h, 31h, 10h
10、, 39h, 10h, 55h, 10h, 51h, 10h, 91h, 10h, 11h, 10h, 11h, 12h, 12h, 12h, 14h, 0eh, 18h, 00h技 db 10h, 40h, 10h, 40h, 10h, 48h, 13h, 0fch, 0fch, 40h, 10h, 40h, 10h, 40h, 13h, 0f8h, 1ah, 08h, 31h, 10h, 0d1h, 10h, 10h, 0a0h, 10h, 40h, 10h, 0b0h, 51h, 0eh, 26h, 04h術(shù) db 01h, 00h, 01h, 40h, 01h, 30h, 01h, 1
11、0h, 01h, 04h, 0ffh, 0feh, 01h, 00h, 03h, 80h, 05h, 40h, 09h, 20h, 11h, 10h, 21h, 0eh, 0c1h, 04h, 01h, 00h, 01h, 00h, 01h, 00h課 db 00h, 08h, 43h, 0fch, 22h, 48h, 22h, 48h, 03h, 0f8h, 02h, 48h, 0e2h, 48h, 23h, 0f8h, 20h, 40h, 2fh, 0feh, 20h, 0e0h, 29h, 50h, 32h, 48h, 24h, 4eh, 08h, 44h, 00h, 40h程 db 0
12、8h, 04h, 1dh, 0feh, 0f1h, 04h, 11h, 04h, 11h, 04h, 0ffh, 04h, 11h, 0fch, 38h, 00h, 37h, 0feh, 54h, 20h,50h, 28h, 91h, 0fch, 10h, 20h, 10h, 24h, 17h, 0feh, 10h, 00h設(shè) db 01h, 0f0h, 21h, 10h, 11h, 10h, 11h, 10h, 01h, 10h, 02h, 0eh, 0f4h, 00h, 13h, 0f8h, 11h, 08h, 11h, 10h, 10h, 90h, 10h, 0a0h, 14h, 40h
13、, 18h, 0b0h, 13h, 0eh, 0ch, 04h計 db 00h, 40h, 20h, 40h, 10h, 40h, 10h, 40h, 00h, 40h, 00h, 44h, 0f7h, 0feh, 10h, 40h, 10h, 40h, 10h, 40h, 10h, 40h, 12h, 40h, 14h, 40h, 18h, 40h, 10h, 40h, 00h, 40hdou0 db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 0
14、0h, 18h, 00h, 18h, 00h, 10h, 00h, 20h, 00h, 00h, 00h, 00h, 00h點 db 02h, 00h, 02h, 00h, 02h, 08h, 03h, 0fch, 02h, 00h, 02h, 10h, 3fh, 0f8h, 20h, 10h, 20h, 10h, 20h, 10h, 3fh, 0f0h, 00h, 00h, 29h, 10h, 24h, 0c8h, 44h, 44h, 80h, 04h陣 db 00h, 80h, 78h, 84h, 4fh, 0feh, 50h, 80h, 50h, 0a0h, 61h, 20h, 51h,
15、 28h, 4bh, 0fch, 48h, 20h, 48h, 20h, 68h, 24h, 57h, 0feh, 40h, 20h, 40h, 20h, 40h, 20h, 40h, 20h顯 db 00h, 10h, 1fh, 0f8h, 10h, 10h, 10h, 10h, 1fh, 0f0h, 10h, 10h, 10h, 10h, 1fh, 0f0h, 14h, 50h, 44h, 44h, 34h, 4ch, 14h, 50h, 04h, 40h, 04h, 44h, 0ffh, 0feh, 00h, 00h示 db 00h, 10h, 3fh, 0f8h, 00h, 00h,
16、00h, 00h, 00h, 00h, 00h, 04h, 0ffh, 0feh, 01h, 00h, 01h, 00h, 09h, 20h, 19h, 18h, 21h, 0ch, 41h, 04h, 01h, 00h, 05h, 00h, 02h, 00h系 db 00h, 38h, 7fh, 0c0h, 04h, 00h, 04h, 10h, 08h, 20h, 3fh, 0c0h, 01h, 00h, 02h, 20h, 04h, 10h, 3fh, 0f8h, 01h, 08h, 09h, 20h, 09h, 10h, 11h, 08h, 25h, 08h, 02h, 00h統(tǒng) db
17、 10h, 80h, 10h, 40h, 20h, 48h, 27h, 0fch, 48h, 80h, 0f9h, 10h, 12h, 08h, 27h, 0fch, 41h, 24h, 0f9h, 20h, 41h, 20h, 01h, 20h, 1ah, 22h, 0e2h, 22h, 44h, 1eh, 08h, 00hdou2 db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 18h, 00h, 18h, 00h, 10h, 00h
18、, 20h, 00h, 00h, 00h, 00h, 00hzhang db 09h, 00h, 0fdh, 08h, 09h, 08h, 09h, 10h, 09h, 20h, 79h, 40h,41h, 04h, 47h, 0feh, 41h, 40h, 79h, 40h, 09h, 20h, 09h, 20h, 09h, 10h, 09h, 4eh, 51h, 84h, 21h, 00h strmenu db 'dot matrix display system',0ah,0dh,'1.','l',' left shift disp
19、lay',0ah,0dh,'2.','u',' up shift display',0ah,0dh,'3.s stop',0ah,0dh,'4.esc exit',0ah,0dh,0ah,0dh,'$'outset dw 0000h;用于存放字符首地址,增加程序可移植性。 count db 35;用于指示漢字的個數(shù)stopflag db 00h;暫停標志位:用于輔助實現(xiàn)暫停功能。(1)如果為0收到中斷后,可以movestep;(2)否則不行。status db 00h;輔助實現(xiàn)第一種中斷。;
20、為了實現(xiàn)“利用中斷來刷屏”,需要用到兩個變量。indexofline dw 0006h;行標,用來指示當前刷屏從第幾行開始。用于輔助實現(xiàn)showupward范圍是0count*16-1。當超過的時候,應該使其等于00indexofword db 00h;漢字的指針(只能放256個漢字嘍),輔助實現(xiàn)showleftward的movestep db 00h;以每個漢字為中心,的位移量,用于left。:出于我們點陣的數(shù)據(jù)格式,其范圍在016之間。;用于恢復原中斷向量int0a_off dw(?)int0a_seg dw(?) ;test:用于輔助做測試的變量。times db 00hdata end
21、scode segment 'code'assume ds:data,cs:code;-startstart:mov dx,datamov ds,dxlea dx,wei ;設(shè)置字符的開始位置mov outset,dxcall ini8255call ini8253mov ax,3572h ;獲取原中斷向量 int 21h mov int0a_off,bx ;保存原中斷向量 mov bx,es mov int0a_seg,bx cli ;關(guān)中斷 mov ax,2572h mov dx,seg movestepleft ;設(shè)置新的中斷向量 push ds mov ds,dx mo
22、v dx,offset movestepleft int 21h pop ds sti ;開中斷 in al,0a1h ;打開irq10 and al,0fbh out 0a1h,al in al,21h ;打開irq2 and al,0fbh out 21h,allea dx,strmenumov ah,09hint 21h;刷屏。notend:mov ah,0bh ;檢查是否有鍵按下 int 21h inc al jnz notend2 ; 若無鍵按下,則跳過判斷 mov ah,08h ;如有q或q鍵按下,則程序退出 int 21h cmp al,'s'當鍵入為's
23、'的時候,停止led滾動jz jstopcmp al,'s'jz jstopcmp al,1bh;當鍵入為esc的時候,退出程序jz jexitcmp al,'u'當鍵入u的時候,調(diào)用up:(1)改變status變量=2;(2)改變stopflag;(3)改變中斷表向量為“moveleftstep",從而實現(xiàn)中斷移位jz jupcmp al,'u'jz jupcmp al,'l'當鍵入l的時候,調(diào)用left:(1)改變status變量=2;(2)改變stopflag;(3)改變中斷向量表為“moveleftste
24、p",從而實現(xiàn)中斷移位jz jleftcmp al,'l'jz jleft cmp al,'q' jz jexitcmp al,'q' jz jexitnotend2:cmp status,01hjz jleftshow;以向左的方式,刷屏cmp status,02hjz jupshow;以向上的方式刷屏;call delaycall delayjmp notendjstop:call stopjmp notendjleft:call leftjmp notendjup:call upjmp notendjexit:call exitj
25、leftshow:call showleftward;call delay;?也許對于cpu位的位移,這個delay最好是放在movestepleft函數(shù)的內(nèi)部;call movestepleft;-如果中斷沒起作用,那就用cup來位移。mov ah,2mov dl,'l'int 21hjmp notendjupshow:call showupward;call delay;call movestepup;-如果中斷沒起作用,那就用cup來位移。mov ah,2mov dl,'u'int 21hjmp notend;-根據(jù)鍵盤輸入,改變中斷向量表,從而選擇是向上
26、,還是向下移動。-left:;(1)把中斷處理程序“向左左位”的中斷程序放入中斷向量表中。;(2)同時將status置為1,表示的是以向左的方式刷屏;(3)置暫停位為00h;(4)開始循環(huán)。push axpush dxmov ah,2mov dl,'l'int 21h cli ;關(guān)中斷 mov ax,2572h mov dx,seg movestepleft ;設(shè)置新的中斷向量 push ds mov ds,dx mov dx,offset movestepleft int 21h pop ds sti ;開中斷 in al,0a1h ;打開irq10 and al,0fbh
27、;11111011 out 0a1h,al in al,21h ;打開irq2 and al,0fbh out 21h,almov status,1;(2)mov stopflag,00h;(3)置暫停位pop dxpop axretup:;(1)把中斷處理程序“向上位移”的中斷程序放入中斷向量表中。;(2)同時將status置為,表示的是以向左的方式刷屏;(3)置暫停位為00h;(4)開始循環(huán)。push axpush dxmov ah,2mov dl,'u'int 21h cli ;關(guān)中斷 mov ax,2572h mov dx,seg movestepup ;設(shè)置新的中斷向
28、量 push ds mov ds,dx mov dx,offset movestepup int 21h pop ds sti ;開中斷 in al,0a1h ;打開irq10 and al,0fbh ;11111011 out 0a1h,al in al,21h ;打開irq2 and al,0fbh out 21h,al ;開中斷mov status,2;(2)mov stopflag,00h;置暫停位pop dxpop axretstop:push axpush dxmov ah,2mov dl,'s'int 21hmov stopflag,01h;置暫停位pop dxp
29、op axret;-led顯示的邏輯部分-;-sendword-sendword:;計算并送出一行16位數(shù)據(jù)。;這個數(shù)據(jù)放在ax中。push axpush bxpush cxpush dxmov cx,16ciclesendword:;測試部分push axpush dxmov dx,8000h;mov dx,0001hand dx,axshr dx,15add dx,30hmov ah,2hint 21hpop dxpop ax;1:通過8255的c4口把一位數(shù)據(jù)給g1push axmov dx,303htest ax,8000h;如果數(shù)據(jù)位是0的話,將c0置1;如果數(shù)據(jù)位是1的話,將c0置
30、0jz setone;將c0置0mov al,00000000bout dx,aljmp goonsetone:;將c0置1mov al,00000001bout dx,algoon:;2:以下代碼是為了實現(xiàn)一個"移位脈沖"mov al,00001100b;使得c6變成0(低電平);同時不改變數(shù)據(jù)輸入位out dx,almov al,00001101b;使得c6變成1(高電平);同時不改變數(shù)據(jù)輸入位out dx,alpop axshl ax,1;shr ax,1dec cxjnz ciclesendwordpop dxpop cxpop bxpop axret;-showl
31、eftward-showleftward:push sipush dxpush cxpush bxpush ax;1:根據(jù)indexofword2;2:movestep決定一個位的位移;3:當stop為0時,每“刷完一次屏',movestep要移動+;否則不移動;4:當movestep=16時,indexofword2+;5:當indexofword2=numofcharacter-1時,indexofword2歸零:因為”索引是從0開始的嘛“。mov si,outsetmov al,32mul indexofwordadd si,axmov cx,16;來一個信號刷一次屏onelin
32、e:;call delay;left代碼的關(guān)鍵:;(1)cx作為一個臨時的“偏移變量使用”;(2)把四個字節(jié)(兩個字)的數(shù)據(jù)拼接在一起,并把最終結(jié)果放在ax中。push cx ;mov ah,simov al,si+1mov cl,movestepshl ax,cl;mov bh,si+32;下一個字的對應行;mov bl,si+33call getnextleftword;-取下一個字對應行的十六位,放在bx中mov cl,16sub cl,movestepshr bx,clor ax,bxpop cxadd si,2;換行;testcall enter;(1)移位輸出了16位數(shù)據(jù)call
33、sendword;2)釋放鎖存,先0后1.采用置位、復位控制字mov al,00001010bmov dx,303h;call delayout dx,almov al,00001011bout dx,al;(3)行選-需要測試選中那一行mov al,cl;shl al,1dec al;?mov dx,302hout dx,aldec cxjnz onelinepop axpop bxpop cxpop dxpop si;jmp exitret;-getnextleftword-getnextleftword:;取下一字的時候,要考慮一種特殊情況,及當si已經(jīng)指向最后一個字的時候,下一個16位
34、,應該取自第一個字push axpush sipush dxmov al,indexofwordinc alcmp al,countjnz getnextleftgetfistleft:mov dx,outsetmov al,32mul indexofwordadd dx,axmov ax,sisub ax,dxmov si,outsetadd si,axmov bh,simov bl,si+1;testpush dxmov dl,' 'mov ah,2hint 21hpopdxmov ax,bxcall sendwordjmp endgetleftwordgetnextlef
35、t:mov bh,si+32;下一個字的對應行mov bl,si+33endgetleftword:pop dxpop sipop axret;-movestepleft-movestepleft:;1:根據(jù)indexofword2以及movestep2確定si。;2:movestep決定一個位的位移;3:當stop為0時,每“刷完一次屏',movestep要移動+;否則不移動;4:當movestep=16時,indexofword2+;5:當indexofword2=count時,indexofword2歸零:因為”索引是從0開始的嘛“。;當刷完一次屏之后,movestep2要變化。
36、;(1)當已經(jīng)按下暫停建的時候,則不前移動;(2)當移動超過=16的時候push axclimov al,01htest stopflag,aljnz endstep;如果等于1,則movesteip不前移動inc movestepmov al,16cmp movestep,aljnz endstep;如果endmovestep!=16跳過4;mov movestep,00hinc indexofwordmov al,countcmp indexofword,aljnz endstep;如果indexofstep2!=count,則跳過5mov indexofword,00hendstep:
37、mov al,62h ;發(fā)中斷結(jié)束命令 mov dx,0a0h out dx,al ;向從片8259發(fā)eoi命令 out 020h,al ;向主片8259發(fā)eoi命令 sti ;開中斷 pop ax iretret;-showupward-;1:用到變量:indexofline;:(1)用來指示當前刷屏從第幾行開始。(2)范圍是0count*16-1。(3)當超過的時候,應該使其等于00(4)用來對si初始化;2:si:;:si動態(tài)變化(顯示十六行數(shù)據(jù)過程中),當超過的count*16-1這個地方所對應的地址的時候,使其“重新指向開頭”。;showupward:push sipush dxpu
38、sh cxpush bxpush axmov si,outsetmov ax,2mul indexofline add si,axmov cx,16;來一個信號刷一次屏anotherline:mov ah,simov al,si+1add si,2;(1)換行;(2)如果換行以后>=range=32*count行對應的指針,令其從新指向開頭,并繼續(xù)+進行行掃push ax;定義一個臨時變量mov ax,0mov al,32mul countmov bx,outsetadd bx,axcmp bx,sijnz continue;如果等于range,則reset;resetmov si,ou
39、tsetcontinue:pop ax;testcall enter;(1)移位輸出了16位數(shù)據(jù)-以ax傳送數(shù)據(jù)call sendword;2)釋放鎖存,先0后1.采用置位、復位控制字mov al,00001010bmov dx,303h;call delayout dx,almov al,00001011bout dx,al;(3)行選-需要測試選中那一行mov al,cl;shl al,1dec al;?mov dx,302hout dx,aldec cx;用于實現(xiàn)16行數(shù)據(jù)的輸出jnz anotherlinepop axpop bxpop cxpop dxpop si;jmp noten
40、dret;-movestepup-movestepup:push ax;testpush dxcliinc timesmov ah,2mov dl,timesadd dl,30hint 21hmov ah,2mov dx,indexoflineadd dl,30hint 21hcmp stopflag,1jz continuemoveupadd indexofline,1;(1)換行;(2)如果換行以后>=range=32*count行對應的指針,令其從新指向開頭,并繼續(xù)+進行行掃mov ax,16mul countcmp ax,indexoflinejnz continuemoveup
41、;resetmov indexofline,00hcontinuemoveup: mov al,62h ;發(fā)中斷結(jié)束命令 mov dx,0a0h out dx,al ;向從片8259發(fā)eoi命令 out 020h,al ;向主片8259發(fā)eoi命令 sti ;開中斷 pop dx pop ax iret;jmp notendret;-輔助函數(shù)-ini8253:;對8253c1和c2進行初始化push dxpush axmov dx,307h;初始化8253,307h為8253控制端口地址mov al,01110110b ;計數(shù)器1,方式3out dx,al;將初始控制字輸出到控制端口mov d
42、x,305h;計數(shù)器1mov ax,900;先讀低8位,out dx,almov al,ah;再讀高8位out dx,almov dx,307h;再給8253寫控制字mov al,10110110b;計數(shù)器2,方式3out dx,almov dx,306h;計數(shù)器2mov ax,900;先讀低8位,out dx,almov al,ah;再讀高8位out dx,alpop axpop dxretini8255:;8255初始化push dxpush ax mov dx,303h;初始化8255 mov al,80h;a口輸出 out dx,al;將初始控制字輸出到控制端口mov dx,300h
43、;a端口的地址mov al,000hout dx,al mov dx,302h;c口地址 ? mov al,000h out dx,alpop axpop dxretexit: mov ax,2572h ;恢復中斷向量 mov dx,int0a_seg push ds mov ds,dx mov dx,int0a_off int 21h pop ds in al,0a1h ;屏蔽irq10 or al,04h out 0a1h,al in al,21h ;屏蔽irq2 or al,04h out 21h,al mov ax,4c00h ;程序退出 int 21h enter: push ax
44、push dxmov ah,2mov dx,0ahint 21hmov ah,2mov dx,0dhint 21hpop dxpop axretdelay proc push cx push bx mov bx,0fffhloop2:mov cx,0fffhloop1:loop loop1 dec bx jnz loop2 pop bx pop cx ret delay endpcode endsend start6.實驗過程中的主要難點(自己遇到的)及解決思路和辦法主要難點:利用proteus畫電路圖時,知道每個芯片怎么連,但是需要多個芯片同時連接時,之間的連線會有些不確定;在試驗箱上連線時,沒能提前好好布局,連線很混亂很難看清楚,尤其在測試芯片有問題需要更改的時候,很難分清楚;不會編寫核心點陣顯示
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 合同范本之樣板房買賣合同5篇
- 重大疾病保險保障體系解析
- 五金銷售及維修承包合同4篇
- 新媒體數(shù)字項目績效評估報告
- 室內(nèi)設(shè)計模型介紹
- 現(xiàn)代簡約軟裝設(shè)計
- 2025西安鐵路工程職工大學輔導員考試試題及答案
- 2025遼寧師范高等??茖W校輔導員考試試題及答案
- 2025益陽師范高等??茖W校輔導員考試試題及答案
- 青海省交通工程監(jiān)理有限公司招聘筆試題庫2025
- 2025屆福州教育學院附屬中學高考語文四模試卷含解析
- 2025年南京市七下期中英語試卷 (試卷版)
- 國有企業(yè)雙重目標導向與雙軌治理機制的研究進展及前景展望
- 2025年山東省煙草專賣局(公司)高校畢業(yè)生招聘(208名)筆試參考題庫附帶答案詳解
- 浙江省寧波市2024學年第二學期高考與選考模擬考試化學試卷及答案(寧波二模)
- 國開電大軟件工程形考作業(yè)3參考答案 (二)
- 棋牌轉(zhuǎn)讓免責協(xié)議書
- 歷城二中生物試卷及答案
- 設(shè)備定制技術(shù)協(xié)議書
- 實習帶教護理教學大賽課件
- 6.2 做核心思想理念的傳承者 課時訓練(含答案)-2024-2025學年下學期 七年級道德與法治
評論
0/150
提交評論