Author Topic: NHD-0220FZ-FSW-GBW-P-33V3  (Read 196 times)

timbro

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
NHD-0220FZ-FSW-GBW-P-33V3
« on: January 03, 2019, 06:31:11 AM »
Hello all...
We are trying to operate this display (NHD-0220FZ-FSW-GBW-P-33V3) with 4 bits and have achieved absolutely nothing so far.
Now we are questioning if we have understood the data sheet and have all the correct connections we need.
First we tried connecting everything with DB0-DB3 grounded. Then we tried DB0-DB3 not connected. Now we have tried connecting to a header on the 12 pin side only. Still nothing.
All the voltages are there.
Interestingly, we have a 10k pot on the contrast and cannot get any change in the display from one end of the pot to the other. I figured this is strange because I would have thought this was a quite separate to actually configuring the display for operation.
Finally, thinking we may have copped a faulty display, we tried another and it is exactly the same - completely unresponsive. We have another 8 more but I suspect they will all be the same.
We can drive several other displays with our code, so I don't think we are too far out with what we are doing code wise.
Has anyone got some configuration code that we make some comparisons with? or are there an secrets with this display that we should know about.
Thanks in advance...
Cheers, T

Alee_S

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: NHD-0220FZ-FSW-GBW-P-33V3
« Reply #1 on: January 04, 2019, 10:27:04 AM »
Hi timbro,

As far as connecting DB0-DB3, you can connect them to ground or leave them disconnected, as either option should work for 4-bit parallel interface.

Please see the sample code provided below as a reference, which I have tested and verified to work. The code provided is written for an Arduino Uno. 

Code: [Select]
/******** INITIAL DEFINITIONS***************/

#define E_Pin 10
#define R_W    9
#define R_S    8

/************************ CHAR STRING**********/

char const text1[] = ("NEWHAVEN DISPLAY");
char const text2[] = ("2x20 LCD DISPLAY");

/************ Functions************/
void latch(){                           // command to latch E
  digitalWrite(E_Pin, HIGH);            // Latch
  delay(1);
  digitalWrite(E_Pin, LOW);
  delay(20);
}
void command(char i){
  PORTD = i;
  digitalWrite(R_S, LOW);               // Command
  digitalWrite(R_W, LOW);               // Write
  latch();                              // take upper 4 bits
  i = i<<4;                             // shift 4 bits
  PORTD = i;                            // Take lower 4 bits
  latch();
}
void data(char i){
  PORTD = i;
  digitalWrite(R_S, HIGH);              // Data
  digitalWrite(R_W, LOW);               // Write
  latch();                              // take upper 4 bits
  i = i<<4;                             // shift 4 bits
  PORTD = i;                            // Take lower 4 bits
  latch();
}

/***********INITIALIZE DISPLAY************************/

void init1(){
digitalWrite(E_Pin, LOW);                                                     
 delay(100);                            //Wait >15 msec after power is applied
 PORTD=0x30  ;                         // Put 30 on port D           
 delay(30);                             //must wait 5ms, busy flag not available
 latch();                              //command 0x30 = Wake up
 delay(10);                             //must wait 160us, busy flag not available
 latch();                              //command 0x30 = Wake up #2
 delay(10);                             //must wait 160us, busy flag not available
 latch();                              //command 0x30 = Wake up #3
 delay(10);                             //can check busy flag now instead of delay 
 PORTD = 0x20;                          //put 0x20 on the output port (NEEDED TO SET 4-bit INTERFACE)         
 latch();     
 command(0x28);                         //Function set: 4-bit/2-line 
 command(0x28);                       
 command(0x0F);                         //Display ON; Blinking cursor
 command(0x06);                         //Entry Mode sets
}


void clear_screen(){                    // clear display
 command(0x01);
}
void ret_home(){                        // Return to home position
 command(0x02);
}
void disp(){                            // DISPLAY TEXT
  clear_screen();
  ret_home();                                 // Brings back to First Line
  for( int i = 0; i<16; i++){
    data(text1[i]);
  }
  command(0xC0);                              // Second Line
  for (int i = 0; i<16; i++){
    data(text2[i]);
  }
  ret_home();
}

void setup() {
 
  DDRD = 0xFF; // First 8 pins of PORT D as output
  DDRB = 0x07; // Port B first 3 pins as output
  init1();
  disp();
}

void loop() {
 
  delay(1000);
  while(1);
 
}

If the issue persists, can you provide/upload the following:
-Image of your hardware connections?
-Measured voltages across Pin 3 (contrast pin) at both limits of the POT? 
-The P/N of the other displays you can drive with your code?



timbro

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-0220FZ-FSW-GBW-P-33V3
« Reply #2 on: January 12, 2019, 11:10:21 PM »
Hi Alee_S,
I have a couple of other brands of 5Vdc 1602 LCD displays laying around which we have tested our code on and we are able to make these work ok but we are not able to find the same success with the Newhaven display.
We do not do too many PIC projects so initially we thought it may have been something lacking in our understanding using these devices however, we rebuilt the project using an STM8 device and again, we have only had success with other displays - not the Newhaven display.
I do have 10 of them and have tried two different ones just in the off chance that one was faulty.
Have you configured your delay function for a specific time period? ...and if so what is that period?

Alee_S

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: NHD-0220FZ-FSW-GBW-P-33V3
« Reply #3 on: January 14, 2019, 04:19:50 PM »
The delay function is set for 1 ms. So a delay(1000) = 1000 ms, or 1 second.

Did you have a chance to review the code provided vs the code used for other displays for their similarities/differences?

Once again, may you please upload images of your hardware connections, along with your measured contrast voltage across both limits of the POT? This would help me get closer to determining where the root issue lies.

Also, if you can provide P/N of some of the other displays you have successfully powered on, I can review their specs to see if there are software/hardware differences between our display and the other displays you have been using.


timbro

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-0220FZ-FSW-GBW-P-33V3
« Reply #4 on: January 17, 2019, 05:37:35 AM »
Hi Alee_S
I found a post on this forum related to a display with the same driver that is 4 x 20 and he was saying that he could only get his display to work in 1-line mode. I decided that I would try changing it to 1-line mode and see if it would work and it certainly did.
So my problem has now advanced to trying to make the display work with both lines. The guy did work out a solution however it is not explained very clearly and I have not been able to work out what the solution actually was. The link to the post is below.

https://www.newhavendisplay.com/NHD_forum/index.php/topic,1053.msg2502.html#msg2502

It would be very helpful if you could decipher this guys final comments and let me know what it actually means.

Kind regards,
 

Alee_S

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: NHD-0220FZ-FSW-GBW-P-33V3
« Reply #5 on: January 17, 2019, 09:34:57 AM »
Hi timbro,

For more information on 'Internal Reset Circuit', please see the attachment below, taken from Pg. 22 of the ST7066U controller datasheet. Please note those instructions are executed in the initialization section of the code I have provided.

The LCD working in 1-line mode is a good sign! It seems that under 2-line mode, the LCD is not receiving enough contrast to show the text properly. Try adjusting the contrast voltage on Pin 3, and hopefully that will do the trick.

timbro

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-0220FZ-FSW-GBW-P-33V3
« Reply #6 on: January 19, 2019, 05:36:48 AM »
Hi Alee_S,

There is no problem with contrast. it can be changed from 0.004 <-> 3.294 Vdc. It is a 10 turn pot and I have tried it across the full range.
By default the display is in 1-line mode. It has become pretty clear to us that it is not accepting 2-line configuration. Still have no idea why.
I have another question about your code... what does your PORTD consist of?
We are using 2 pins on the same port that we also use for DB4<->DB7, so we are setting these, (DB4<->DB7), bitwise - however, there is something quite strange - you apply 0x28 for 2-line mode (0010 1000)  - you don't send each nibble separately, so it would be very helpful to me if you could tell me exactly what you have connected to PORTB - bits 0 through 7, what are they connected to?

Kind regards   

 

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

Started by richardwrightBoard Character LCDs

Replies: 3
Views: 5313
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: 5702
Last post October 29, 2015, 01:23:58 PM
by Saurabh_B
NHD-0420DZ-FL-YBW LCD Replacement by NHD-0420H1Z-FL-GBW-33V3

Started by sugumar.krishnasamyBoard Character LCDs

Replies: 6
Views: 5657
Last post April 03, 2015, 09:00:45 AM
by Paul_B
NHD-0108CZ-FSW-GBW-33V3 contrast voltage

Started by perkyBoard Character LCDs

Replies: 3
Views: 3925
Last post February 12, 2016, 04:01:29 PM
by perky
NHD-0208AZ-fsn-GBW-33V3 (CG ram characters not displayed

Started by pla.electroBoard Character LCDs

Replies: 0
Views: 612
Last post June 11, 2018, 04:58:45 AM
by pla.electro