资源描述:
《12864液晶屏与单片机连接图》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Protel制图Protues原理图程序部分:#include#defineucharunsignedchar#defineuintunsignedint//sbitdatabus=P1;#definedatabusP1//sbitReset=P3^0;//复位sbitrs=P3^7;//指令数据选择sbite=P3^5;//指令数据控制sbitcs1=P3^3;//左屏幕选择,低电平有效sbitcs2=P3^4;//右屏幕选择sbitwr=P3^6;//读写控制//sbitbusy=P1^7;//忙标志voidSendCommand(ucharcommand);/
2、/写指令voidWriteData(uchardat);//写数据voidLcdDelay(uinttime);//延时voidSetOnOff(ucharonoff);//开关显示voidClearScreen(ucharscreen);//清屏voidSetLine(ucharline);//置页地址voidSetColum(ucharcolum);//置列地址voidSetStartLine(ucharstartline);//置显示起始行voidSelectScreen(ucharscreen);//选择屏幕voidShow1616(ucharlin,ucharcolum,u
3、char*address);//显示一个汉字voidInitLcd();//初始化voidResetLcd();//复位voidShow_english(ucharlin,ucharcolum,uchar*address);constucharcodehzk[]={/*--文字:I--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,/*--文字:--*//*--宋体12;此字体下对应的点阵为:宽x高=8x1
4、6--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:c--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,/*--文字:a--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x
5、00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,/*--文字:n--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,/*--文字:--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:m--
6、*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,/*--文字:a--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,/*--文字:k--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x08,0xF8,0x0
7、0,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,/*--文字:e--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,/*--文字:--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16