I2C Communication to Newhaven LCD

Hello all,

I am new to the I2C communication protocol and have been running into some issues. I am currently working on a project that communicates to a Newhaven LCD(Part #NHD-0216K3Z-NSW-BBW-V3). I have already successfully communicated with this same LCD successfully via TTL communication. I have also developed functions to clear LCD, set cursor, set brightness, etc.

I used the I2C scanner program to find the address of my LCD which is 0x28, which is contrary to the datasheet. I have also soldered a jumper to R1 as the datasheet specified for I2C.

As for my hardware, I am running a 9V wall wart into a barrel jack in my breadboard. I am running the 9V rail into a 5V regulator which is working well. I tied the ground pin of my Leonardo to my 9V source negative rail.

So my connections are as follows:
Pin 6 of LCD = 5V
Pin 5 of LCD = Neg terminal of source
Pin 4 of LCD = SDA of Leonardo
Pin 3 of LCD = SCL of Leonardo

The LCD datasheet also specifies it has 10k pullup resistors for the SDA and SCL lines.

Below is my code:

/Includes/
#include <Wire.h>

void setup() {

Wire.begin();

}

void loop() {

Wire.beginTransmission(0x28); // transmit to device #40 (0x28)

Wire.write(“Hello”);

Wire.endTransmission();

}

Because of the issues I am running into, I have greatly simplified my code as you can see above.
I am apparently receiving part of the message that I am sending to the LCD. The LCD is currently displaying “Helo” all over the LCD. So it appears I am communicating but not properly.

Also as a side note, I also placed all my code in setup() and it printed “Helo” only once to the LCD on the first line, first position as I expected.

As I mentioned earlier I took everything out of my code so it is bare bones. But these are some of the functions I have successfully used in my TTL program and altered for my I2C program.

void clearLCD(){
Wire.write(0xFE); //command flag
Wire.write(0x51); //clear command.
}
void backlightOn(){ //turns on the backlight
Wire.write(0xFE); //command flag for backlight stuff
Wire.write(0x53); //command flag for backlight stuff
Wire.write(8); //light level
}

Is there a reason why I am receiving “Helo” and not “Hello”? Does anybody see anything I may be missing/overlooking? Thank you all in advance!

My mistake the LCD part# was :NHD-0216K3Z-NSW-BBW-V3.

I used the I2C scanner program to find the address of my LCD which is 0x28, which is contrary to the datasheet. I have also soldered a jumper to R1 as the datasheet specified for I2C.

You will have to get this discrepancy resolved. How about resetting the I2C address by running the device via RS-232 (TTL) and then trying the default 0x50 I2C address without running the scanner.

Don

EDIT: I wouldn't fully trust any datasheet that expresses an I2C address in decimal.

Hi Don,

I removed the jumper and reset the I2C address, but my results are still the same. Any other ideas?

Thank you for your time!