打印

急!NT7532驱动的液晶不显示!!

[复制链接]
1884|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
wangziqian|  楼主 | 2008-6-11 16:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
xusnwise| | 2008-6-25 12:03 | 只看该作者

给你NT7534的, 应该差不多吧,自己在改下.

//-------------------------------------------------------------------------------------
//initialise the LCD module
//--------------------------------------------------------------------------------------
void lcd_ini(void)
{
   nRST = 0;
   delay(1000);                                // wait for the power stablised
   nRST = 1;
   //lcd_setting(display_on);
   //lcd_setting(0xa4);                        // normal "H" 
   lcd_setting(bias);                        // set the 1/9 bias voltage
   lcd_setting(ADC_NOM);                    
   lcd_setting(SCAN_NOM);                    // set the scan direction
   lcd_setting(ratio);                        // set the ratio (1+Ra/Rb)=5;
   lcd_setting(mode_enable);                // enable V0 setting
   lcd_setting(coffient);                    // set the a=53;
   lcd_setting(pwr_control);                // open all power source
   lcd_setting(display_on);
   //lcd_setting(display_off);                // test the lcd

}

//-----------------------------------------------------------------------------------------
//CLEAR LCD module
//-------------------------------------------------------------------------------------------
void    clear_lcd(void)
{
   uchar i,page;
   for(page=0xb0;page<0xb8;page++)
   {
     lcd_setting(page);
     lcd_setting(0x10);
     lcd_setting(0);
     for(i=0;i<132;i++)
     lcd_write(0);
   }



//------------------------------------------------------------------------------------
//LCD module bais setting
//--------------------------------------------------------------------------------------
void    lcd_setting(uchar control_byte)
{
   
   //nRD = 1;
   A0 = 0;
   delay(1);
   nRW = 0;
   delay(1);
   nRD = 1;
   delay(1);
   LCD_REG = control_byte;   
   delay(1);
   nRD = 0;
   delay(1);
   nRW = 1;
   delay(1);
   A0 = 1;
}

//--------------------------------------------------------------------------------------
//LCD display settings
//---------------------------------------------------------------------------------------
void    display_setting(void)
{
    lcd_setting(com0);
    lcd_setting(page1);
    lcd_setting(0x10);                          // set the colum address
    lcd_setting(0x0);
      
}

//-------------------------------------------------------------------------------------
//LCD WRITE
//--------------------------------------------------------------------------------------
void    lcd_write(uchar lcd_dat)
{
   
   //nRD = 1;
   A0 = 1;
   delay(1);
   nRW = 0;
   delay(1);
   nRD = 1;
   delay(1);
   LCD_REG = lcd_dat;
      
   delay(1);
   nRD = 0;
   delay(1);
   nRW = 1;
   delay(1);
  
}
//------------------------------------------------------------------------------------
//LCD WRITE DATA
//-----------------------------------------------------------------------------------
void    write_data()
{
   uchar i;
   uchar temp;
   for(i=0;i<120;i++)
   {  
     temp = * ( LCD_DAT1 + i );
     lcd_write(temp);
   }
   lcd_setting(page0);
   lcd_setting(0x10);                          // set the colum address
   lcd_setting(0x0);
   for(i=0;i<120;i++)
   {  
     temp = * ( LCD_DAT2 + i );
     lcd_write(temp);
   }
}

使用特权

评论回复
板凳
wswh2o| | 2008-6-26 10:35 | 只看该作者

我的博客有这个的介绍

你去看看

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

6

主题

14

帖子

1

粉丝