From looking at the diag output, your schematic, and your
pin table (great information BTW).
I see a few things that look off.
It looks like there might be a misunderstanding of the Mega header.
The pins on the header are numbered/labeled like this:
Its hard to tell, but In the photo, it looks like you are using a 14 pin connector to plug into the
mega header and your connector is plugged in at the top
which is VCC and not pins 22 and 23.
From looking at your wiring table vs the diag output,
It looks like the RS/DI and RST/RESET wires are reversed.
and R/W and CS2 reversed.
If I look at your table it seems to indicate that you intended to wire it up like this:
But the library was configured like this:
Look at the diag output and you will see the pins that are configured
for each glcd function.
They don't seem to match up with the wiring table you showed.
The diag output is directly from the pins you assign in the config file file.
I think it should work once the header is aligned in the proper holes
(if it isn't already) and then when you fix the discrepancies between
RS/DI and RST/RESET
R/W and CS2
One other thing that I noted from the diag output.
(see the part about "Data mode"? It indicates bit i/o vs byte i/o)
While you can use any pins you want for any of the glcd functions.
if you assign the data lines all to the same AVR port such each glcd pin
is connected to the matching AVR port bit, then the library will us 8 bit accesses
to write the port.
So rather than having to do 8 individual bit set/clear operations per byte it can
set all bits at once which will increase the performance of the library.
With Arduino and its goofy pin numbering scheme of naked constants it is impossible
to know which pins to use to make this happen without going through some contortions.
If you want to see which pins to use, to make this happen,
you have to look at the pins_arduino.h file.
On Arduino 1.0 for a mega, that file is in hardware/arduino/variants/mega/pins_arduino.h
Then you will want to pick the arduino pin # to assign the glcd data bits to match up with the
AVR port bits.
So if you wanted to use AVR port A
then you would use 22 - 29 for data0 to data7
(This is what the supplied ks0108 pin file does for mega)
So for your 14 pin connector, to get 8 bit i/o to the glcd you would use
this configuration instead:
The data lines will need be assigned like this in order to get 8 bit i/o.
The control pins can be in any order, I just showed them
in the same order you used in your config file.