4位總線液晶模塊驅動程序初始化程序_第1頁
4位總線液晶模塊驅動程序初始化程序_第2頁
4位總線液晶模塊驅動程序初始化程序_第3頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

AVR單片機用I/O口4位總線的字符型液晶顯示模塊的部分驅動程序及初始化程序pr1:;寫入指令代碼子程cbiportd,3;RS=0sbiportd,4;R/W=1pr11:cbiddrb,7;置B口高四位三態(tài)輸入cbiportb,7cbiddrb,6cbiportb,6cbiddrb,5cbiportb,5cbiddrb,4cbiportb,4sbiportd,5;E=1cbiportd,5;E=0intemp,pinb;讀B口高四位bsttemp,7;T=BFsbiportd,5;E=1cbiportd,5;E=0brtspr11;T=1跳轉到pr11cbiportd,4;R/W=0sbiddrb,7;置B口為輸出sbiddrb,6sbiddrb,5sbiddrb,4rcallwrit;寫指令高四位swapwdc;寫指令低四位rcallwritretpr2:;寫入顯示數(shù)據(jù)子程cbiportd,3;RS=0sbiportd,4;R/W=1pr21:cbiddrb,7;置B口高四位三態(tài)輸入cbiportb,7cbiddrb,6cbiportb,6cbiddrb,5cbiportb,5cbiddrb,4cbiportb,4sbiportd,5;E=1cbiportd,5;E=0intemp,pinb;讀B口高四位bsttemp,7;T=BFsbiportd,5;E=1cbiportd,5;E=0brtspr21;T=1跳轉到pr21sbiportd,3;RS=1*******cbiportd,4;R/W=0sbiddrb,7;置B口為輸出1sbiddrb,6sbiddrb,5sbiddrb,4rcallwrit;寫指令高四位swapwdc;寫指令低四位rcallwritretwrit:;對LCD寫四位指令代碼或顯示數(shù)據(jù)子程cbiportb,7;清portb7,6,5,4cbiportb,6cbiportb,5cbiportb,4sbrcwdc,7;把com7,6,5,4傳遞到portb,7,6,5,4sbiportb,7sbrcwdc,6sbiportb,6sbrcwdc,5sbiportb,5sbrcwdc,4sbiportb,4sbiportd,5;E降落沿寫入LCDcbiportd,5retint:;初始化子程lditemp,$ff;設置B口輸出outddrb,tempoutportb,tempcbiportb,7;工作方式設置指令代碼$30cbiportb,6sbiportb,5sbiportb,4cbiportd,3;RS=0cbiportd,4;R/W=0ldir19,3;3次循環(huán),要寫入3次iint1:sbiportd,5;E=1cbiportd,5;E=0,E降落沿寫入指令代碼rcalldelaydecr19brneiint1cbiportb,4;設置工作方式指令代碼$20,(地點增量,畫面不動)sbiportd,5;E降落沿寫入指令代碼cbiportd,5ldiwdc,$28;工作方式設置為4位接口,兩行顯示rcallpr1ldiwdc,$01;設置請屏rcallpr1rcalldelayldiwdc,$06;設置為數(shù)據(jù)讀寫后rcallpr1ldiwdc,$0d;設置顯示方式rcallpr12retdelt:pushtemp;延時子程lditemp,$ffdet1:dectempbrnedet1poptempretdelay:pushtemp;延時子程lditemp,$80mm1:pushtempmm2:pushtempmm3:dectempbrnemm3poptempdectempbrnemm2poptempdectempbrnemm1poptempretcg_write:;寫自定義字符庫子程ldiwdc,$40;設置CGRAM開端地點rcallpr1ldir19,64;寫入64字節(jié)(8個自定義字符)ldir22,0;從第0個字節(jié)挨次查表寫入cg1:ld

溫馨提示

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

評論

0/150

提交評論