• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

Dead LCD? (parallel 20x2)

psylence

New member
I'm under the assumption that these are HD44780-based displays, if this is wrong, please let me know and slap me.

I'm using a microcontroller for a little project of mine. I have a super-cheap HD44780 LCD that I have been using for prototyping, and it works fine, no backlight or anything, but that doesn't matter.

I decided to get a "real" LCD for the final project, and I went with the CFAH2002A-YMC-JP because they looked beautiful on the web page :) I got it today and after hooking it up (w/o backlight) I turn it on and get nothing. So I disconnect everything and hook it all back up, still nothing, so I tear my circuit apart and put it back w/the old cheap LCD and it works fine.

So I try again, triple checking my wiring and can't find anything different. Still nothing...

What should I do? I don't have a parallel cable, nor do I have any desire to make one to hook it up to my computer to test this.

A couple assumptions, on the cheapo LCD I simply grounded the contrast line, this gave me a good contrast so I went with it. I did the same w/this screen, of course it didn't work, but I did also try it w/ a 10k pot. Also I'm assuming this will work w/o the backlight on? I later tried hooking LED+ to +5 and LED- to Gnd and still got nothing, no glow or anything...
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CF Tech

Administrator
psylence:

Thank you for your post. The CFAH2002A-YMC-JP is an HD44780 compatible LCD. If you have the "super-cheap" one working and the CFAH2002A-YMC-JP does not, then it almost certainly has to be an error in wiring (perhaps 90% chance) or an incompatibility in the software initialization routines (10%).

The negative mode displays will be difficult to see without a backlight, so you may want to get that going first. The backlight on the CFAH2002A-YMC-JP does not have a dropping resistor built in, so you will need to add a dropping resistor to make sure you do not force too much current through the LEDs. The nominal backlight current for your module is 210 mA (see page 20 of the datasheet), so the nominal dropping resistor for 5v would be 3.8 ohms (4.7 or 5 ohms would work fine). Here is a thread that covers the backlight current and dropping resistor selection:

https://forum.crystalfontz.com/showthread.php?threadid=62

The positive (A = Anode) terminal of the backlight is pin 15, the negative (K = Cathode) terminal is pin 16.

For the pinouts, please check that you are looking at the diagram on the data sheet page 8. If a single pin is not connected properly, then the display will not initialize. Make sure tou are counting the pins in the correct (zig-zag) fashion and make sure that you are looking at the board from the correct side compared to the drawing.

For the contrast, most of these modules are coming in at around Vo = 1v (Vlcd = 4v). Ground (Vo = 0v, Vlcd = 5v) may make them too dark. If you connect a 5k or 10K pot between +5v and ground, with the wiper connected to Vo, and then adjust Vo to +1v that would be a good starting place.

The next thing to look at would be the software. If your software uses fixed delays instead of reading the busy bit, then it may be that the "super-cheap" display has just enough time and the CFAH2002A-YMC-JP does not. For debugging, you might try putting a 4mS delay between every step of the initialization routine, and ignore the busy bit.

The data sheet shows the initialization sequence on page 16.

Here is a typical initialization routine:

Code:
//===========================================
void LCD_Initialize(void)
  {
  //This sequence is from the initialization on page 45 of the
  //[URL=http://www.crystalfontz.com/backlight/eHD44780U.pdf]HD44780U Data Sheet[/URL].
  DelayMs(20);
  //Blind_Write_LCD_Control writes without checking the busy bit first.
  Blind_Write_LCD_Control(0x30);
  //Yes, the data sheet says write it twice.
  DelayMs(5);
  Blind_Write_LCD_Control(0x30);
  //Yes, the data sheet says write it three times.
  DelayUs(125);
  Blind_Write_LCD_Control(0x30);
  //Yes, the data sheet says write it four times, but at least this one counts.
  //038h is Function set:
  //8bit,
  //2 line
  //F = (5x8)
  DelayUs(125);
  Blind_Write_LCD_Control(0x38);
  //"Display off"
  Write_LCD_Control(0x08);
  //"Display clear"
  Write_LCD_Control(0x01);
  //This delay is needed  for the Sitronix ST7066 controller. No reasonable
  //explanation, I found it empirically. Not needed for Samsung or
  //Hitachi controllers.
  DelayMs(2);
  //Write_LCD_Control waits for the busy bit to go low, then writes the to the control register.
  //006h is Entry mode set, increment, no shift
  Write_LCD_Control(0x06);
  //Display on, cursor on, blinking
  Write_LCD_Control(0x0F);
  //Clear the display again. This seems to fix a power-up problem
  //where the display shows "{{{{{" in a couple of places.
  Write_LCD_Control(0x01);
  }
//===========================================
Please give this a shot and let us know what you find.
 

psylence

New member
Wow, thanks for a huge reply :) In writing my routines for the HD44780, I optimized it to pretty small delays, so I'll up those a bit to see if I just need to give this screen more time... Plus I'm pretty certain of the wiring, I'm useing a 16 conductor ribbon cable w/a red pin1 wire so I can't switch it around but I'll trace each one just to make sure...
 

psylence

New member
Grr, that extra 0x30 did it... Popped right up :) I guess that's what I get for optimizing on the HD44780 and expecting it to work on a "compatible" :)

Code:
LCD_INITIALIZATION				; setup the LCD for us...
  bcf LCD_RS					; LCD command mode
  bcf LCD_RW					; LCD write mode
  bcf LCD_E					; LCD strobe low
  DELAY_MILLI 20				; 15ms wait from startup
  LCD_COMMAND 0x30				; 8-bit, 2-line, fontset
  DELAY_MILLI 5					; 5ms delay
  LCD_COMMAND 0x30				; 8-bit, 2-line, fontset
  DELAY_MICRO 125				; 110us delay
  LCD_COMMAND 0x30				; 8-bit, 2-line, fontset
  DELAY_MICRO 125				; 110us delay
  LCD_COMMAND 0x38				; 8-bit, 2-line, fontset
  DELAY_MILLI 5					; wait a tick
  LCD_COMMAND 0x0C				; no cursor, no blink
  DELAY_MILLI 5					; wait a tick
  LCD_COMMAND 0x06				; auto-increment cursor
  DELAY_MILLI 5					; wait a tick... :D
  LCD_CLEAR					; clear it out
  call LCD_SPLASH				; display the splash screen
  LCD_CLEAR					; done
  call UPDATE_DISPLAY				; update the display to start
In case it ever helps anyone...

One more thing now, there's like, streaky little lines on it now, ghosting almost if this were a monitor, they change w/the text. And there are a few pixels that refuse to light... I've varied contrast and backlight, not sure what the deal is...

Now I just tried increasing my "per-letter" delay, and that didn't seem to help either, it seems like there are pixels out. :/
 

psylence

New member
Yeah there is definately something wrong with this, there are semi lit, and lit pixels all over, along w/my text. And some of the pixels in the text won't light, and there are streaky lines all over :(

On the good side, there's a small block of pixels all working correctly and it looks REALLY nice so I look forward to seeing it complete :)

Should I go for an RMA?
 
Top