The old TFT display mirroed problem...

Hello David_Pretince, I am back with the old TFT display mirroed problem...
I am testing one Arduino Mega 328 shield, 8 bits, TFT 3.95", with ILI9488 controller (3.95"/4.0" inch 320*480 ST7796S TFT Color LCD Display Module Screen with Touch Panel For Arduino UNO Mega2560 8/16 Bit|LCD Modules| - AliExpress) under Arduino IDE 1.8.9 and mcufriend_kbv 2.98. No invalid libraries reported during compilation. Since the readID() returns always 0xD3D3, I have forced the ID to 0x9488 using the command begin(0x9488). Under this circunstances:

setRotatin(0) results in a portrait mirroed image
setRotatin(1) results in a landscape regular image (not mirroed)
setRotatin(2) results in a portrait regular image (not mirroed)
setRotatin(3) results in a landscape mirroed image, same as setRotation(0)

It seams that the 180 and 270 degress display does not exist !!!

Any idea about what is happenning ? Thanks

You have a MEGA2560 Shield which is write-only.

The pcb design is wrong. The LCD_RD pin does not go to RD.
The buffer chips are wrong too.

Anyway, I have one of these shields. It contains an ILI9486. You must force tft.begin(0x9486);

My rotations are correct (at least on the Beta)
I will plug it into a MEGA2560 and run the v2.9.8 Release.

The Ali link says ILI9488/ST7796S. I suspect it is actually ILI9486.
Please can you run the graphictest_kbv sketch with 0x9486 (and with 0x9488, 0x6814, 0x7796)

Note the rotations and scroll directions. Portrait should be with the 18x2 header at the top. Portrait_Rev has 18x2 at the bottom.

David.

Edit. I wish I could understand AliExpress links. I see it in Dutch. I suspect you saw it in Italian. I would like to see it in English.
I can't see any way to change the language. (I am using Firefox)

Great !!! It works with 6814 forced controller type... Thank you so much

What does your pcb look like?
i.e. U1, U2, U3, U4, U5, U6 8/16bit 3.95 inch
or U1, U2, U4, U5, U6 8bit 3.8/3.95 inch

It looks as if Surenoo are as mendacious as Mcufriend.

David.

It is exactly like this: 3.8inch Arduino Display-Mega2560 - LCD wiki (image attached).
Forcing tft.begin(0x6814) makes the display to be ok, but I could not make the touch screen works yet. Do you know if there is some secret involved with ? Thanks again…

The Touch Controller is on 50-53. Install XPT2046_Touchscreen library via the IDE Library Manager.

SD_CS = 48 for the SD card
TP_CS = 53 for the XPT2046

David.

david_prentice:
The Touch Controller is on 50-53. Install XPT2046_Touchscreen library via the IDE Library Manager.

SD_CS = 48 for the SD card
TP_CS = 53 for the XPT2046

David.

David, have you seen error like this : no matching function for call to ‘XPT2046_Touchscreen::XPT2046_Touchscreen(, )’ ?

I am using the last version of all libraries and IDE…

Too many mysteries !!! Any idea ?

Quote your library version(s)
Quote which library example sketch.

I get fed up with repeating the same advice.
I don't know how or what to replicate your problem.

David.

david_prentice:
Quote your library version(s)
Quote which library example sketch.

I get fed up with repeating the same advice.
I don’t know how or what to replicate your problem.

David.

Apologize If I asked a question you have already answered… Please do not get nervous due to that !
The case is that an error issued in library example sounds strange. My XPT2046_Touchscreen is version 1.3.0. My IDE is version 1.8.9. The error is issued during TouchTestIRQ (one of library examples) is:

C:\Users\Antonio Testa\Documents\Arduino\libraries\XPT2046_Touchscreen/XPT2046_Touchscreen.h:42:7: note: candidate expects 1 argument, 2 provided
exit status 1
no matching function for call to ‘XPT2046_Touchscreen::XPT2046_Touchscreen(int, int)’

This error reffers to line XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN); in the example…

I upgraded my XPT2046_Touchscreen from v1.2.0 to v1.3.0

I edited TouchTestIRQ.ino for CS_PIN=53, TIRQ_PIN=44 and built for MEGA2560.

Using library XPT2046_Touchscreen at version 1.3 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\XPT2046_Touchscreen 
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.9\hardware\arduino\avr\libraries\SPI 
"C:\\Program Files (x86)\\Arduino-1.8.9\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\DAVIDP~1\\AppData\\Local\\Temp\\arduino_build_880323/TouchTestIRQ.ino.elf"
Sketch uses 4812 bytes (1%) of program storage space. Maximum is 253952 bytes.
Global variables use 247 bytes (3%) of dynamic memory, leaving 7945 bytes for local variables. Maximum is 8192 bytes.

It built ok. But it did not work. TIRQ_PIN needs to be a hardware INTn pin

So I edited TouchTest.ino for CS_PIN=53, TIRQ_PIN=255 and built for MEGA2560. i.e. ignore the IRQ pin

Using library XPT2046_Touchscreen at version 1.3 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\XPT2046_Touchscreen 
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.9\hardware\arduino\avr\libraries\SPI 
"C:\\Program Files (x86)\\Arduino-1.8.9\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\DAVIDP~1\\AppData\\Local\\Temp\\arduino_build_656222/TouchTest.ino.elf"
Sketch uses 4816 bytes (1%) of program storage space. Maximum is 253952 bytes.
Global variables use 247 bytes (3%) of dynamic memory, leaving 7945 bytes for local variables. Maximum is 8192 bytes.

It built ok. It worked ok.

David.

Everyting is working now. Thank you again !