欢迎来到天天文库
浏览记录
ID:43050249
大小:157.29 KB
页数:16页
时间:2019-09-24
《5-LCD1602液晶驱动程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、5-LCD1602液晶驱动程序kIzx£^six>1^^lxsl^>lxkIzX7XZTSXTX^TxXTSz?sz
2、s^Tx^Txxfs^TsZ7SzTs^Txx
3、s^7xzlsZTXZT^z?szTs^TxXTSX7XzlsXTXZT^^Tszls>lz>lz>lz>lx>lx>lxXT^XTXXTS^TXXT^X
4、s✓JxXT^#7S^
5、SXlXXjX^J>XTSX
6、X^TXXjX//LCD1602drivermoduleprogram,whichcanbedisplayednormally,
7、STC89C52singlechip,11.0592MHZvibrationfrequency//itsdefinitionisasfollows://sbitRS=P20;//registerselection,whichdefinestheRSbitasP2・0pins//sbitRW=P21;//readandwriteselectbits,whichdefinetheRWbitasP2.1//sbitE二P2八2;//enablethesignalbitanddefineEbitasP2.2
8、//sbitBF=P07;//busymarker,whichdefinestheBFbitasP0.7wlz>lzxjs✓TxXT^XTXxjsXjs9、xXTXXJXXTSX10、Sx11、xXTXXJXx12、sxjxs^K^s^^>✓Tx^x^>^x^x^>^>^ix#include//containingtheheaderfileofthesingle-chipregister#include//containstheheaderfiledefinedb13、ythe_nop_()function#defineucharunsignedchar#defineuintunsignedintSbitRS二P2八0;//registerselection,whichdefinestheRSbitasP2.0pinsSbitRW二P2八1;//readandwriteselectbits,whichdefinetheRWbitasP2.1SbitE二P2八2;//enablethesignalbitanddefineEbitasP2.2SbitBF=P07;//14、busymarker,whichdefinestheBFbitasP0.7Unsignedcharcodestring[]二{〃1602让-codeTEST〃};Unsignedcharcodestringl[]二{〃testBEHAPPY〃};"二二二LCD1602functiondefinitionssection==========>1^sl^>1^>1^#T^#Tx#TxFunction:delayIms*>£^>1^>1^>1^>1^>1^#Tx#Tx#Tx✓Jx#Tx#T^#T^Void15、delay1ms(void)UnsignedcharI,J;For(I=0;I<10;I+)For(j0;j<33;j+)sl^slz#rsr^^Tx>r^^7%>r^^Tx#rxi>k{>k{>k{xv]>k{>#T^#TxFunction:adelayofseveralmillisecondsEntranceparameters:n*^X^^lz>1^/^7^/Voiddelay(unsignedcharn){UnsignedcharI;For(I=0;I16、lay1ms();}/>lz>1^>£^>1^>1^>1^>1^>1^>1^>1^>£^>lz>1^>1^%£^>lz>1^>1^^7%^T>#T^#T^#Tx#Tx#r^#T^#Tx#T^#7%#T^k{>k{xv]>k{>#T^#TxFunction:todeterminethebusystateoftheliquidcrystalmoduleThereturnvalue:theresult・Result二1,busy;Result二0,notbusy<17、r^r^>r^>T^>T^^r<#r^>Tx^7%r^>Tx^r
9、xXTXXJXXTSX
10、Sx
11、xXTXXJXx
12、sxjxs^K^s^^>✓Tx^x^>^x^x^>^>^ix#include//containingtheheaderfileofthesingle-chipregister#include//containstheheaderfiledefinedb
13、ythe_nop_()function#defineucharunsignedchar#defineuintunsignedintSbitRS二P2八0;//registerselection,whichdefinestheRSbitasP2.0pinsSbitRW二P2八1;//readandwriteselectbits,whichdefinetheRWbitasP2.1SbitE二P2八2;//enablethesignalbitanddefineEbitasP2.2SbitBF=P07;//
14、busymarker,whichdefinestheBFbitasP0.7Unsignedcharcodestring[]二{〃1602让-codeTEST〃};Unsignedcharcodestringl[]二{〃testBEHAPPY〃};"二二二LCD1602functiondefinitionssection==========>1^sl^>1^>1^#T^#Tx#TxFunction:delayIms*>£^>1^>1^>1^>1^>1^#Tx#Tx#Tx✓Jx#Tx#T^#T^Void
15、delay1ms(void)UnsignedcharI,J;For(I=0;I<10;I+)For(j0;j<33;j+)sl^slz#rsr^^Tx>r^^7%>r^^Tx#rxi>k{>k{>k{xv]>k{>#T^#TxFunction:adelayofseveralmillisecondsEntranceparameters:n*^X^^lz>1^/^7^/Voiddelay(unsignedcharn){UnsignedcharI;For(I=0;I16、lay1ms();}/>lz>1^>£^>1^>1^>1^>1^>1^>1^>1^>£^>lz>1^>1^%£^>lz>1^>1^^7%^T>#T^#T^#Tx#Tx#r^#T^#Tx#T^#7%#T^k{>k{xv]>k{>#T^#TxFunction:todeterminethebusystateoftheliquidcrystalmoduleThereturnvalue:theresult・Result二1,busy;Result二0,notbusy<17、r^r^>r^>T^>T^^r<#r^>Tx^7%r^>Tx^r
16、lay1ms();}/>lz>1^>£^>1^>1^>1^>1^>1^>1^>1^>£^>lz>1^>1^%£^>lz>1^>1^^7%^T>#T^#T^#Tx#Tx#r^#T^#Tx#T^#7%#T^k{>k{xv]>k{>#T^#TxFunction:todeterminethebusystateoftheliquidcrystalmoduleThereturnvalue:theresult・Result二1,busy;Result二0,notbusy<
17、r^r^>r^>T^>T^^r<#r^>Tx^7%r^>Tx^r
此文档下载收益归作者所有