Mirror-inverted and wrong-colored display

I'm trying to address a (cheap chinese) ILI9320-driven 320x240 LCD display from an Arduino Mega 1280. I've got it to work via the UTFT library. Well, not fully; something is shown, but the colors seem a bit faded and wrong, and the display seems to be mirror-inverted (the letters printed on the screen by the example programs from UTFT library at least are).

Supposedly this is the documentation of the display I'm having. I'm running it from an Arduino Mega 1280, the example given on the documentation page is for the Mega 2560; could that be the reason for my problems? I connected all the pins (RST, RS, WR (actually called RW on my display board), RO, and DB0-DB7 according to the above documentation:

RS -> D38
WR -> D39
CS(pin6) -> D40
RSET-> D41
RD -> 3.3V
DB0->DB7 to D22->D29


Double-checked all these connections so they should be connected where the docs say they should.

I first had 5V and Gnd also connected; but since the above pin mapping doesn't mention them at all, I tried without them, and noticed they weren't needed - the display also shows something without them connected, although disconnecting Gnd makes the image a little darker. Could I have blown the screen circuits somehow by that? Should I connect 5V?

Here are some example images of how it looks like:

From the demo program (Bitmap from UTFT): Supposed to be properly colored Tux'es and happy faces in various sizes I guess:

Supposed to be a red rectangle with the text "Hello World" across, shown via the same method as in the "Bitmap" demo program from UTFT):

Any ideas what I'm doing wrong here?

Something I forgot to mention in the start (but which might be very important!): In the example code, I tried to use myGLCD(ILI9320,38,39,40,41) for initialization as mentioned in the documentation, but ILI9320 does not seem to be defined in the version of UTFT I'm using (and also isn't mentioned anywhere in the comments in UTFT.h, only ILI9325D), so I tried ITDB24D; I played around with the possible value there a little but haven't tried all possible values, maybe I just haven't found the right one yet? Anybody knows what the proper value to use is, or where ILI9320 is defined?

• Why did you decide that 5V (actually should be 3.3V) and Gnd "weren't needed"? How is the display receiving power? Is the backlight lit up? – Dave Tweed Oct 15 '12 at 22:06
• It lights up fine without Gnd and 5V connected, although with Gnd connected it gets a little brighter it seems; the power for the display actually seems to go over the RD pin, which is connected to 3.3V according to the documentation linked to in my question. The board also has a touch panel and an SD card slot, so the 5V line might be needed only for these... however, the display also does light up (white) with only 5v and Gnd (and no data lines) connected... – codeling Oct 15 '12 at 22:17
• Oh and I decided to try without 5V and Gnd because they weren't mentioned in the documentation I was using – codeling Oct 15 '12 at 22:30
• Looking at the differences between the two boards the pins seem to go to similar hardware functions. You did this declaration from the docs right? myGLCD(ILI9320,38,39,40,41) Do you have a scope, if so can you probe all those data lines and make sure they're toggling. – Some Hardware Guy Oct 15 '12 at 23:56
• oh, should've mentioned that all along: I'm not calling myGLCD(ILI9320,38,39,40,41) exactly since ILI9320 does not seem to be defined in the utft version I'm using; I tried a few other constants instead, though, and not much seems to change. – codeling Oct 16 '12 at 6:41

Assuming that your wiring is correct: have you tried to enter myGLCD(GEEE24,38,39,40,41) ? This is for the ILI9320 controllers. It's writtien in the PDF in the UTFT folder. I tried the same module and for me the image just turned out to be mirrored with a lot of flickering (but with proper image quality) until I found out that defining the controller as ITDB24D solved all problems at once. Therefore the controller inside (in my module at least, as the vendor stated) really seems to be an ILI9325...confusing, but my module is working now (with a mega2560 and 5V supplied). I only had to calibrate the touch screen.

• turns out myGLCD(GEEE24, 38, 39, 40, 41) was indeed all it took to fix the problem, now it's working perfectly – codeling Jan 16 '14 at 21:55

Based on your clarifying comments, it sounds like you're managing to power the display through its protection diodes. It's really remarkable that it's working as well as it is, under the circumstances.

You need to hook Vcc on the display to 3.3V and Gnd to ground in order to make sure that all the logic on the display's controller is getting the correct voltage at sufficient current.

• There is no Vcc pin on the display, just the 5V one... I now tried to connect that to 3.3v, and I have connected Gnd to ground now anyway - but connecting the 5v pin changes not much - except that the display is bright white when there's no input, in contrast to dark :( – codeling Oct 16 '12 at 20:22

You should use ITDB24 no D. Also use memorysaver.h and uncomment all the display types that you are not using to reduce the library overhead.

If you are using the default rotation you should still declare it in your code. This fixed the problem for me. There's a little video demonstration here at the end: