我来试着回答一下 不过液晶屏的型号我不保证我们用的是一样儿的
具体程序如下:(我仿真了一下,还可以)
#include
#include
typedef unsigned char uchar;
typedef unsigned int uint;
sbit L_DI = P2^0;
sbit L_RW = P2^1;
sbit L_E = P2^4;
sbit L_CS1 = P2^6;
sbit L_CS2 = P2^7;
sbit L_SET = P2^3;
sbit TEST = P3^5;
float abc;
uchar code X1[] ={0x08,0x08,0xF8,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,
0x20,0x20,0x3F,0x20,0x20,0x00,0x00,0x01,0x03,0x06,0x0C,0x18,0x3F,0x00,0x00,0x00};/*"N",0*/
uchar code X2[] = {0x00,0x08,0x08,0xF8,0xF8,0x88,0x88,0x88,0x88,0x88,0x88,0x58,0x78,0x30,0x00,0x00,
0x00,0x20,0x20,0x3F,0x3F,0x20,0x20,0x20,0x20,0x20,0x20,0x21,0x11,0x1F,0x0E,0x00};/*"B",1*/
uchar code X3[] = {0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x18,0x78,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,
0x20,0x20,0x38,0x26,0x23,0x02,0x02,0x02,0x02,0x03,0x2F,0x3E,0x38,0x20,0x20,0x00};/*"A",2*/
#pragma REGISTERBANK(0)
void initcomm(void)
{
PCON = 0x80;TMOD = 0X21; SCON = 0X50;
TH1 = 0XFa;TL1 = 0XFa; TR1 = 1;ES = 1;
TH0 = 0;TL0 = 0;TR0 = 1; ET0 = 1;
EA =0;
}
void delay(void)
{
uchar i,j;
abc = 0.1*5;
for (i = 0;i != 0xff;i++)
for (j = 0;j != 0xff;j++) ;
}
void LCD_C_D(bit flag,uchar ldata) /*flag=1 con flag=0 data*/
{
uchar data i;
L_DI = !flag; L_E = 0; L_RW = 0; P0 = ldata;
_nop_();
L_E = 1;
_nop_(); _nop_();
L_E = 0; L_RW = 1; L_DI = 1;
for ( i = 0; i < 10 ;i++) ;
}
void dis_one_zi(uchar x_add,uchar y_add,uchar code *po)
{
uchar i,j,w;
j = x_add*2+0xb8;
w = (y_add < 4 ? y_add : y_add-4)*16+0x40;
L_CS1 = (y_add < 4);
L_CS2 = !(y_add < 4);
LCD_C_D(1,j);
LCD_C_D(1,w);
for (i = 0; i < 32;i++)
{
if (i == 16)
{
LCD_C_D(1,j+1);
LCD_C_D(1,w);
}
LCD_C_D(0,*po++);
}
L_CS1 = L_CS2 = 0;
}
void CLRLCD(uchar number)
{
uchar data i,j;
L_CS1 = L_CS2 = 1;
for (i = 0xb8; i < 0xc0;i++)
{
LCD_C_D(1,i);
LCD_C_D(1,0X40);
for (j = 0; j < 0x40; j++)
LCD_C_D(0,number);
}
L_CS1 = L_CS2 = 0;
}
void main(void) using 0
{
uchar data i,j,number;
uchar code *p;
initcomm();
L_SET = 0;
for ( j = 0; j != 0xff; j++);
L_SET = 1;
for ( j = 0; j != 0xff; j++);
LCD_C_D(1,0X3E); /**/
LCD_C_D(1,0XC0); /**/
LCD_C_D(1,0X3F); /**/
CLRLCD(0);
while(1)
{
CLRLCD(0);
LCD_C_D(1,0X3E);
/*欢迎使用*/
p=X1; dis_one_zi(1,1,p);
p=X2; dis_one_zi(1,2,p);
p=X3; dis_one_zi(1,3,p);
LCD_C_D(1,0X3F);
delay(); delay();
CLRLCD(0);
LCD_C_D(1,0X3E);
}
}
这个要视具体情况而定。首先可以排除是文件本身的问题,重新装一下软件试试,可能是你软件有些文件被破坏了
你从别人电脑把LISA7709.SDF文件拷到你自己电脑试试
重装一下