Manually Initializing a LCD (HD77840)

Ok.. I couldn't get my hitachi HD77840 LCD working with the 4bit code, and I'm a EE and just went back to trying to t-shoot my raw LCD hooked up to some TTL debounced switches so that I can 1) verify that the thing is working, 2) get a good understanding of what's going on behind the scenes of the arduino 4bit LCD code.. and 3) verify that I have the correct (good) contrast voltage on pin 3.

So.. I know that I have everything hooked up right (d0-d8 up to some debounced TTL switches, pins 4&5 in binary 0 0 for instruction mode and 1 0 for data write mode, pin 6 for my clock, 10k potfrom 5v/gnd going into pin 3, etc). But I'm manually initializing and still getting nada on the LCD. I've swept the entire contrast voltage rangee (0-5v) and close to 0v just get all dark blocks (as expected at that voltage), but never any real display.

Someone please look over my manual initialization and let me know if anythign looks off.. I've been looking at it too long myself now:

Hitachi Pinout and Hardware Initialization + Data
        Pins (clk) D0(LSB)                            D7(MSB)
        4  5  6  | 7    8    9    10 | 11   12   13   14
-----------------|----------------------------------------
Start / 0  0  +_ | 0    0    0    0  | 1    1    0    0            (30h) init. handshake
Init /  0  0  +_ | 0    0    0    0  | 1    1    0    0            (30h) ""
     \  0  0  +_ | 0    0    0    0  | 1    1    0    0            (30h) ""
8bit [  0  0  +_ | x    x    1    1  | 1    1    0    0            (3Ch) 8bit, 2line, lg char
Disp [  0  0  +_ | 0    0    0    1  | 0    0    0    0            (04h) Disp. off
Clear[  0  0  +_ | 1    0    0    0  | 0    0    0    0            (01h) Clear
Cursr[  0  0  +_ | 0    1    1    0  | 0    0    0    0            (06h) Set cursor to Inc.
Disp [  0  0  +_ | 0    0    0    1  | 0    0    0    0            (04h) Disp on, curs-blink
============================= Send "ABC" =====================================
"A"  [  1  0  +_ | 1    0    0    0  | 0    0    1    0            (41h) "A"= ASCII 65
"B"  [  1  0  +_ | 0    1    0    0  | 0    0    1    0            (42h) "B"= ASCII 66
"C"  [  1  0  +_ | 1    1    0    0  | 0    0    1    0            (43h) "C"= ASCII 67

(there's at least 1-2 seconds between each manual entry)

So I show it all in binary (and hex) so that I'm clear as to how I am setting things up and what I'm manually flipping (switch wise)... Does anything stand out to anyone as to what I'm doing wrong?

Tweeks

Hi tweeks,

try replacing the 3ch on this line with 38h
8bit [ 0 0 +_ | x x 1 1 | 1 1 0 0 (3Ch) 8bit, 2line, lg char

that should put it in 8bit 2 line mode with the normal 5x7 font
8bit [ 0 0 +_ | x x 1 1 | 1 0 0 0 (38h) 8bit, 2line, 5x7 char ← try this

I actually hadn't considered that maybe my module didn't HAVE the larger font capability.. I'll try that tonight.

Tweeks

Ahhhhhhhhhhh.. problem fixed.

But it wasn't the font size bit in the Init-length command (as suggested). After fiddling with it, knowing that I had everything right.. I just tried a couple of "stupid things".. like inverting my D0-D7 ribbon header. Well.. while that wasn't backwards.. it changed the signals I was sending and suddenly I started getting garbage on the LCD instead of nothing at all. Which.. is better than nothing.. but then it made me realize that I only had 8 TTL switches to use on my breadboard system.. and to use one of them as a clock.. I was hanging the 8th bit (D7) off the end of my switch header there and ignoring it. Well.. as any hardware engineer can tell you.. most digital ICs if not strapped down, "float high". Including inputs. So this meant that all commands and data that I had been sending the LCD had D7 high when I sent them. Not good. That was the root cause. So after I simply tied D7 low so it was no longer flapping in the wind, my commands were all received.. and it "woke up" (first try) and began acting like a good little HD77480. :)

Ahhh.. that's better!

Thanks for the sounding board. Gotta love it when you encounter and overcome your own case of PEBKAC! hehe.. I only hope that my strife helps someone else.

Now.. To hook it up and get it working with my ZIFduino. :)

Cheers...

Tweeks