Author Topic: NHD-042ODZW-AY5 No Display  (Read 3137 times)

PCook

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
NHD-042ODZW-AY5 No Display
« on: December 22, 2014, 02:36:34 PM »
Hi Folks;

Perhaps someone can help get me past this situation.

I have a newly purchased NHD-042ODZW-AY5 OLED display. I have altered the jumpers to run the display in serial mode (SPI), driven by a Netdunio Plus 2. I can't get anything to display. The clock (SCL), chip select (CS), and input (SDI) all appear correct using an oscilloscope. The power is 5v at the display and the ground is good. I am drawing power/ground from the Netduino board's 5v/GND output pins. I'm fairly certain my code is outputting the correct commands, although I'm not certain if the commands are being read by the display because I'm not sure how to send a R/W command to the display - this could actually be my problem.

Is there a way to test the display unit that does not involve input signals such as CS, SDI, etc? In other words, does the display have a "test" mode so that I can at least determine that I don't have a DOA unit?

Thanks!

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-042ODZW-AY5 No Display
« Reply #1 on: December 23, 2014, 12:40:53 PM »
I'm sorry but unfortunately there is not such a test mode on this display.  I have included some example code for this display used in serial mode below:

Code: [Select]
//---------------------------------------------------------
/*
NHD_0216KZW_serial_mega.ino
Program for writing to Newhaven Display 2 x 16 Character OLED (Serial mode)

(c)2014 Mike LaVine - Newhaven Display International, LLC.

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
*/
//---------------------------------------------------------

int OLED_SCL =  30;    // SCL signal connected to digital pin 30 of Arduino Mega2560
int OLED_SDO =  31;    // SDO signal connected to digital pin 31 of Arduino Mega2560
int OLED_SDI =  32;    // SDI signal connected to digital pin 32 of Arduino Mega2560
int  OLED_CS =  33;    // /CS signal connected to digital pin 33 of Arduino Mega2560

const char text1[] = {"Newhaven Display"};
const char text2[] = {"2 x 16 Char OLED"};

void command(char c)

   unsigned char i;
   digitalWrite(OLED_CS, LOW);
   delay(2);
   digitalWrite(OLED_SCL, LOW);
   delay(2);
   digitalWrite(OLED_SDO, LOW);
   delay(2);
   digitalWrite(OLED_SCL, HIGH);
   delay(2);
   digitalWrite(OLED_SCL, LOW);
   delay(2);
   digitalWrite(OLED_SDO, LOW);
   delay(2);
   digitalWrite(OLED_SCL, HIGH);
   delay(2);
   digitalWrite(OLED_SCL, LOW);
   delay(2);
   for(i=0x80;i;i>>=1)
   {
      if((c&0x80) == 0x80)
      {
        digitalWrite(OLED_SDO, HIGH);
      }
      else
      {
        digitalWrite(OLED_SDO, LOW);
      }
      c = (c << 1);
      delay(2);
      digitalWrite(OLED_SCL, LOW);
      delay(2);
      digitalWrite(OLED_SCL, HIGH);
      delay(2);
      digitalWrite(OLED_SCL, LOW);
      delay(2);
   }
   digitalWrite(OLED_CS, HIGH);
}

void dataInit(void)
{
   digitalWrite(OLED_CS, LOW);
   delay(2);
   digitalWrite(OLED_SCL, LOW);
   delay(2);
   digitalWrite(OLED_SDO, HIGH);
   delay(2);
   //digitalWrite(OLED_SCL, LOW);
   digitalWrite(OLED_SCL, HIGH);
   delay(2);
   digitalWrite(OLED_SCL, LOW);
   delay(2);
   digitalWrite(OLED_SDO, LOW);
   
   digitalWrite(OLED_SCL, HIGH);
   delay(2);
   digitalWrite(OLED_SCL, LOW);
   delay(2);
}

void data(char d)
{
   unsigned char i;
   for(i=0x80;i;i>>=1)
   {
      if((d&0x80) == 0x80)
      {
        digitalWrite(OLED_SDO, HIGH);
      }
      else
      {
        digitalWrite(OLED_SDO, LOW);
      }
      d = (d << 1);
      delay(2);
      digitalWrite(OLED_SCL, LOW);
      delay(2);
      digitalWrite(OLED_SCL, HIGH);
      delay(2);
      digitalWrite(OLED_SCL, LOW);
      delay(2);
   }
}

void disp()
{
   int i;
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   delay(5);
   dataInit();
   delay(2);
   for (i=0;i<16;i++)
   {
      data(text1[i]);
      delay(2);
   }
   digitalWrite(OLED_CS, HIGH);
   delay(2);
   command(0xC0);  //Second Line  [Set DDRAM address to Line 2 position 1]
   delay(2);
   dataInit();
   delay(2);
   for (i=0;i<16;i++)
   {
      data(text2[i]);
      delay(2);
   }
   digitalWrite(OLED_CS, HIGH);
   delay(2);
   /*command(0x94);  //Third Line  [Set DDRAM address to Line 3 position 1]
   for (i=0;i<20;i++)
   {
      data(text3[i]);
   }
   command(0xD4);  //Fourth Line  [Set DDRAM address to Line 4 position 1]
   for (i=0;i<20;i++)
   {
      data(text4[i]);
   }*/
}

void setup()

   pinMode(OLED_CS, OUTPUT);
   pinMode(OLED_SCL, OUTPUT);
   pinMode(OLED_SDO, OUTPUT);
   //pinMode(OLED_SDI, INPUT);
   digitalWrite(OLED_SCL, LOW);
   digitalWrite(OLED_SDO, LOW);
   
   delay(10);

   command(0x38);  //Function Set  [8-bit mode, Font Table: English/Japanese (FT[1:0] = 00)]
   delay(2);
   command(0x08);  //Display OFF
   delay(2);
   command(0x01);  //Display Clear
   delay(30);
   command(0x06);  //Entry Mode Set  [Auto increment address when a character is written]
   delay(2);
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   delay(2);
   command(0x0C);  //Display ON
   delay(2);
}

void loop()

  disp();
  delay(10);
  //command(0x08);  //Display OFF
  //delayMicroseconds(5000);
  //command(0x0C);  //Display ON
  //delay(2);
}

This code should help you get the display working correctly.  I know it says for 2x16 OLED, but since they use the same controller it works the same.  You will notice the code writes to 4 lines.

PCook

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: NHD-042ODZW-AY5 No Display
« Reply #2 on: December 29, 2014, 09:03:50 AM »
Well, I'm about done with Newhaven displays. I have had enormous difficulty with the display model named in the subject line due to a sparse and cryptic spec document, having to hand-resoldier surface-mouted jumpers and wading through a slew of "example code" that is not described well enough to even be useful. Now, having used the exact "example code" given in response to my totally dark display help request post, and on an Ardunio 2560 (which is not even my target hardware), I get mostly random garbadge characters (but at least I now know the display is not DOA, so some progress). I may get the correct text on the display, but usually just random garbage charcaters. At any rate, I have spent more time getting this display (partially) running than I have spent on the project of which this display unit is just a small portion. I have used other LCD displays that *just worked* out of the box. At the moment, this is a disapointing $40 discard. Disapointing because an OLED was just what was needed for the project and it should not be this difficult. If Newhaven display is even the slightest interested in the non-commercial market, it needs to publish clear documention and provide much better "example code" that is well described. The Engineers at Newhaven display would be wise to build in firmware that brings display units up with a self-test so that the user isn't chasing his tail with a totally non-responsive display unit. There comes a point where even the most handsome component in a project is simply not worth the effort. This forumn is litered with posts of people having much the same challenge as I to get Newhaven displays running, with some threads just ending with no indication of success (did they abandon the effort too?). If I can be offered some good guidance on this forumn, I'll pull the display out of the reject bin and give it another try, else I need to move on to a display product that gives me usable results in less time than it takes to earn a Master's degree in LCD display technology. Take this post more as feedback than as a desperate plea for help - I have other display options.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-042ODZW-AY5 No Display
« Reply #3 on: December 29, 2014, 04:25:45 PM »
I understand it can be frustrating to get a display working (believe me I've been there plenty of times!), but the example code I have sent you apparently did work out for you at least some what yes?  It allowed you to show characters on the display which is a huge step in the right direction.  It sounds to me that the garbage characters you are getting are due to a timing issue with either the serial data transfer routine(s) or the execution time of a command send.  Can you introduce some delays in your serial data transfer to see if this affects what you are seeing on the display?

As for the example code, what in particular is not clear about it?  I would be happy to clarify anything in it for you if you have any questions.

Lastly, thank you for your suggestions and feedback!  They will be considered before any future design change/spec update!

PCook

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: NHD-042ODZW-AY5 No Display
« Reply #4 on: December 29, 2014, 05:53:36 PM »
It allowed you to show characters on the display which is a huge step in the right direction.

Yes, but I would ultimately like to show the correct characters on the display, which is the primary reason I bought this display component.

It sounds to me that the garbage characters you are getting are due to a timing issue with either the serial data transfer routine(s) or the execution time of a command send.  Can you introduce some delays in your serial data transfer to see if this affects what you are seeing on the display?

If I used your example code, exactly, on an Arduino 2560 as the code was written for, wired as per the example code, what could possibly cause a timing issue?! At any rate, I did introduce delays in the example code without positive results. I don't see the value chasing this particular ghost.

As for the example code, what in particular is not clear about it?  I would be happy to clarify anything in it for you if you have any questions.

There are a number of example code files on the NHD website, each named with what appears to be a version number, which is meaningless to readers. Also, the header comments are not clear as to the target display of the code example or plateform (yet is clear about warranty disclaimer). The example code is sparsly commented. Example code commenting is an excellent opportunity to explain what the hardware requires and perhaps a little theory. Keep in mind that people also want to understand why the code is written as it is, not just that it gets the display to light up.

Lastly, thank you for your suggestions and feedback!  They will be considered before any future design change/spec update!

I think it comes down to also putting attention toward the quality of the product reference materials. If a corporation is going to use a component in its product line, putting a large effort in to undestand the component might be worth the effort considering a profitable end result. But an individual will usually not make such an investment in time and frustration and would rather utilize a product that is well documented and understandable. This is something that the people at Sparkfun and Adafruit understand who often write tutorials on a product with the manufacturers spec document only as a reference. If Newhaven Display wants any decent part of the enthusiast or hobby market, its product reference material is going to need to be rewritten to be supportive of non-engineers as well as descriptive and clear. This includes example code, especially. But, it is also possible that Newhaven Display products are not intended for other than corporate product integration, which is fine if that's what NHD prefers.

As for the display, I'm going to abandon it for my project. I've expended too much time getting it to even light up, let alone trying to get it to display meaningful characters - the effort on the display is overshadowing the effort of the project itself. I liked the brightness, clarity and contrast of the OLED pixels I did see, but they also need to make sense. Thank you for extending an effort to help.

 

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

Started by SteveCBoard Character LCDs

Replies: 5
Views: 4583
Last post Today at 10:40:50 AM
by tolikkk
NHD‐C12864A1Z‐FSW‐FBW‐HTT display clears after draw

Started by EdAverillBoard Graphic LCDs

Replies: 9
Views: 5732
Last post Today at 09:20:46 PM
by tolikkk
NHD‐4.3‐480272EF‐ATXL#‐CTP | FAN5333 | BBB | Nothing on the Display

Started by Alias_AliasBoard TFTs

Replies: 1
Views: 3433
Last post September 25, 2015, 03:09:24 PM
by Paul_B
Arduino LCD library not working with newhaven display NHD‐0420H1Z‐FL‐GWB-3V3

Started by c2hollowBoard Character LCDs

Replies: 14
Views: 8866
Last post Today at 02:12:56 PM
by tolikkk
NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines

Started by stylonurusBoard OLEDs

Replies: 5
Views: 5598
Last post June 18, 2014, 10:09:49 AM
by Michael_L