单片机控制的12864LCD液晶显示系统的设计汇编程序.doc_第1页
单片机控制的12864LCD液晶显示系统的设计汇编程序.doc_第2页
单片机控制的12864LCD液晶显示系统的设计汇编程序.doc_第3页
单片机控制的12864LCD液晶显示系统的设计汇编程序.doc_第4页
单片机控制的12864LCD液晶显示系统的设计汇编程序.doc_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

;液晶显示:图形、字符LCD EQU 8E08HWRICODE EQU LCD+0 ;写命令WRDATA EQU LCD+1 ;写数据RDSTAT EQU LCD+2 ;读状态RDDATA EQU LCD+3 ;读数据LCD_X EQU 30HLCD_Y EQU 31HLCD_X1 EQU 32HLCD_Y1 EQU 33HCOUNT EQU 34HCOUNT1 EQU 35HCOUNT2 EQU 36HCOUNT3 EQU 37HLCD_DATA EQU 38HLCD_DATA1 EQU 39HLCD_DATA2 EQU 3AH ORG 0000H AJMP MAIN ORG 0100HMAIN: NOP MOV SP,#5FH;初始化LGS0: MOV A,#30H ;30H-基本指令操作 LCALL SEND_I MOV A,#01H ;清除显示 LCALL SEND_I LCALL DELAY2 LCALL DELAY2 MOV A,#06H ;指定在资料写入或读取时,光标的移动方向 LCALL SEND_I MOV A,#0CH ;开显示,关光标,不闪烁 LCALL SEND_I ;MOV A,#0FH ;开显示,显示光标,闪烁 ;LCALL SEND_ILGS1: MOV DPTR,#TAB1 ;显示汉字和字符 MOV COUNT,#40H MOV A,#80H LCALL SEND_ILGS11: CLR A MOVC A,A+DPTR LCALL SEND_D INC DPTR DJNZ COUNT,LGS11 LCALL DELAY3LGS2: MOV A,#01H LCALL SEND_I LCALL DELAY2 LCALL DELAY2 MOV LCD_DATA1,#0AAH ;显示点阵 MOV LCD_DATA2,#0AAH LCALL LAT_DISP LCALL DELAY3 MOV LCD_DATA1,#55H MOV LCD_DATA2,#55H LCALL LAT_DISP LCALL DELAY3LGS3: MOV A,#34H LCALL SEND_I MOV A,#30H LCALL SEND_I MOV DPTR,#TAB3 ;显示汉字和字符 MOV COUNT,#40H MOV A,#80H LCALL SEND_ILGS31: CLR A MOVC A,A+DPTR LCALL SEND_D INC DPTR DJNZ COUNT,LGS31 LCALL DELAY3LGS4: MOV A,#01H LCALL SEND_I LCALL DELAY2 LCALL DELAY2 MOV LCD_DATA1,#0FFH ;显示点阵 MOV LCD_DATA2,#00H LCALL LAT_DISP LCALL DELAY3 MOV LCD_DATA1,#00H MOV LCD_DATA2,#0FFH LCALL LAT_DISP LCALL DELAY3LGS5: MOV DPTR,#TAB5 ;显示图形 LCALL PHO_DISP sjmp $ LCALL DELAY3 LCALL DELAY3 MOV A,#34H LCALL SEND_I MOV A,#30H LCALL SEND_I LJMP LGS1PHO_DISP: MOV LCD_X,#80H ;全屏显示图形子程序 MOV LCD_Y1,#80H MOV COUNT3,#02HPHO_DISP1: MOV LCD_X1,LCD_X MOV COUNT2,#20HPHO_DISP2: MOV COUNT1,#08HPHO_DISP3: LCALL WR_ZB CLR A MOVC A,A+DPTR LCALL SEND_D INC DPTR CLR A MOVC A,A+DPTR LCALL SEND_D INC DPTR INC LCD_X1 DJNZ COUNT1,PHO_DISP3 MOV LCD_X1,LCD_X INC LCD_Y1 DJNZ COUNT2,PHO_DISP2 MOV LCD_X,#88H MOV LCD_Y1,#80H DJNZ COUNT3,PHO_DISP1 MOV A,#36H LCALL SEND_I MOV A,#30H LCALL SEND_I RETCLRRAM: MOV LCD_DATA1,#00H ;GDRAM写0子程序 MOV LCD_DATA2,#00H LCALL LAT_DISP RETLAT_DISP: MOV LCD_X,#80H ;显示点阵子程序 MOV LCD_Y1,#80H MOV COUNT3,#02HLAT_DISP1: CLR F0 MOV LCD_X1,LCD_X MOV COUNT2,#20HLAT_DISP2: MOV COUNT1,#08HLAT_DISP3: JB F0,LAT_DISP32 MOV LCD_DATA,LCD_DATA1 AJMP LAT_DISP31LAT_DISP32: MOV LCD_DATA,LCD_DATA2LAT_DISP31: LCALL WR_ZB MOV A,LCD_DATA LCALL SEND_D MOV A,LCD_DATA LCALL SEND_D INC LCD_X1 DJNZ COUNT1,LAT_DISP3 MOV LCD_X1,LCD_X INC LCD_Y1 CPL F0 DJNZ COUNT2,LAT_DISP2 MOV LCD_X,#88H MOV LCD_Y1,#80H DJNZ COUNT3,LAT_DISP1 MOV A,#36H LCALL SEND_I MOV A,#30H LCALL SEND_I RETWR_ZB: MOV A,#34H LCALL SEND_I MOV A,LCD_Y1 LCALL SEND_I MOV A,LCD_X1 LCALL SEND_I MOV A,#30H LCALL SEND_I RETSEND_D: PUSH DPL ;写数据子程序 PUSH DPH LCALL CHKBUSY LCALL DELAY1 MOV DPTR,#WRDATA MOVX DPTR,A POP DPH POP DPL RETSEND_I: PUSH DPL ;写指令子程序 PUSH DPH LCALL CHKBUSY LCALL DELAY1 MOV DPTR,#WRICODE MOVX DPTR,A POP DPH POP DPL RETCHKBUSY:PUSH ACC ;测忙碌子程序CHKING: CLR A MOV DPTR,#RDSTAT MOVX A,DPTR JB ACC.7,CHKING POP ACC RETDELAY3: MOV R5,#16HDEL31: MOV R6,#0FFHDEL32: MOV R7,#0FFHDEL33: DJNZ R7,DEL33 DJNZ R6,DEL32 DJNZ R5,DEL31 RETDELAY2: MOV R6,#0CHDEL21: MOV R7,#18HDEL22: DJNZ R7,DEL22 DJNZ R6,DEL21 RETDELAY1: MOV R6,#06HDEL11: MOV R7,#08HDEL12: DJNZ R7,DEL12 DJNZ R6,DEL11 RETTAB1: DB 达爱思计算机公司 DB Dais Computer Co DB 液晶显示器128*64 DB Tel:051085806468TAB3: DB LCD 内置二级字库 DB !#$%&*()_+| DB 使用更方便更灵活 DB TAB5: DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,001H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,001H,080H,000H,000H,000H,002H,010H,001H,0E1H,0FEH,012H,080H,090H,000H DB 000H,000H,001H,080H,000H,000H,000H,001H,010H,03EH,041H,022H,03EH,080H,088H,000H DB 000H,000H,001H,0C0H,000H,000H,000H,001H,010H,00AH,081H,022H,014H,0F1H,04AH,000H DB 000H,000H,007H,0C0H,000H,000H,000H,000H,0FFH,07FH,0F1H,0FEH,07EH,0A1H,042H,000H DB 000H,000H,01CH,080H,000H,000H,000H,006H,010H,044H,011H,022H,009H,0A3H,044H,000H DB 000H,000H,078H,0A0H,03CH,000H,000H,002H,010H,03FH,0E1H,0FEH,07CH,0A5H,024H,000H DB 000H,001H,0E3H,030H,042H,000H,000H,002H,028H,004H,000H,000H,024H,0A1H,028H,000H DB 000H,003H,08EH,0F0H,0B9H,000H,000H,002H,046H,007H,0C2H,0A2H,04EH,041H,010H,000H DB 000H,00EH,019H,0A1H,024H,080H,000H,002H,082H,00CH,082H,095H,038H,041H,018H,000H DB 000H,018H,067H,061H,024H,080H,000H,005H,000H,013H,004H,085H,008H,0A1H,024H,000H DB 000H,038H,0DCH,0C1H,038H,080H,000H,004H,0FFH,06CH,0F0H,0FCH,03BH,011H,0C3H,000H DB 000H,033H,0B1H,081H,024H,080H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,033H,0BFH,0E0H,0A5H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,019H,0C0H,000H,042H,000H,000H,000H,0FFH,0C0H,000H,000H,01FH,000H,000H,000H DB 000H,01DH,0FFH,0F8H,03CH,000H,000H,001H,0FFH,0F0H,000H,000H,03EH,000H,000H,000H DB 000H,00FH,0FFH,0EEH,000H,000H,000H,001H,0FFH,0F8H,000H,000H,03EH,000H,000H,000H DB 000H,00FH,060H,0E7H,000H,000H,000H,001H,0FFH,0F8H,000H,000H,000H,000H,000H,000H DB 000H,01CH,060H,073H,000H,000H,000H,001H,0F0H,0FCH,01FH,0F0H,03EH,00FH,0E0H,000H DB 000H,01CH,0E4H,03BH,080H,000H,000H,001H,0F0H,07CH,07FH,0F8H,07EH,03FH,0F0H,000H DB 000H,01CH,0CDH,03BH,080H,000H,000H,003H,0E0H,07CH,0FFH,0FCH,07CH,03FH,0F8H,000H DB 000H,01CH,0CFH,03BH,080H,000H,000H,003H,0E0H,07CH,0F8H,07CH,07CH,078H,0F8H,000H DB 000H,01CH,0CDH,03BH,000H,000H,000H,003H,0E0H,07CH,000H,07CH,07CH,078H,000H,000H DB 000H,01DH,0CDH,033H,000H,000H,000H,003H,0E0H,0FCH,007H,0FCH,07CH,07FH,080H,000H DB 000H,039H,080H,066H,000H,000H,000H,007H,0E0H,0FCH,07FH,0FCH,0F8H,03FH,0E0H,000H DB 000H,039H,080H,000H,000H,000H,000H,007H,0C1H,0F8H,0FCH,07CH,0F8H,007H,0F0H,000H DB 000H,03BH,0F3H,0FFH,000H,000H,000H,007H,0C3H,0F9H,0F0H,0F8H,0F8H,000H,0F0H,000H DB 000H,03BH,0E7H,0FEH,000H,000H,000H,007H,0FFH,0F1H,0F1H,0F8H,0F9H,0F0H,0F0H,000H DB 000H,078H,000H,000H,000H,000H,000H,007H,0FFH,0E1H,0FFH,0F8H,0F9H,0FFH,0E0H,000H DB 000H,07FH,0EFH,0FEH,000H,000H,000H,00FH,0FFH,0C0H,0FFH,0F9H,0F0H,0FFH,0C0H,000H DB 000H,07FH,0EFH,0FCH,000H,000H,000H,00FH,0FFH,000H,07EH,079H,0F0H,07FH,080H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 001H,010H,022H,002H,008H,021H,000H,050H,010H,023H,0F8H,008H,040H,080H,000H,000H DB 000H,0A0H,022H,002H,07CH,021H,000H,048H,028H,022H,008H,07FH,080H,040H,000H,000H DB 003H,0FCH,022H,00FH,0C8H,0F7H,0E0H,040H,025H,023H,0F8H,009H,00FH,0F8H,000H,000H DB 002H,044H,03FH,0E2H,048H,021H,00FH,0FEH,041H,022H,002H,00AH,040H,010H,000H,000H DB 003H,0FCH,020H,002H,048H,021H,000H,040H,0F9H,022H,002H,0FFH,0E0H,020H,000H,040H DB 002H,044H,020H,007H,048H,037H,0C0H,0E0H,049H,021H,0FCH,008H,000H,040H,0FFH,0E0H DB 003H,0FCH,03FH,006H,0C8H,0E4H,041H,050H,049H,020H,010H,01FH,080H,080H,000H,000H DB 000H,040H,021H,00AH,048H,022H,082H,048H,059H,02FH,0FEH,030H,081H,000H,000H,000H DB 00FH,0FEH,021H,00AH,04AH,021H,00CH,046H,042H,021H,010H,0DFH,082H,000H,000H,000H DB 000H,040H,041H,002H,08AH,022H,080H,040H,042H,020H,090H,010H,08DH,000H,000H,000H DB 000H,040H,081H,003H,00EH,0ECH,060H,040H,07EH,0E0H,070H,01FH,080H,0FEH,000H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,000H,000H,020H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H DB 000H,003H,0E0H,020H,00EH,07CH,043H,080H,0E7H,0CEH,038H,060H,086H,038H,000H,000H DB 000H,000H,080H,020H,011H,040H,0C4H,041H,014H,011H,044H,081H

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论