Glenn
Glenn

Reputation: 31

I'm having trouble initializing a 1604A-V1.2 Character module

I have a product that uses a 4 line x 16 character LCD display module. It works fine with the original 1604 model, but the display has evidently been updated with an SPLC780C control chip. It will not initialize. From the datasheet, it appears to emulate the HD44780 just like the original, But it will not initialize. I get the normal block characters on line one and line 3 that you get if just powering it up.

Does anyone here know what the problem might be? Here is the init code:

\\\
void lcd_init(void) 
{
   unsigned int8 i;
   unsigned int8 LCD_INIT_STRING[4] = {0x20 | (LCD_TYPE << 2), 0x0C, 1, 6};
                              //{0x22, 0x4, 1, 6}
                             // These bytes need to be sent to the LCD
                             // to start it up.
   

   lcd_output_enable(0);
   lcd_output_rs(0);
   lcd_output_rw(0);

 #if defined(__PCB__)
   set_tris_lcd(LCD_OUTPUT_MAP);
 #else
  #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && 
  defined(LCD_DATA7))
   output_drive(LCD_DATA4);
   output_drive(LCD_DATA5);
   output_drive(LCD_DATA6);
   output_drive(LCD_DATA7);
  #else
   lcdtris.data = 0x0;
  #endif
   lcd_enable_tris();
   lcd_rs_tris();
   lcd_rw_tris();
 #endif
    
   delay_ms(450);

for(i=1;i<=3;++i)
   {
       lcd_send_nibble(3);
       delay_ms(45);
   }
   
   
   delay_ms(15);
   for(i=0;i<=4;++i)
     {
      lcd_send_byte(0,LCD_INIT_STRING[i]);
      delay_ms(45);
     }
   lcd_send_nibble(8);
   lcd_send_nibble(0);
   lcd_send_nibble(8);
   lcd_send_nibble(0);
   lcd_send_nibble(1);
   lcd_send_nibble(0);
   lcd_send_nibble(4);
   

  #if defined(LCD_EXTENDED_NEWLINE)
   g_LcdX = 0;
   g_LcdY = 0;
  #endif
}
\\\

Upvotes: 0

Views: 388

Answers (2)

user16986846
user16986846

Reputation: 1

Maybe i was too fast for answer but i want precise that i had a problem with a new LCD1604-16char,thinking i bought a 2004 one!! but two lines couldn't get from the beginning,so i've made a negative setcursor.

Upvotes: 0

panacotta
panacotta

Reputation: 11

Same problem here for me, but I found an iconoclast solution for the bad lines. A negative setcursor like that:

lcd.setCursor(-4,2);
lcd.setCursor(-4,3);

Upvotes: 1

Related Questions