毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

常用液晶显示模块驱动程序设计 第14页

更新时间:2009-6-13:  来源:毕业论文
常用液晶显示模块驱动程序设计 第14页
CS2=csr;
lcd_busy();  
RS=1;   
RW=0;    
P2=c;
EN=0;
delay(10);                        
EN=1;
delay(10);      
EN=0;      
}       
/*-----根据列和页地址定位,将数据写入LCM左或右半区子程序------*/
void lw(uchar x, uchar y, uchar dd)
{      
if(x>=64)      
{set_xy(x-64,y);    
wdata(dd,0,1);}    
else       
{set_xy(x,y);     
wdata(dd,1,0);}    
}      
/*----------------设置起始行子程序-----------------------------------*/
void set_startline(uchar i)
{       
i=0xc0+i;      
wcode(i,1,1);     
}       
/*------------定位列和页地址子程序----------------------*/
void set_xy(uchar x,uchar y)
{    
x=x+0x40;                     
y=y+0xb8;                   
wcode(x,1,1);                   
wcode(y,1,1);                   
}                            
/*-------------屏幕开关子程序------------------------*/
void dison_off(uchar on)
{                             
on=on+0x3e;                   
wcode(on,1,1);                 
}                             
/*------------复位子程序-----------------------------*/
void reset()                    
{                        
RST=0;                    
delay(10);    
RST=1;    
delay(10);    
}
/****查忙子程序***********/ 
void lcd_busy(void)
{RS=0;
RW=1;
P2=0xff;
while(1){
EN=1;
if(P2<0x80)break;
EN=0;
}
EN=0;

/****清屏子程序******/
void clear_lcd()
{uchar i,j,x;
for(i=0;i<8;i++)   /**i为页数0~7页***/
{x=i+0xb8;     /*页地址设置指令代码**/
wcode(x,1,1);    /**将页地址设置指令代码写入lcm****/
wcode(0x40,1,1);  /**将列地址设置代码写入lcm,0x40为第0列指令代码,以后列地址会自动加1*****/
for(j=0;j<64;j++)
{wdata(0x00,1,1);}   /***将0x00写入LCM,实现清屏**********/
}}  
/*-------------初始化子程序------------------*/
void lcd_init(void)
{//uchar x,y;
clear_lcd();            
//reset();    
dison_off(0);
dison_off(1);   
set_startline(0);     
//for(y=0;y<8;y++)    
// {
// for(x=0;x<128;x++)lw(x,y,0);
// }
//dison_off(1);     
}      
/***********汉字显示子程序*/
void display_hz(uchar x, uchar y, uchar n,uchar m)
{     
uchar i,dx;                       
for(i=0;i<16;i++)    
{dx=hz[2*i+n*32];    
//if(fb)dx=255-dx;    
lw(x*8+i,y,dx);    
dx=hz[(2*i+1)+n*32];    
//if(fb)dx=255-dx;    
lw(x*8+i,y+1,dx);   
}       
}       
/****************************汉字点阵码表*********************************/
uchar code hz[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",1*/

0x00,0x00,0xFC,0xFF,0x04,0x10,0xF4,0x11,0x0C,0x1E,0x08,0x81,0x18,0x41,0xE8,0x61,
0x08,0x31,0xFC,0x0D,0x08,0x07,0x88,0x19,0x68,0x21,0x18,0x41,0x00,0x81,0x00,0x80,/*"陕",2*/

0x00,0x00,0xC4,0x7F,0x44,0x90,0x44,0x90,0x44,0x88,0xFC,0x87,0x44,0x80,0x44,0x80,
0x44,0x80,0xFC,0x87,0x44,0x88,0x44,0x88,0x44,0x88,0x44,0x88,0xC4,0xFF,0x00,0x00,/*"西",3*/

0x00,0x80,0x04,0x81,0x04,0x41,0xFC,0x7F,0x04,0x21,0x04,0xA1,0xFC,0x91,0x24,0x92,
0x24,0x92,0x24,0x92,0xFC,0xFF,0x24,0x92,0x24,0x92,0x24,0x92,0xF8,0x91,0x00,0x00,/*"理",4*/

0x00,0x00,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0xFC,0xFF,
0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x00,0x80,0x00,0x00,/*"工",5*/

0x00,0x00,0xE0,0x08,0x24,0x08,0xA8,0x08,0x90,0x88,0xA0,0x88,0xA0,0x08,0xAC,0x08,
0x90,0x8E,0xA0,0xFA,0xA0,0x09,0x90,0x08,0x2C,0x08,0x20,0x08,0xE0,0x08,0x00,0x00,/*"学",6*/

0x00,0x00,0xFC,0xFF,0x04,0x10,0xF4,0x10,0x0C,0x8F,0x70,0x82,0x48,0x42,0x48,0x3E,
0x48,0x02,0x4E,0x02,0x48,0x02,0x48,0xFE,0x48,0x82,0x08,0x82,0x78,0x72,0x00,0x00,/*"院",7*/

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",8*/

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",9*/
0x00,0x00,0x80,0x00,0x80,0x01,0x80,0xC2,0x80,0xBC,0x80,0x44,0xC0,0x20,0x38,0x20,
0x1C,0x10,0x60,0x20,0x80,0x40,0x80,0x5C,0x80,0xE2,0x80,0x01,0x80,0x00,0x80,0x00,/*"☆",0*/

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",1*/

0x00,0x00,0xF0,0x0F,0x90,0x08,0x88,0x08,0x88,0x08,0x88,0x08,0x88,0x08,0xFE,0xFF,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x90,0x88,0xF0,0x8F,0x00,0x60,0x00,0x00,/*"电",2*/

0x00,0x00,0x20,0x00,0x90,0x00,0xA8,0x00,0xA6,0x00,0xA4,0x00,0xA4,0x00,0xA4,0x00,
0xA4,0x00,0xA4,0x00,0xA4,0x00,0xA4,0x00,0x24,0x1F,0x04,0xE0,0x00,0xE0,0x00,0x00,/*"气",3*/

0x00,0x00,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0xFC,0xFF,
0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x00,0x80,0x00,0x00,/*"工",4*/

0x00,0x00,0x48,0x0C,0x48, www.751com.cn 0x44,0x89,0x44,0x89,0x3C,0x89,0x00,0x00,/*"程",5*/

0x00,0x00,0x00,0x80,0x04,0x62,0x44,0x12,0x64,0x0F,0x54,0x83,0xCC,0x82,0xC4,0xFE,
0x44,0x02,0x24,0x02,0x34,0x06,0x14,0x1A,0x82,0x33,0x00,0xC6,0x00,0x00,0x00,0x00,/*"系",6*/

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",7*/

0x00,0x00,0x80,0x00,0x80,0x01,0x80,0xC2,0x80,0xBC,0x80,0x44,0xC0,0x20,0x38,0x20,
0x1C,0x10,0x60,0x20,0x80,0x40,0x80,0x5C,0x80,0xE2,0x80,0x01,0x80,0x00,0x80,0x00,/*"☆",8*/


0x00,0x00,0xF8,0x03,0x28,0x01,0x24,0x01,0x04,0x41,0xFC,0x23,0x00,0x10,0x00,0x0C,
0xFC,0x03,0x94,0x00,0x92,0x10,0x02,0x20,0xFE,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,/*"明",0*/

0x00,0x04,0x20,0x02,0x10,0x3F,0xC8,0x00,0x26,0x10,0xC0,0x08,0x28,0x09,0xE8,0x12,
0xA8,0x22,0xFF,0x2A,0x94,0x22,0x94,0x30,0x70,0x24,0x00,0x08,0x00,0x00,0x00,0x00,/*"德",1*/

0x00,0x08,0x00,0x04,0x00,0x03,0xFC,0x08,0x24,0x06,0xE4,0x01,0xA4,0x08,0x92,0x27,
0x12,0x10,0x40,0x08,0x40,0x06,0xFE,0x11,0x20,0x18,0x20,0x0E,0xE0,0x01,0x00,0x00,/*"励",2*/

 << 上一页  [11] [12] [13] [14] [15] 下一页

常用液晶显示模块驱动程序设计 第14页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。