欢迎来到天天文库
浏览记录
ID:42385199
大小:263.47 KB
页数:10页
时间:2019-09-14
《12864串口驱动程序(郭天祥)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、**标题:PIC-ST2学习板演示程序-12864LCD-1*文件名:LCD12864-1*建立日期:2010.01.28*修改日期:2010.05.15*版本:V1.0*作者:simomli•丄■•丄■•土•丄■•丄■•土•丄■•丄“•卜•丄■•卜•丄“•丄■•卜■卜•丄■•丄■•卜•丄■•丄■•卜•丄■•卜•丄■•丄■•丄■•£>•丄■•丄■•丄■•£>・丄・・丄・・丄・・丄・・丄・・丄・-士・丄・^7^^7^#T%^7^#T>^7^#T%^7^#T>
2、#T%#T%#T%#T%#T%吓・#T%吓・#T%吓・#T%吓・#T%吓・#T%吓・^7^吓・^7^*■^7^彳.#7^彳・*功能描述:LCD12864C液晶串口方式显示字符,只用到三根数据线^1*•丄■•丄■•土•丄■•土•丄■•丄■•土•丄■•丄“•卜•丄■•丄“•卜•丄■•卜•丄■•丄■•卜•丄■•丄■•丄■•卜•丄■•£>•丄■•£*•丄彳•丄■%£*•丄■•丄■•£>%1«•£*•£*・丄・•丄■•丄■•丄■•丄■•丄■•土•丄■^7^^7^#T%^7^#T>^7^#T%^7^#T>3、7w#T%#T%#T%#T%#T%吓・#T%吓・#T%吓・#T%吓・#T%吓・#T%吓・^7^吓・^7^*■^7^彳.#7^彳・**【版权】Copyright(C)2009-2019AllRightsReserved*【声明】此程序仅用于学习与参考,引用请注明版权和作者信息!*******************************************************************************///#include4、x.h>#include#include#defineuint8unsignedchar〃读忙指令〃读数据指令〃写命令指令〃写数据指令#defineuint!6unsignedint#definereadbusyOxFC#definereaddataOxFE#definewritecom0xF8#definewritedataOxFACONFIG(WDTDIS&LVPDIS&HS&PWRTDIS&BORDIS);//设置配置位/AVDTDIS:disablewatchdog5、timer//LVPDIS:lowvoltageprogrammingdisabled//HS:highspeedcrystal/resonator//PWRTDIS:disablepoweruptimer//BORDIS:disablebrownoutreset#defineCSRE0〃使能线#defineSIDRE1〃数据线#defineSCLKRE2〃时钟线voidDelayUS(uint8delay);〃微妙延时voidDelayMS(uintl6delay);〃毫秒延时voidRead_LC6、D_Busy(void);〃查忙voidWrite_LCD_Comd(uint8commond);voidWrite_LCD_Data(uint8Data);voidInit_12864LCD(void);//LCD写指令//LCD写数据//12864LCD初始化constuint8tab[]={M欢迎光临”宇理电子””求是创新“Mninglielectronic"”Microchip学习板““12864LCD演示程序“"taobao:simomli"”竭诚为你服务“};•IvoidWrite_LCD7、_Line(uint8addr,uint8index);〃写行uint8Read_LCD_Data(void);*函数名:DelayUS(uint8delay)*函数功能:微秒延时for20MHZ*入口参数:delay*返冋:无*******************************************************************************voidDelayUS(uint8delay){while(—delay);**函数名:DelayMS(uintl6de8、lay)*函数功能:毫秒延时for20MHZ*入口参数:delay*返回:无kL#rjw.卜rjw•卜■卜*{w•卜rj・■卜rp■卜rj*■卜■卜rp■卜rj^■卜rp齐、rp吃、rj^rjwrp齐、rj*吃、rj%•卜吃、•卜吃、•卜吃、•卜吃、•卜吃、•卜rj*rj*rj*rj*rj*rj^■評rj^■評rj^♦評rj*voidDelayMS(uintl6delay)uintl6i;for(;delay>0;delay-)for(i=0;i<453
3、7w#T%#T%#T%#T%#T%吓・#T%吓・#T%吓・#T%吓・#T%吓・#T%吓・^7^吓・^7^*■^7^彳.#7^彳・**【版权】Copyright(C)2009-2019AllRightsReserved*【声明】此程序仅用于学习与参考,引用请注明版权和作者信息!*******************************************************************************///#include4、x.h>#include#include#defineuint8unsignedchar〃读忙指令〃读数据指令〃写命令指令〃写数据指令#defineuint!6unsignedint#definereadbusyOxFC#definereaddataOxFE#definewritecom0xF8#definewritedataOxFACONFIG(WDTDIS&LVPDIS&HS&PWRTDIS&BORDIS);//设置配置位/AVDTDIS:disablewatchdog5、timer//LVPDIS:lowvoltageprogrammingdisabled//HS:highspeedcrystal/resonator//PWRTDIS:disablepoweruptimer//BORDIS:disablebrownoutreset#defineCSRE0〃使能线#defineSIDRE1〃数据线#defineSCLKRE2〃时钟线voidDelayUS(uint8delay);〃微妙延时voidDelayMS(uintl6delay);〃毫秒延时voidRead_LC6、D_Busy(void);〃查忙voidWrite_LCD_Comd(uint8commond);voidWrite_LCD_Data(uint8Data);voidInit_12864LCD(void);//LCD写指令//LCD写数据//12864LCD初始化constuint8tab[]={M欢迎光临”宇理电子””求是创新“Mninglielectronic"”Microchip学习板““12864LCD演示程序“"taobao:simomli"”竭诚为你服务“};•IvoidWrite_LCD7、_Line(uint8addr,uint8index);〃写行uint8Read_LCD_Data(void);*函数名:DelayUS(uint8delay)*函数功能:微秒延时for20MHZ*入口参数:delay*返冋:无*******************************************************************************voidDelayUS(uint8delay){while(—delay);**函数名:DelayMS(uintl6de8、lay)*函数功能:毫秒延时for20MHZ*入口参数:delay*返回:无kL#rjw.卜rjw•卜■卜*{w•卜rj・■卜rp■卜rj*■卜■卜rp■卜rj^■卜rp齐、rp吃、rj^rjwrp齐、rj*吃、rj%•卜吃、•卜吃、•卜吃、•卜吃、•卜吃、•卜rj*rj*rj*rj*rj*rj^■評rj^■評rj^♦評rj*voidDelayMS(uintl6delay)uintl6i;for(;delay>0;delay-)for(i=0;i<453
4、x.h>#include#include#defineuint8unsignedchar〃读忙指令〃读数据指令〃写命令指令〃写数据指令#defineuint!6unsignedint#definereadbusyOxFC#definereaddataOxFE#definewritecom0xF8#definewritedataOxFACONFIG(WDTDIS&LVPDIS&HS&PWRTDIS&BORDIS);//设置配置位/AVDTDIS:disablewatchdog
5、timer//LVPDIS:lowvoltageprogrammingdisabled//HS:highspeedcrystal/resonator//PWRTDIS:disablepoweruptimer//BORDIS:disablebrownoutreset#defineCSRE0〃使能线#defineSIDRE1〃数据线#defineSCLKRE2〃时钟线voidDelayUS(uint8delay);〃微妙延时voidDelayMS(uintl6delay);〃毫秒延时voidRead_LC
6、D_Busy(void);〃查忙voidWrite_LCD_Comd(uint8commond);voidWrite_LCD_Data(uint8Data);voidInit_12864LCD(void);//LCD写指令//LCD写数据//12864LCD初始化constuint8tab[]={M欢迎光临”宇理电子””求是创新“Mninglielectronic"”Microchip学习板““12864LCD演示程序“"taobao:simomli"”竭诚为你服务“};•IvoidWrite_LCD
7、_Line(uint8addr,uint8index);〃写行uint8Read_LCD_Data(void);*函数名:DelayUS(uint8delay)*函数功能:微秒延时for20MHZ*入口参数:delay*返冋:无*******************************************************************************voidDelayUS(uint8delay){while(—delay);**函数名:DelayMS(uintl6de
8、lay)*函数功能:毫秒延时for20MHZ*入口参数:delay*返回:无kL#rjw.卜rjw•卜■卜*{w•卜rj・■卜rp■卜rj*■卜■卜rp■卜rj^■卜rp齐、rp吃、rj^rjwrp齐、rj*吃、rj%•卜吃、•卜吃、•卜吃、•卜吃、•卜吃、•卜rj*rj*rj*rj*rj*rj^■評rj^■評rj^♦評rj*voidDelayMS(uintl6delay)uintl6i;for(;delay>0;delay-)for(i=0;i<453
此文档下载收益归作者所有