Author Topic: NHD-0420D3Z-NSW-BBW-V3 i2c display and Arduino missing characters  (Read 830 times)

0miker0

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
For some reason my i2c display appears to be missing random characters. I've adjusted the i2c speed and delays but characters are still missing. It's connected to a new Arduino UNO. I'm not sure if the Uno has built in pull-up resistors on the SDA & SCL lines but the display has onboard 10K pull-ups.

On the screen now I see:
124679
BCEGHJLMOQRT

and my code is:

Code: [Select]
/*
 
Newhaven NHD-0420D3Z-NSW-BBW-V3 LCD
R1 shorted with a 0R resistor
SCL and SDA pullup resistors already on LCD

*/
#include <Wire.h>

#define I2C_ADDRESS        0x28  //LCD I2C address  0x28??? It should be 0x50
#define DISPLAY_ON         0x41  //DISPLAY ON
#define DISPLAY_OFF        0x42  //DISPLAY OFF
#define SET_CURSOR         0x45  //SET CURSOR
#define CURSOR_HOME        0x46  //CURSOR HOME
#define MOVE_CURSOR_LEFT   0x49  //MOVE CURSOR LEFT
#define MOVE_CURSOR_RIGHT  0x4A  //MOVE CURSOR RIGHT
#define BLINK_CURSOR_ON    0x4B  //BLINK CURSOR ON
#define BLINK_CURSOR_OFF   0x4C  //BLINK CURSOR OFF
#define BACKSPACE          0x4E  //BACKSPACE
#define CLEAR_SCREEN       0x51  //CLEAR SCREEN
#define SET_CONTRAST       0x52  //SET CONTRAST
#define SET_BACKLIGHT      0x53  //SET BACKLIGHT
#define MOVE_DISP_LEFT     0x55  //MOVE DISPLAY LEFT
#define MOVE_DISP_RIGHT    0x56  //MOVE DISPLAY RIGHT
#define DISP_I2C_ADDR      0x72  //DISPLAY I2C ADDRESS

void setup()
{
  Wire.setClock(100000);  //sets I2C speed to 100kHz
  Wire.begin();
  Serial.begin(9600);
  delay(1000);

  Display_Clear();
  //Cursor_Home();
 
  Set_Cursor_Line_1();
  Wire.beginTransmission(I2C_ADDRESS); 
  Wire.write(0xFE);           //Prefix
  Wire.write("0123456789");  //Display Text
  Wire.endTransmission();

  Set_Cursor_Line_2();
  Wire.beginTransmission(I2C_ADDRESS); 
  Wire.write(0xFE);           //Prefix
  Wire.write("ABCDEFGHIJKLMNOPQRST");  //Display Text
  Wire.endTransmission();
 
  delay(1000);                //wait for a second
}


void loop()
{
 
}



void Display_On(void)
{
 Wire.beginTransmission(I2C_ADDRESS); 
 Wire.write(0xFE);           //Prefix
 Wire.write(DISPLAY_ON);     //Display On
 Wire.endTransmission();
 delay(2);                 //wait for a 1/4 second
}

void Display_Clear(void)
{
 Wire.beginTransmission(I2C_ADDRESS); 
 Wire.write(0xFE);           //Prefix
 Wire.write(CLEAR_SCREEN);   //Clear Display
 Wire.endTransmission();
 delay(2);                 //wait for a 1/4 second
}

void Set_Cursor_Line_1(void)
{
 Wire.beginTransmission(I2C_ADDRESS); 
 Wire.write(0xFE);         //Prefix
 Wire.write(0x45);         //Set Cursor
 Wire.write(0x00);         //
 Wire.endTransmission();
 delay(2);               //wait for a 1/4 second
}

void Set_Cursor_Line_2(void)
{
 Wire.beginTransmission(I2C_ADDRESS); 
 Wire.write(0xFE);         //Prefix
 Wire.write(0x45);         //Set Cursor
 Wire.write(0x40);         //
 Wire.endTransmission();
 delay(2);               //wait for a 1/4 second
}

void Cursor_Home(void)
{
 Wire.beginTransmission(I2C_ADDRESS); 
 Wire.write(0xFE);           //Prefix
 Wire.write(CURSOR_HOME);     //Cursor Home
 Wire.endTransmission();
 delay(2);                 //wait for a 1/4 second
}

void Cursor_Right(void)
{
 Wire.beginTransmission(I2C_ADDRESS); 
 Wire.write(0xFE);           //Prefix
 Wire.write(MOVE_CURSOR_RIGHT);     //Cursor Home
 Wire.endTransmission();
 delay(2);                 //wait for a 1/4 second
}



 

Blank Display on NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM

Started by SteveCBoard Character LCDs

Replies: 3
Views: 4725
Last post May 13, 2014, 12:04:36 AM
by SteveC
NHD‐C12864A1Z‐FSW‐FBW‐HTT display clears after draw

Started by EdAverillBoard Graphic LCDs

Replies: 6
Views: 5938
Last post November 07, 2014, 08:25:20 AM
by Michael_L
NHD‐4.3‐480272EF‐ATXL#‐CTP | FAN5333 | BBB | Nothing on the Display

Started by Alias_AliasBoard TFTs

Replies: 1
Views: 3580
Last post September 25, 2015, 03:09:24 PM
by Paul_B
NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines

Started by stylonurusBoard OLEDs

Replies: 5
Views: 5768
Last post June 18, 2014, 10:09:49 AM
by Michael_L
NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command

Started by dstoverBoard Character LCDs

Replies: 2
Views: 3867
Last post March 27, 2014, 05:41:27 PM
by Michael_L