资源描述:
《《lcd液晶屏》word版》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、08.08.02TEST128x64汉字显示OKIO_ADDRESSequ288hDATASEGMENTHZ_TABDW0A3B3H,0A3B2H,0CEBBH,0CEA2H,0BBFAH,0BDCCH,0D1A7H,0CAB5HDW0D1E9H,0CFB5H,0CDB3H,0D5FDH,0D4DAH,0D1DDH,0CABEH,0D6D0HHZ_ADRDB?;存放显示行起始端口地址DATAENDScodesegmentassumecs:code,ds:dataSTART:MOVAX,DATAMOVDS,AXMOVDX,IO_ADDRESSADDDX,3MOVAL,8
2、0HOUTDX,AL;8255初始化moval,0ffhmovdx,300Houtdx,alCALLCLEAR;LCD清除;CALLFUNCUP;LCD功能设置LEABX,HZ_TABMOVCH,2;显示第2行信息CALLLCD_DISPLEABX,HZ_TABMOVCH,3;显示第3行信息CALLLCD_DISPl1:jmpstart;l1CLEARPROCMOVAL,0CHMOVDX,IO_ADDRESSOUTDX,AL;设置CLEAR命令CALLCMD_SETUP;启动LCD执行命令RETCLEARENDPFUNCUPPROC;MOVAL,0fH;LCD功能设置
3、命令;OUTDX,AL;CALLCMD_SETUPMOVAL,34H;LCD显示状态命令OUTDX,ALCALLCMD_SETUPRETFUNCUPENDPLCD_DISPPROCLEABX,HZ_TABCMPCH,2JZDISP_SECMOVBYTEPTRHZ_ADR,88H;第三行起始端口地址ADDBX,16;指向第二行信息JMPnextDISP_SEC:MOVBYTEPTRHZ_ADR,90Hnext:movcl,8continue:pushcxMOVAL,HZ_ADRMOVDX,IO_ADDRESSOUTDX,ALCALLCMD_SETUP;设定DDRAM地址
4、命令MOVAX,[BX]PUSHAXMOVAL,AH;先送汉字编码高位MOVDX,IO_ADDRESSOUTDX,ALCALLDATA_SETUP;输出汉字编码高字节CALLDELAY;延迟POPAXMOVDX,IO_ADDRESSOUTDX,ALCALLDATA_SETUP;输出汉字编码低字节CALLDELAYINCBXINCBX;修改显示内码缓冲区指针INCBYTEPTRHZ_ADR;修改LCD显示端口地址POPCXDECCLJNZCONTINUERETLCD_DISPENDPCMD_SETUPPROCMOVDX,IO_ADDRESS;指向8255端口控制端口AD
5、DDX,2NOPMOVAL,00000000B;PC1置0,pc0置0(LCDI端=0,W端=0)OUTDX,ALcalldelayNOPMOVAL,00000100B;PC2置1(LCDE端=1)OUTDX,ALNOPcalldelayMOVAL,00000000B;PC2置0,(LCDE端置0)OUTDX,ALcalldelayRETCMD_SETUPENDPDATA_SETUPPROCMOVDX,IO_ADDRESS;指向8255控制端口ADDDX,2MOVAL,00000001B;PC1置0,PC0=1(LCDI端=1)OUTDX,ALNOPcalldelay
6、MOVAL,00000101B;PC2置1(LCDE端=1)OUTDX,ALNOPcalldelayMOVAL,00000001B;PC2置0,(LCDE端=0)OUTDX,ALNOPcalldelayRETDATA_SETUPENDPDELAYPROCpushcxpushdxMOVCX,0fffhx1:loopx1popdxpopcxRETDELAYENDPcodeendsendstart/************************//*LCD汉字显示*//************************/#include#include7、onio.h>#include"ApiExusb.h"#pragmacomment(lib,"ApiExusb.lib")charlcd2[16]={0xa3,0xb3,0xa3,0xb2,0xce,0xbb,0xce,0xa2,0xbb,0xfa,0xbd,0xcc,0xd1,0xa7,0xca,0xb5};charlcd3[16]={0xd1,0xe9,0xcf,0xb5,0xcd,0xb3,0xd5,0xfd,0xd4,0xda,0xd1,0xdd,0xca,0xbe,0xd6,0xd0};voidclear();voidcmdsetup();