Problems with a NHD‐0420H1Z‐FL‐GBW‐3V3

Comments

9 comments

  • Michael_L

    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.

    0
  • c2hollow

    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

    0
  • Michael_L

    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):

    // 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.

    0
  • c2hollow

    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?

    0
  • Michael_L

    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!

    0
  • sask_ben

    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?

    0
  • Saurabh_B

    Hi,

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

    0
  • don.keuth

    Hi,

    I'm using BeagleBone Back with Ubuntu 14.04 kernel 3.15 and NHD-7.0CTP-CAPE-N. When I turn power on, I don't see the screen like a desk top. SSH to Beaglebone Black(BBB) using Putty on my window PC is not working. Connecting the BBB to the internet over usb is also not working. Any idea?

    Thanks,
    Don

    0
  • Ted M.
    NHD Staff

    Please be sure the power supply is 5v @ 2A minimum. Also, try loading the latest Ubuntu image from the Beagleboard.org website. 

    Best Regards,

    0

Please sign in to leave a comment.