Go Down

Topic: mirror display (Read 988 times) previous topic - next topic

Noosha

 :( 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

https://www.instructables.com/id/How-to-use-24inch-TFT-LCD-SPFD5408-with-arduino-ME/

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

Many thanks to all.


david_prentice

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.

Noosha


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 !!!



david_prentice

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.



sbharsha

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.

david_prentice

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.

jorgenv

Hello

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

Code: [Select]
tft.readID() finds: ID = 0x5408

Output of LCD_ID_readreg:
Code: [Select]
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.

david_prentice

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.

jorgenv

Checked library manager but I already have version 2.9.7 installed.

david_prentice

#9
Sep 26, 2017, 09:28 pm Last Edit: Sep 26, 2017, 09:36 pm by david_prentice
Edit MCUFRIEND_kbv.cpp to remove the INVERT_GS attribute:

Code: [Select]

    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.

jorgenv

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.

goldiee36

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!

david_prentice

#12
Oct 11, 2017, 02:46 pm Last Edit: Oct 11, 2017, 02:49 pm by david_prentice
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.

goldiee36

#13
Oct 11, 2017, 10:15 pm Last Edit: Oct 11, 2017, 10:21 pm by goldiee36
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.

david_prentice

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.

Go Up