字符液晶编程
我在编液晶字符显示时遇到这样一个问题:
1 在液晶显示中1行 3 列 显示‘N‘
2 然后读1行 3 列的数据,将其显示到2行3列,结果显示一个‘U’
从液晶中读数据的子程序如下:
unsigned char ReadOneChar (unsigned char pposx,unsigned char pposy)
{
unsigned char readdata;
Uchar temp;
temp = pposx & 0xf;
pposy &= 0x3;
if ( pposy==0x01 )temp |= 0x40;
else if ( pposy==0x02 )temp |= 0x10;
else if ( pposy==0x03 )temp |= 0x50;
else ;
temp |= 0x80;
LcdWriteCommand(temp,0);
Delay5Ms();INT0=~INT0;
RS =1; RW = 1; Elcm = 1;;;;;;Elcm = 0;
readdata=DataPort;
;Elcm = 0;
return(readdata);
}
不知道错在那里,请大虾指点!!
谢谢!!
发表时间:2005年7月4日16:30:04