LCD i2C returned address but not responding

Hi!

I have a newhaven NHD-00220D3Z-NSW-BBW I2C LCD Display like this one:

This is the datasheet:

I have jumpered R1 to work with I2C communication and I have connected the LCD to my Arduino ONE like this :

LCD PIN ---- ARDUINO PIN

7(SCK/SCL) ---- A5
8(SDI/SDA) ----- A4
9(VSS) ---------- GND
10(VDD) -------- 5V

The thing is when I run this code to discover the address of the LCD, it seems to work and it returns this:

Scanning…
I2C device found at address 0x28 !
done

Using this addres, and using the libraries LiquidCrystal_V1.2.1, I run this code:

#include <Wire.h>
#include <LiquidCrystal_I2C.h> 

LiquidCrystal_I2C lcd(0x28);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("\nLCD start");
  Serial.println("\nBEGIN");
  
lcd.begin(16,2);               // initialize the lcd 
  
  Serial.println("\nHOME");
  
  lcd.home ();                   // go home
  lcd.print("Hello, ARDUINO ");  
  lcd.setCursor ( 0, 1 );        // go to the next line
  lcd.print (" WORLD!  ");   


}

void loop() {
  // put your main code here, to run repeatedly:

}

And through the terminal it just print LCD start and nothing in the LCD display.

What am I doing wrong??

thank you!

From the datasheet that you linked to:

The default I2C address is 80 (50 hex).

Note that this is the 8-bit address (0x50). The <Wire.h> library uses 7-bit addresses (0x28)

Most of the I2C backpacks use a PCF8574 chip (unintelligent).
It looks as if your display uses a PIC microcontroller (intelligent)

You need to write directly to the I2C using the commands set out in the datasheet.
There may be a specific Arduino library that will use the conventional LCD methods, but I am not aware of it.

It should be pretty simple to write this library. In which case, your LCD would use exactly the same code as any other LCD. i.e. you would only change the included library header and constructor() statements.

David.

First of all thanks for your response.

I was trying to use Wire libraryand its method begintransmission on 0x28. And it didn't work maye because this 7bit thing you mentioned.

Ok so if I want to send commands to the lcd, how can I send this 8 bit addresses?
Could you make an example please??

Thanks

I have tried this, but still nothing happens:

#include <Wire.h>


void setup()
{
  Wire.begin();

  Serial.begin(9600);
  Serial.println("\nI2C test");

  Wire.beginTransmission(0x28);
}

byte myArray[2];
    
void loop() {
  
  // put your main code here, to run repeatedly:

    //cursor home
    myArray[0] = 0xFE;
    myArray[1] = 0x46;
    
    Wire.write(myArray, 2);
    
    Serial.println("ei");

    delay(1000);

    // underlying cursor home on
    myArray[0] = 0xFE;
    myArray[1] = 0x47;
    
    Wire.write(myArray, 2);
    
Serial.println("eiiiii");

delay(1000);


}
#include <Wire.h>

void setup()
{
    Wire.begin();

    Serial.begin(9600);
    Serial.println("\nI2C test");
}

void loop()
{
    Wire.beginTransmission(0x28);
    Wire.write(0xFE);
    Wire.write(0x51);  //CLS
    Wire.print("Hello World");
    Wire.endTransmission();
    delay(1000);
}

Yes, you can create individual helper functions:

void gotoxy(byte col, byte row)
{
    Wire.beginTransmission(0x28);
    Wire.write(0xFE);
    Wire.write(0x45);  //SETCURSOR
    Wire.write(col + row * 64);
    Wire.endTransmission();
}
void printmsg(char *msg)
{
    Wire.beginTransmission(0x28);
    Wire.print(msg);
    Wire.endTransmission();
}

Note that Wire.h has a smallish buffer. So you can’t send 100s of characters in one go. From memory, the buffer is 32 or 64 bytes.

Untested. But you can see how easy it would be to extend the regular LCD functions.

David.

Many thanks!! Now it is working, you are right that is the way to go !