3.5" IPS 480x320 touch display ILI9481 FLIP issue

Hello,
I bought this display: https://www.aliexpress.com/item/1005001288389898.html?spm=a2g0o.9042311.0.0.27424c4d1xBeo9
At first I had a lot of issues with initializing (inverted colors, vibrating/flickering picture). Now these are almost solved (some minor flickering on some complex colors, not sure about gamma, so on).

Now the biggest concern is flipped/mirrored text when in portrait mode... and cut/broken text when in landscape mode but turned 180 degree. Actually when text is flipped it is also cut/broken. As test I use popular graphicstest example with Adafruit_TFTLCD and Adafruit_GFX libraries.
The similar test example from MCUFRIEND_kbd with it's own libraries show correct picture, no flipping (althought inverse colors, but this is't an issue anymore).
There isn't any effect from any manipulations with register 0x36h.

I copied complete well working registry settings from MCUFRIEND to Adafruit_TFTLCD and... text is still flipped and cut/broken as before, nothing changed there. Copied vice versa and... MCUFRIEND runs good with my/Adafruit_TFTLCD registry settings.
If register settings change nothing where there reason hiddens?!

Here is my result from 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) 01 01 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 01 01 01 01 Manufacturer ID
reg(0x0009) 01 01 01 01 01 Status Register
reg(0x000A) 01 09 Get Powsr Mode
reg(0x000C) 01 65 Get Pixel Format
reg(0x0061) 01 01 RDID1 HX8347-G
reg(0x0062) 01 01 RDID2 HX8347-G
reg(0x0063) 01 01 RDID3 HX8347-G
reg(0x0064) 01 01 RDID1 HX8347-A
reg(0x0065) 01 01 RDID2 HX8347-A
reg(0x0066) 01 01 RDID3 HX8347-A
reg(0x0067) 01 01 RDID Himax HX8347-A
reg(0x0070) 01 01 Panel Himax HX8347-A
reg(0x00A1) 01 01 01 01 01 RD_DDB SSD1963
reg(0x00B0) 01 01 RGB Interface Signal Control
reg(0x00B4) 01 01 Inversion Control
reg(0x00B6) 01 01 01 01 01 Display Control
reg(0x00B7) 01 01 Entry Mode Set
reg(0x00BF) 01 01 05 95 81 FD ILI9481, HX8357-B
reg(0x00C0) 01 11 39 01 01 11 01 01 01 Panel Control
reg(0x00C8) 01 01 01 01 01 01 01 01 01 01 01 01 01 GAMMA
reg(0x00CC) 01 01 Panel Control
reg(0x00D0) 01 01 41 Power Control
reg(0x00D2) 01 01 21 01 01 NVM Read
reg(0x00D3) 01 01 21 01 ILI9341, ILI9488
reg(0x00DA) 01 01 RDID1
reg(0x00DB) 01 01 RDID2
reg(0x00DC) 01 01 RDID3
reg(0x00E0) 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 GAMMA-P
reg(0x00E1) 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 GAMMA-N
reg(0x00EF) 01 01 01 01 01 01 ILI9327
reg(0x00F2) 01 01 31 01 01 01 01 01 01 01 01 01 Adjust Control 2
reg(0x00F6) 01 81 81 81 Interface Control

I'm quit new to Arduino.

Thanks for the link. Although the Display looks like the regular Blue "Mcufriend-style" Shield it contains resistor-packs instead of 74HC245 buffer chips.

This means that the Touch screen will not work very well (if at all). And the read functions will not work properly.

A genuine ILI9481 would say:
reg(0x00BF) 00 02 04 94 81 FF Device Code Read

This means that tft.readID() will not return the correct ID and you will have to use tft.begin(0x9481)

I would expect colours and rotations to all work properly. Even though the resistor-packs are not as reliable as HC245 buffer chips.

David,

Do you think it is possible to get correct rotations (not flipping/mirroring/cutting/breaking) while fiddling with ILI9481 registers in Adafruit_TFTLCD library? Despite MCUFRIEND_kbd already works correctly with the same register values while Adafruit_TFTLCD not.
Or it is time waisting?

And maybe MCUFRIEND_kbd uses other methods than registers alone to display correctly?

P.S.: don't have plenty of time or willing to learn dozens of libraries for the same goal.

The genuine Adafruit_TFTLCD has never supported ILI9481.
There are many hacked versions that call themselves Adafruit_TFTLCD

Yes, it would be incredibly simple to add ILI9481 support.

Why do you want to use Adafruit_TFTLCD instead of MCUFRIEND_kbv ?

If you had an ILI9481 Mega2560 16-bit Shield I would advise using Bodmer's TFT_HX8357 library on Due or MEGA2560

But since you have a Uno 8-bit Shield you can just plug it into Uno, Leo, MEGA2560, Due, ... and it should just work.

David.

Simply, my consideration was to try something newer than old style alphanumeric or poor visual quality graphic display - 21'st century started already a long time ago, entry level smartphones uses decent displays, but hobbyists stuck with old style :slight_smile: . This shield perfectly fit for compact experimentation platform (without wires around), just click & play.
I started from Adafruit_TFTLCD library (name speaks). But maybe MCUFRIEND_kbv is better for such displays? Or any other?

After some experiments and practice with Arduino and 480x320 display I am thinking to try some decent display for STM32 Nucleo board. Maybe 800x480, 16M colors with capacitive touch. Are there any good library supporting both of these display types? As already wrote don't have plenty of time to learn dozens of libraries.