C51编程:用C51编写的驱动LCD模块程序
下面是我编写的程序,但不知道为什么用在HD44780的模块上就可以,换上KS0066的模块就
不亮。请问HD44780和KS0066兼容吗?是不是我的程序有问题?
#include "at89x51.h"
sbit RS=P2^0;
sbit RW=P2^1;
sbit E=P2^2;
Delay(unsigned int count) //Delay
{
unsigned int i,j;
for (i=0; i<count; i++)
for (j=0; j<125; j++);
}
//*****************************************************
I_send(unsigned char y) //Send command
{
RS=0;
RW=0;
E=1;
P0=y;
Delay(1);
E=0;
}
//*****************************************************
D_send(unsigned char x) //Send data
{
RS=1;
RW=0;
E=1;
P0=x;
Delay(1);
E=0;
}
//*****************************************************
Start_lcd() //Initial LCD
{
Delay(15);
I_send(0x38);
Delay(6);
I_send(0x38);
Delay(1);
I_send(0x38);
I_send(0x01);
I_send(0x38);
I_send(0x08);
I_send(0x0c);
I_send(0x06);
}
main()
{
Start_lcd();
I_send(0x80);
D_send('1');
D_send('2');
D_send('3');
while(1)
{}
}
发表时间:2002年8月19日1:43:00