mirror display

:frowning: HI GUYS
I bought 2.4" TFT LCD Shield Touch Panel Display for Arduino

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=400563532954&ssPageName=ADME:X:RTQ:US:1123

I use folloing example with arduino Mega

but i have a problem with it all leters or numbers are display in "mirror effect"
could you help please ??

Many thanks to all.

You have a regular 2.4" Red Mcufriend Shield.

Run the LCD_ID_readreg sketch from my MCUFRIEND_kbv library.
This will identify the actual controller mounted on your display.

Run the graphictest_kbv sketch from the examples. The Serial Terminal reports the ID
Make notes of any mirroring, wrong colours etc.

Then post a message with this information.
I am 99.9% confident that I can get it working

David.

i have load the LCD_ID_readreg sketch from my MCUFRIEND_kbv library.
the following data appeare on serial moniter

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 93 35 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 00 00 00 Status Register
reg(0x000A) 00 00 Get Powsr Mode
reg(0x000C) 00 00 Get Pixel Format
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 00 Inversion Control
reg(0x00B6) 00 00 00 00 00 Display Control
reg(0x00B7) 00 00 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 00 00 00 00 00 00 00 00 Panel Control
reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 00 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 00 00 00 00 00 NVM Read
reg(0x00D3) 00 00 00 00 ILI9341, ILI9488
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3
reg(0x00E0) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA-P
reg(0x00E1) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA-N
reg(0x00EF) 00 00 00 00 00 00 ILI9327
reg(0x00F2) 00 00 00 00 00 00 00 00 00 00 00 00 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

but the graphictest_kbv sketch donot uploaded !!!

You have an Ilitek ILI9335.

It should work fine with MCUFRIEND_kbv
Your IDE should be v1.6.5 or newer. Currently, the IDE is v1.8.2

Since you are using a MEGA2560, you have plenty of memory.

David.

Dear David,

Am also facing the similar issue. The LCD display in mirror image for anything.

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 54 08 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) C4 C4 C4 C4 Manufacturer ID
reg(0x0009) C9 C9 C9 C9 C9 Status Register
reg(0x000A) CA CA Get Power Mode
reg(0x000C) CC CC Get Pixel Format
reg(0x0061) E1 E1 RDID1 HX8347-G
reg(0x0062) E2 E2 RDID2 HX8347-G
reg(0x0063) E3 E3 RDID3 HX8347-G
reg(0x0064) E4 E4 RDID1 HX8347-A
reg(0x0065) E5 E5 RDID2 HX8347-A
reg(0x0066) E6 E6 RDID3 HX8347-A
reg(0x0067) E7 E7 RDID Himax HX8347-A
reg(0x0070) F0 F0 Panel Himax HX8347-A
reg(0x00A1) E1 E1 E1 E1 E1 RD_DDB SSD1963
reg(0x00B0) F0 F0 RGB Interface Signal Control
reg(0x00B4) F4 F4 Inversion Control
reg(0x00B6) F6 F6 F6 F6 F6 Display Control
reg(0x00B7) F7 F7 Entry Mode Set
reg(0x00BF) FF FF FF FF FF FF ILI9481, HX8357-B
reg(0x00C0) C0 C0 C0 C0 C0 C0 C0 C0 C0 Panel Control
reg(0x00C8) C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 GAMMA
reg(0x00CC) CC CC Panel Control
reg(0x00D0) D0 D0 D0 Power Control
reg(0x00D2) D2 D2 D2 D2 D2 NVM Read
reg(0x00D3) D3 D3 D3 D3 ILI9341, ILI9488
reg(0x00D4) D4 D4 D4 D4 Novatek ID
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) DC DC RDID3
reg(0x00E0) E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 GAMMA-P
reg(0x00E1) E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 GAMMA-N
reg(0x00EF) EF EF EF EF EF EF ILI9327
reg(0x00F2) F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 Adjust Control 2
reg(0x00F6) F6 F6 F6 F6 Interface Control

I tried all with diffirent libraries but unable to fix this reverse display. please let me know if you can re-direct me to correct library.

Currently i am using the MCUFRIEND_kbv Library.

The Portrait, landscape all works fine, including scrolling. Only issue is the display i mirrored. I tested with Aruduino UNO and MEga both similar issue with both the boards.

Woo-hoo. You have a genuine SPFD5408 controller !!

Please install/update MCUFRIEND_kbv via the Library Manager. Current version is v2.9.6
Run graphictest_kbv.ino from the Examples.

Please post a photo of the "Adafruit Tests Report" screen with the Shield mounted on your Arduino. i.e. where it displays the version, timings, ID, ...
Or make a YouTube video if you can. And post the link.

I have never owned or seen a real SPFD5408. I have to rely on User feedback.
It should be easy to fix. Especially if I can see the photo/video.

David.

Hello

I have the same SPFD5408 controller and also text is mirrored.

tft.readID() finds: ID = 0x5408

Output of LCD_ID_readreg:

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 54 08	ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) C4 C4 C4 C4	Manufacturer ID
reg(0x0009) C9 C9 C9 C9 C9	Status Register
reg(0x000A) CA CA	Get Power Mode
reg(0x000C) CC CC	Get Pixel Format
reg(0x0061) E1 E1	RDID1 HX8347-G
reg(0x0062) E2 E2	RDID2 HX8347-G
reg(0x0063) E3 E3	RDID3 HX8347-G
reg(0x0064) E4 E4	RDID1 HX8347-A
reg(0x0065) E5 E5	RDID2 HX8347-A
reg(0x0066) E6 E6	RDID3 HX8347-A
reg(0x0067) E7 E7	RDID Himax HX8347-A
reg(0x0070) F0 F0	Panel Himax HX8347-A
reg(0x00A1) E1 E1 E1 E1 E1	RD_DDB SSD1963
reg(0x00B0) F0 F0	RGB Interface Signal Control
reg(0x00B4) F4 F4	Inversion Control
reg(0x00B6) F6 F6 F6 F6 F6	Display Control
reg(0x00B7) F7 F7	Entry Mode Set
reg(0x00BF) FF FF FF FF FF FF	ILI9481, HX8357-B
reg(0x00C0) C0 C0 C0 C0 C0 C0 C0 C0 C0	Panel Control
reg(0x00C8) C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8	GAMMA
reg(0x00CC) CC CC	Panel Control
reg(0x00D0) D0 D0 D0	Power Control
reg(0x00D2) D2 D2 D2 D2 D2	NVM Read
reg(0x00D3) D3 D3 D3 D3	ILI9341, ILI9488
reg(0x00D4) D4 D4 D4 D4	Novatek ID
reg(0x00DA) 00 00	RDID1
reg(0x00DB) 00 00	RDID2
reg(0x00DC) DC DC	RDID3
reg(0x00E0) E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0	GAMMA-P
reg(0x00E1) E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1	GAMMA-N
reg(0x00EF) EF EF EF EF EF EF	ILI9327
reg(0x00F2) F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2	Adjust Control 2
reg(0x00F6) F6 F6 F6 F6	Interface Control

When running graphictest_kbv text looks like this:

Any help would be appreciated.

Go to the Library Manager. The current version is v2.9.7
Please Upgrade if necessary. Then report back.

As far as I know, the problem has been fixed. If not, it is easy to solve.

David.

Checked library manager but I already have version 2.9.7 installed.

Edit MCUFRIEND_kbv.cpp to remove the INVERT_GS attribute:

    case 0x5408:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR;
        goto common_9320;

Do you have a Red 2.4" or a Blue 2.8" Shield ?

It appears that the 0x5408 has had the INVERT_GS attribute since v2.9.3

It is a very uncommon controller. I would think that the owners would have complained before now.

David.

Edit. It looks as if this subect has come up before.

I was waiting to hear from other users before changing the code.

Thank you this fixed the problem.

I was reading other threads with similar problems but none worked before. Did not notice the thread you pointed out.

And I am using the red 2.4" shield.

Thanks for helping.

david_prentice:
I was waiting to hear from other users before changing the code.

Hi David,

I also bought a red 2.4 tft and I had to remove the INVERT_GS attribute as you wrote. Now it is not mirrored anymore!

Thanks for the feedback.

Please confirm that you have an ID = 0x5408. i.e. a genuine SPFD5408
The Beta library on GitHub has already implemented the change for 0x5408.
It will appear in the next official Release.

Your recent post in a different thread implies that you have an ILI9325 and are using Adafruit_TFTLCD

David.

Yeah, i was trying several libraries.. it looks like a 5408 contoller.
I'll try the beta library

this is the output of the LCD_ID_readreg:

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 54 08 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) C4 C4 C4 C4 Manufacturer ID
reg(0x0009) C9 C9 C9 C9 C9 Status Register
reg(0x000A) CA CA Get Power Mode
reg(0x000C) CC CC Get Pixel Format
reg(0x0061) E1 E1 RDID1 HX8347-G
reg(0x0062) E2 E2 RDID2 HX8347-G
reg(0x0063) E3 E3 RDID3 HX8347-G
reg(0x0064) E4 E4 RDID1 HX8347-A
reg(0x0065) E5 E5 RDID2 HX8347-A
reg(0x0066) E6 E6 RDID3 HX8347-A
reg(0x0067) E7 E7 RDID Himax HX8347-A
reg(0x0070) F0 F0 Panel Himax HX8347-A
reg(0x00A1) E1 E1 E1 E1 E1 RD_DDB SSD1963
reg(0x00B0) F0 F0 RGB Interface Signal Control
reg(0x00B4) F4 F4 Inversion Control
reg(0x00B6) F6 F6 F6 F6 F6 Display Control
reg(0x00B7) F7 F7 Entry Mode Set
reg(0x00BF) FF FF FF FF FF FF ILI9481, HX8357-B
reg(0x00C0) C0 C0 C0 C0 C0 C0 C0 C0 C0 Panel Control
reg(0x00C8) C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 GAMMA
reg(0x00CC) CC CC Panel Control
reg(0x00D0) D0 D0 D0 Power Control
reg(0x00D2) D2 D2 D2 D2 D2 NVM Read
reg(0x00D3) D3 D3 D3 D3 ILI9341, ILI9488
reg(0x00D4) D4 D4 D4 D4 Novatek ID
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) DC DC RDID3
reg(0x00E0) E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 GAMMA-P
reg(0x00E1) E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 GAMMA-N
reg(0x00EF) EF EF EF EF EF EF ILI9327
reg(0x00F2) F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 Adjust Control 2
reg(0x00F6) F6 F6 F6 F6 Interface Control

And this is the output of the Adafruit library:

TFT LCD test
Using Adafruit 2.8" TFT Breakout Board Pinout
TFT size is 240x320
Unknown LCD driver chip: 5408
If using the Adafruit 2.8" TFT Arduino shield, the line:
#define USE_ADAFRUIT_SHIELD_PINOUT
should appear in the library header (Adafruit_TFT.h).
If using the breakout board, it should NOT be #defined!
Also if using the breakout, double-check that all wiring
matches the tutorial.

The SPFD5408 behaves much like an ILI9320.

The ID reads ok. But the other registers seem to be write-only on the SPFD5408.
With an ILI9320 you can read all the registers.

David.

Hi,

what are the effects of these write-only registers? What kind of things I cannot do with the display?

Thanks
Adam

No problems at all. It can read the ID. It can read the GRAM memory.

On the ILI9320 you can write to most control registers and read them back.
You can check the default values. e.g. what the LCD_ID_readreg sketch does.

The library itself only needs to read the ID. Few people read registers or even read GRAM.

When you run the graphictest_kbv sketch, everything should work
e.g. Software Scroll. The yellow text should move across the screen in.
e.g. Hardware Scroll. The whole screen can vertically scroll.
Note that Band scroll always moves the whole screen on the ILI9320 class of controller.

Does your screen have crisp colours or do you see scan lines ?

David.

Hi,

the screen and colors looks OK, I cannot see black lines or such.

One more thing as you know these kind of displays very well, maybe you know the answer for this question by heart: which pins remain free to use on the Arduino, after the display shield is connected?
According to the seller: "8 bit digital interface, plus 4 control lines
Uses digital pins 5-13 and analog 0-3. That means you can use digital pins 2, 3 and analog 4 and 5. "

But it just does not seem right.
I know that the shield covers all of the pins, but I can solder a wire to it.

I need 2 interrupt pins (D2 and D3, but maybe I can use any digital pin for interrupt handling) and at least 1 but rather 3 any kind of pins (for digital output).

I want to save a few bucks by not using an Arduino Mega.

thx in advance
Adam

I needed to mirror my display so it could be viewed by reflection.

I did this by going into the display-specific library and commenting out one of the axis flippers in the code that allows you to rotate the display. Go to the code that allows you to rotate what is displayed 180 degrees, comment out either the x or y section (whichever one is mirrored for you). Then put the command to rotate the display in your sketch.

This allowed me to mirror the display, but if yours is already mirrored it will probably fix your problem.

Hope this helps.