Author Topic: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3  (Read 3910 times)

c2hollow

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« on: July 07, 2014, 11:52:27 AM »
I have an NHD‐0420H1Z‐FL‐GBW‐3V3 that I am having trouble getting working.

I have re-created the sample code for the "Example Initialization Program", and confirmed that I am sending 3.3 volt signals along all the appropriate pins. However, I seem to be unable to send any characters to the display - All I see are blocked out first and third lines.

I'm not sure where to go from here in terms of debugging. The only thing I've noticed is that in the sample code there is: "command 0x30 = Wake up". I can't find this command in the manual for the LCD driver, so I don't know exactly what it does.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« Reply #1 on: July 08, 2014, 09:32:04 AM »
That command is the function set command, (shown on page 6 of the datasheet), and is needed to initialize the display.  Without it, the display will not function correctly.

c2hollow

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« Reply #2 on: July 08, 2014, 01:17:09 PM »
I don't understand, if 0x30 is the function set, then why further down in the code is there:

command(0x38); //Function set: 8-bit/2-line

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« Reply #3 on: July 08, 2014, 04:51:35 PM »
They are both function set commands.  The difference between them is that they are using different parameter values.  The controller knows its the function set command based off the first nibble "001x" (x = dont care).  That last dont care bit, along with the second nibble, are the parameters for the command.  The first 0x30 call is to "wake up" the display as you have said, the 0x38 call is to configure it correctly.

Here is some Arduino code I've used that works (it's only for a 2 line display but the code is the same):
Code: [Select]
// R/W signal is tied to ground (always write, never read)

int RS = 30;   //RS signal connected to digital pin 30 of Arduino Mega2560
int E = 31;    //E signal connected to digital pin 30 of Arduino Mega2560

const char text1[] = {"Newhaven Display"};
const char text2[] = {" Character LCD  "};

void command(char c)

   digitalWrite(RS, LOW);
   PORTA = c;
   digitalWrite(E, HIGH);
   delay(1);
   digitalWrite(E, LOW);
}

void data(char d)
{
   digitalWrite(RS, HIGH);
   PORTA = d;
   digitalWrite(E, HIGH);
   delay(1);
   digitalWrite(E, LOW);
}

void Home()
{
   command(0x01);
   delay(5);
}

void nextline()
{
   command(0xC0);
}

void disp_pic()
{
   int i;
   Home();
   for (i=0;i<16;i++)
   {
      data(text1[i]);
   }
   nextline();
   for (i=0;i<16;i++)
   {
      data(text2[i]);
   }
}

void setup()
{
   DDRA = 0xFF;    //set PORTA as output
   PORTA = 0x00;   //initialize PORTA to 0x00
   pinMode(RS, OUTPUT);
   pinMode(E, OUTPUT);
   digitalWrite(E, HIGH);
   delay(40);
   command(0x30);
   delay(5);
   command(0x30);
   delay(5);
   command(0x30);
   delay(5);
   command(0x38);
   command(0x10);
   command(0x0c);
   command(0x06);
   delay(5);
}

void loop()

  disp_pic();
  delay(5000);
}
Hopefully this will shed some light on any potential errors in your software.

c2hollow

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« Reply #4 on: July 09, 2014, 11:04:40 AM »
Do you know why the first and third lines would be full of boxes and the other lines are blank? Could that provide me a clue as to what I'm doing wrong in the initialization?

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« Reply #5 on: July 10, 2014, 08:43:52 AM »
There really isn't any particular reason why, or incorrect initialization command, this just happens when the display is not initialized.  Have you matched your code to what I have posted?  I have verified it to work on that display.  What voltage are you using on pin 3?  Do you have any other displays to test?

EDIT:  I just saw your other post saying you got it to work.  Thank you for sharing!
« Last Edit: July 10, 2014, 08:45:28 AM by Michael_L »

sask_ben

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« Reply #6 on: July 16, 2017, 04:10:19 PM »
I just got this display as well. I have used the 2 line NHD-0216BZ-FL-YBW display. Everything looks exactly the same and have wired it all the same but nothing is coming up on the NHD‐0420H1Z‐FL‐GBW‐3V3. Any suggestions?

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 337
  • Karma: 10
    • View Profile
Re: Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3
« Reply #7 on: July 17, 2017, 08:17:45 AM »
Hi,

Can you tell me what the voltage you have going to VDD and V0 are for this display?


 

NHD-0420H1Z-FL-GBW-33V3 pull-ups and pull-downs in 4 bit mode

Started by richardwrightBoard Character LCDs

Replies: 3
Views: 2745
Last post December 15, 2014, 05:12:27 PM
by Michael_L
NHD-0420H1Z-FL-GBW-33V3 - 2 Lines Mode Problem

Started by gnyturanBoard Character LCDs

Replies: 6
Views: 2929
Last post October 29, 2015, 01:23:58 PM
by Saurabh_B
Capacitive touch problems under linux (FT5x06)

Started by vpdBoard TFTs

Replies: 20
Views: 18932
Last post July 23, 2014, 02:01:31 AM
by vpd
NHD-0420DZ-FL-YBW LCD Replacement by NHD-0420H1Z-FL-GBW-33V3

Started by sugumar.krishnasamyBoard Character LCDs

Replies: 6
Views: 2859
Last post April 03, 2015, 09:00:45 AM
by Paul_B
NHD-C0216CZ-FSW-FBW-3V3 problems

Started by FelixBoard Character LCDs

Replies: 5
Views: 3001
Last post March 21, 2016, 01:02:39 AM
by Felix