資源描述:
《12232液晶屏驅(qū)動源程序》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、12232液晶屏驅(qū)動源程序;;;;;;(匯編)此程序左右顯示一樣能不能該成左右顯示不一樣連線圖:DB0-—P1.0**DB4…Pl.4**A0p3.7**E1—-p3.0DB1—Pl.1**DB5…Pl.5**WRGND*E2…p3.1DB2—Pl.2**DB6…Pl.6*DB3—-P1.3**DB7—Pl.7**RSTp3.2ElEQUP3.0E2equp3?lAOEQUP3.7RSTEQUP3.2xequ30h;頁地址yequ31h;列地址;RW=>GNDORG0000HLJMPMAINORG0003HORGOIOOHMAIN:NOPclreaCLRE1C
2、LRE2lcallinit;初始化模塊;MOV34H,#0ffH;顯示所有點;LCALLDISPLAY_ALL;lcalldlylOO;MOV34H,#00H;所有點不顯示;LCALLDISPLAY_ALL;MOVRl,#0e3H;reset;LCALLWRI;lcallplybw;顯示黑白相間塊;lcallDLY100MOV34H,#00H;清顯示MOVRl,#0e3H;resetLCALLWRImov31h,#0mov30h,#0MOV30H,#2;xMOV31H,#0;yMOVDPTR,#HZI7;您LCALLouthzMOV30H,#2MOV31H,#
3、30MOVDPTR,#HZI8;好LCALLouthzMOV30H,#0MOV31H,#25MOVDPTR,#HZI8;好LCALLouthzLJMPMAINLINTO:NOPNOPRETIinit:CLRRST;RESETLCALLDLY50LCALLDLY50LCALLDLY50LCALLDLY50setbrstMOVRl,#0aFH;DISPLAYONLCALLWRIMOVRl9#0C0H;START二0LCALLWRIMOVRl,#0a4H;driverLCALLWRIMOVRl,#0a9h;duty32LCALLWRImovR1,#Oafh;disp
4、layonlcallWRImovR1,#OeehlcallWRIMOVRl9#0a0H;adcLCALLWRIMOVRl,#0e3H;resetLCALLWRIMOV34H,#00HLCALLDISPLAY_ALLretDISPLAY_ALL:MOVRl,#0e3H;resetLCALLWRIMOVR7,#4;DISPLAYDATA=34HMOVR2,#0B8HLOP1:MOVA,R2MOVR1,A;X+1LCALLWRIMOVR5,#61MOVRl9#0e0H;RMWLCALLWRILOP11:MOVR1,34HLCALLWRDDJNZR5,LOP11MOV
5、Rl9#0eeH;endLCALLWRIINCR2DJNZR7,LOP1retouthz:MOVRl,#0e3H;resetLCALLWRI;30h=x(0-6)31h=y(0-63-16)MOVR7,#2MOVA,#0B8HADDA,30H;B8+XMOV30H,A;A>>30HHZ2:;MOVA,R2MOVR1,30H;X+1LCALLWRIMOVA,#00H;YADDA,31H;MOV31H,A;40+YMOVR1,ALCALLWRIMOVR5,#16MOVRl,#OeOHRMWLCALLWRIHZ1:MOVA,#00HMOVCA,@A+DPTRMOVR
6、1,ALCALLWRDLCALLDLY10INCDPTRDJNZR5,HZ1INC30HDJNZR7,HZ2RETplybw:MOVRl,#0e3H;resetLCALLWRImov30h,#0mov31h,#0movdptr,#bwMOVR7,#4MOVA,#0B8HADDA,30H;B8+XMOV30H,A;A>>30HHZ2bw:MOVRl,30H;X+lLCALLWRIMOVA,#00H;YADDA,31H;40+YMOVR5,#61MOVRl,#0e0H;RMWLCALLWRIHZlbw:MOVA,#00HMOVCA,@A+DPTRMOVR1,ALC
7、ALLWRDLCALLDLY10INCDPTRDJNZR5,HZlbwMOVRl9#0eeH;endLCALLWRIINC30HDJNZR7,HZ2bwRETWRI:;寫指令子程序CLRE1CLRE2CLRAOMOVP1,R1LCALLDLY10SETBElsetbE2LCALLDLY10CLRElCLRE2LCALLDLY10LCALLDLY10LCALLDLY10RETWRD:;寫數(shù)據(jù)子程序CLRElCLRE2SETBAOMOVP1,R1LCALLDLY10SETBElsetbE2CLRElCLRE2LCALLDLY10RETDLY10:MOVR3,#01
8、HDL1:MOVR4,#05HDL2: