Batron 20x4 LCD problem

Hi.

I have a Batron BTHQ 42003 AV-STF-06-LED01YG-CON-IC-RW1067 lcd display.

It has the RW1067 lcd driver chip. The problem is when i tried to use it with the LiquidCrystal library, it was able to display characters on the first and the second line, but there is nothing on the third and the fourth line. Besides this problem the library can drive the display perfectly

Here is the datasheet of the display: Batron 20x4

Is anyone can help me how to modify the original LiquidCrystal library to be able to address the 3rd and the 4th line??

Thanks in advance.

Although that LCD controller is not a clone of the HD44780 it looks close enough that the LiquidCrystal library should work, especially since you were able to display characters on the first two lines of your display.

Perhaps you could post your code. You did change the argument of the lcd.begin() statement didn't you.

Don

Actually, what i did is that i connected the display in 4bit mode exactly the same way how the regular HD44780 controller has to go. I loaded up the "Hello World" program from the LiquidCrystal exaples, and i have added two extra lines to test the whole screen.

What i think is that an extra statement is missing. After checking the HD44780 and the RW1067 protocol datasheet i noticed that there is an "Extended Function Set" instruction code in the RW1067, which is to select that the cursor is inverted or not and to choose between 2 line or 4 line mode.

Here is the RW1067 datasheet and this "extended" function is on the page 10.

Maybe if i set this function after the "lcd.begin" or modify the library itself to run this function call at the lcd.begin, than it will be able to use the last two lines.

Unfortunately i am not really experienced in creating/modifying libraries.

Maybe if i set this function after the "lcd.begin" or modify the library itself to run this function call at the lcd.begin, than it will be able to use the last two lines.

It looks like you are first going to have to deal with the 'Function Set' instruction (on page 11) in order to set the 'RE' bit. (EDIT: Don't forget to reset 'RE' when you are done.)

NOTE: The Hitachi controller has a limitation that its 'Function Set' instruction can only be invoked once, at the head of the program, but this controller apparently does not have that restriction.

You may be able do accomplish all this by invoking the command() function of the LiquidCrystal library without modifying the library itself as this function is listed as 'public' in the LiquidCrystal.h file.

Don

Hi

i have tried to set the RE bit and the 4 line mode and no effect.
Like this: "lcd.command(0x24); " for the RE bit and than lcd.command(0x09) for the 4 line mode, and the lcd.command(0x20) for the RE reset. i delayed all the commands by 50 uS
Is there any other way??

That looks correct to me. I guess it's time to contact Batron for some sample code.

On the other hand you still haven't verified that you modified the argument of the lcd.begin() statement. You even implied that you didn't ... --> "I loaded up the "Hello World" program from the LiquidCrystal exaples, and i have added two extra lines to test the whole screen. "

Don

Post your actual sketch. It looks pretty straightforward how to execute an extended command. Please show what you are doing. I would guess that I would:

void extended(uint8_t cmd)
{
    lcd.command(0x24);   // enable
    lcd.command(cmd);    // execute one extended cmd
    lcd.command(0x20);   // disable
}
    ...
    extended(0x09);       // 4-line
    ...

Of course, in a real-life implementation you would keep static copies of the IF, DC, REV, BE bits. And use them instead of the magic 0x24 / 0x20

Untested. I have never used your display.

David.

Hi this is the sketch:

#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {

  lcd.begin(20, 4);
  
   lcd.command(0x24);
   delayMicroseconds(4500);
   
   lcd.command(0x9);
   delayMicroseconds(4500);
   
   lcd.command(0x20);
   delayMicroseconds(4500);
   
  lcd.setCursor(0, 0);
 
  lcd.print("hello, world!");
  
  
}

void loop() {
  
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
 
  lcd.setCursor(0, 2);
 lcd.print("hello, world!");
  
  lcd.setCursor(0, 3);
  lcd.print("hello, world!");
}

I think the problem is the lcd.begin command.

Here is the new code:

#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
   
  
  lcd.begin(20, 4);
  
  extended(0x9);
  lcd.setCursor(0, 0);
 
  lcd.print("hello, world!12345678");
 
 
}

void loop() {
  
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
 
  lcd.setCursor(0, 2);
 lcd.print("hello, world!1234567");
  
  lcd.setCursor(0, 3);
  lcd.print("hello, world!");
}


void extended(uint8_t cmd)
{
    lcd.command(0x24);   // enable
    delayMicroseconds(4500);
    lcd.command(cmd);    // execute one extended cmd
    delayMicroseconds(4500);
    lcd.command(0x20);   // disable
    delayMicroseconds(4500);
}

It seems what is done by the “extended” command the lcd.begin messing it up and there is nothing on the lcd.

I find it hard to believe that an LCD controller that has so much in common with it’s ancestor (the HD44780) is not able to display four lines of text without jumping through these hoops.

Try this sketch, which doesn’t involve addressing or cursor positioning, and see if characters appear on all four lines:

#include <LiquidCrystal.h>

//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // put your pin numbers here

void setup()
  {
    lcd.begin(20, 4);                          // put your LCD parameters here
    for (char i=47; i<127; i++)                // send 80 consecutive displayable characters to the LCD
      {
        lcd.print(i);
        delay(100);                            // this delay allows you to observe the addressing sequence
      }
  }


void loop()
  {  
  }

Don

No, still nothing on line 3 and 4. :frowning: