导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→字符液晶编程[lxm1979]

 *第32787篇: 字符液晶编程

  
楼 主:lxm1979 2005年7月4日16:30
 字符液晶编程
我在编液晶字符显示时遇到这样一个问题:
  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);
  }
  不知道错在那里,请大虾指点!!
谢谢!!
  
2楼:Seawaves 2005年7月4日18:56
 你当我是电脑???自己好好检查!!!
你当我是电脑???自己好好检查!!!
  
3楼:Seawaves 2005年7月4日19:07
 unsigned char ReadOn
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);
  }
  


白写,要先写地址再定数据!!!!!!!


>>>>>>对该主题发表你的看法

本主题贴数3,分页: [第1页]


[上一篇主题]:转让大量LED显示屏技术资料!

[下一篇主题]:强烈推荐低价9200开发板