I have problems to use my tft screen 2.4 - ILI9342, help me please !

As I explain in my fist post, all sketch I tried during 7 nigths and days before writing here, using ILI9341, give me problems : blank or mirored text/picture and/or reversed color AND split screen and lose "information", exactly like my video with your graphictest. Permute H W and.or rotate is not good.

I think it is necessary to add in a file configuration some specifics corrections, but I am newbies and maybe I am wrong

switch (ID) {
case 0x7783:
break;
case 0x0139:
break;
case 0x0154:
break;
case 0x1289:
break;
case 0x5420:
break;
case 0x7793:
break;
.../...
case 0x9341:
break;
case 0x9342:
break;
.../...
default:
break;
}

I would appreciate proper answers to my questions in #7.

Either post another video or say whether everything is correct or not.

As I said earlier, your 320x240 display will run any programs written for 240x320 or 320x240. Just set the appropriate rotation.

Likewise, any Touch program can rotate the display but the Touch signals will always return values according to the fixed physical geometry.

It is exactly the same for other screen owners. Some Touch panels are wired X,Y and some are wired Y,X. Some use different pins.

You map the Touch data to your logical screen coordinates. The main program logic is unchanged for any controller.

If there is a shop on Ebay selling ILI9342 displays, there will be other owners that want to use them. Your cooperation would benefit others.

David.

Hello David,

If you have enought time, can you contact some chiness vendor to know witch 2'4 screen they sold ...

This is just an example :

http://www.aliexpress.com/item/Elecrow-2-4-inch-TFT-Touch-Shield-for-Arduino-UNO-328-Mega-With-micro-SD-Card/32516085314.html

I asked vendor if is it ILI9341 or 9342 and the answer is :Barak colin
2017-05-02 21:24

So sorry dear, we only have the kind of ILI9342 in store.

padouet:
Hello David,

If you have enought time, can you contact some chiness vendor to know witch 2'4 screen they sold ...

This is just an example :

http://www.aliexpress.com/item/Elecrow-2-4-inch-TFT-Touch-Shield-for-Arduino-UNO-328-Mega-With-micro-SD-Card/32516085314.html

I asked vendor if is it ILI9341 or 9342 and the answer is :
Barak colin
2017-05-02 21:24

So sorry dear, we only have the kind of ILI9342 in store.

Hi padouet, Hi David

A link is always helpful! Thank you.

It looks like I have the same display. But mine identifies itself as ILI9325.

I runs with my GxTFT library.

// e.g https://www.aliexpress.com/item/ForArduino-UNO-2-4-inch-TFT-touch-screen-supporting-For-UNO-R3/1949318944.html

#include "../GxIO/GxIO_UNO_P8_SHIELD/GxIO_UNO_P8_SHIELD.h"
//#include "../GxCTRL/GxCTRL_ILI9325C/GxCTRL_ILI9325C.h" // 240x320
#include "../GxCTRL/GxCTRL_ILI9325D/GxCTRL_ILI9325D.h" // 240x320
GxIO_Class io; // #define GxIO_Class is in the selected header file
GxCTRL_Class controller(io); // #define GxCTRL_Class is in the selected header file
TFT_Class tft(io, controller, 240, 320); // portrait 240x320
//TFT_Class tft(io, controller, 320, 240); // landscape 240x320

Jean-Marc Zingg

When you buy something from Ebay or AliExpress, it is a lottery.

You do not know what controller is on the board until you receive the item.
The Chinese Vendors do not know what they are selling. Most of them sell lingerie and toys.

Your link shows "Elecrow" which is actually an electronics company and not a Lingerie shop (as far as I know).

I would expect someone at Elecrow to know what controller was mounted on a board that they had assembled.
It is unlikely that the Sales person that answers your email would bother to ask her more knowledgeable colleague.

It is even less likely that anyone would reply to me. I am not the customer.

All the same. Your display should work 100%. It does not make any difference which controller is mounted when you use my library for most projects. That is the intention and purpose of my library.

I spent some time and effort to add begin() code for ILI9342.
I would appreciate answers to my questions in #7.
Then I can add the code to the official Library Release for the benefit of other users.

David.

@Jean-Marc,

You know perfectly well that ILI9325 has ID in reg(0x00) and ILI9342 has ID in reg(0xD3)

There is no way that you can confuse the two devices. They use completely different set of command registers. So it is not possible to operate with the wrong commands.

On the other hand, MIPI-compliant controllers use a standard set of User registers and can generally start up without any configuration of the Manufacturer registers. So you can often run with a different controller.

As you have seen in #7, I simply offer initialisation sequences for three panels from the official ILI9342 App Note. I have no idea which panel is on the Elecrow shield. It may even be from another TFT panel manufacturer. (the Ilitek app note is dated 18 September 2010)

David.

@David

I am still learning, you know. But my 2.4" display really looks the same.

So there is a good chance, other users will also happen to get one of these, the one of the OP, mine, or others.

I wondered, how I knew that mine is ILI9325 in the first place, but the answer is simple:

I tried it with unmodified MCUFRIEND_kbv, and it worked!

I did not try the touch function, did not need to yet, and my fingers are not small enough.

Thank you, David

Jean-Marc

All Red 2.4" shields look much the same. Likewise the Blue 2.8" shields.

The MCUFRIEND_kbv library readID() is not always perfect when identifying controllers.
If in doubt, the LCD_ID_readreg sketch gives better clues.

Regarding your knowledge. You already know how to drive different controllers.

If you do have the same shield as padouet, please try my code from #7.
Since you understand libraries, the edit and tests would take you about 5 minutes.

I could then add the "best" sequence to an official v2.9.6 Release. Job done in a few minutes.

David.

david_prentice:
All Red 2.4" shields look much the same. Likewise the Blue 2.8" shields.

...

If you do have the same shield as padouet, please try my code from #7.
Since you understand libraries, the edit and tests would take you about 5 minutes.

I could then add the "best" sequence to an official v2.9.6 Release. Job done in a few minutes.

David.

David,

I would do this for you, but I now understand that I have a different controller.
Mine has 9325 in register 0 and zero in D3.
I should have consulted post #7 first, but jumped on the link of the OPs display, as I always do.

Jean-Marc

The link shows 16 sales. Many of them to Europe. So I will expect some proud owners to come here for help.

David.

I book this under "learning".

I don't really like these small displays, unless they are OLED.
But I have only one ILI9341 display, the one with parallel 16bit connector for STM32.

So, in 2 to 3 weeks maybe I can play and "learn" with ILI9342. Lets see.

Jean-Marc

But 9342 is only a "landscape" version of the 9341

There is nothing new to learn. Except that hardware scroll works in the "short" direction.

David.

david_prentice:
I would appreciate answers to my questions in #7.

David.

table8_ads = ILI9342_regValues_CPT24, table_size = sizeof(ILI9342_regValues_CPT24); //
// table8_ads = ILI9342_regValues_Tianma23, table_size = sizeof(ILI9342_regValues_Tianma23); //
// table8_ads = ILI9342_regValues_HSD23, table_size = sizeof(ILI9342_regValues_HSD23); //

I have not realy a better result vith graphictest_kbv.ino, maybe later with other graphical shield.

For each I think I have down line white bigger than top line and left or right line white are visible only after scrolling. But I have no reference to compare my screen to an allright screen.

david_prentice:
But 9342 is only a "landscape" version of the 9341

David.

If 9342 was that, I had no problem with mine about text mirored and color inversed.

Is it possible to dim the intensity of the background LED ?

Ok, so the screen looks ok whichever table is used.

I have changed the example Calibration sketch:

Touchscreen_Calibr_kbv.ino is attached.

Please try it and tell me if it helps you. It diagnoses the Touchpins and reports the Wiring and calibration values.

Yes, it refers to Portrait as "vertical scroll direction". I am not sure how to word things for your "hardware landscape" controller.

David.

Edit. Updated the attached sketch.

TouchScreen_Calibr_kbv.ino (13.2 KB)

I try TouchScreen_Calibr_kbv.ino and table serial say :
TouchScreen.h Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A1, D7) = 31
Testing : (A2, D6) = 30
Diagnosing as:-
YP,YM: (A1, D7) = 31
XM,XP: (A2, D6) = 30

Screen is vertical, usb top (blue in my video), first line background red, all text white, but no action, I can not continue.

Your pins look normal. I would expect ~25 in the X direction.

You should see a Red Title bar on the TFT with instructions in White.

Tap the screen to continue

This should then show the crosshairs.

I get this on Serial with a NT35310 screen (320x480):

TouchScreen.h Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A1, D7) = 35
Testing : (A2, D6) = 25
Diagnosing as:-
YP,YM:  (A1, D7) = 35
XM,XP:  (A2, D6) = 25

and this on an ILI9320 screen (240x320):

TouchScreen.h Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A2, D8) = 23
Testing : (A3, D9) = 34
Diagnosing as:-
XM,XP:  (A2, D8) = 23
YP,YM:  (A3, D9) = 34

David.

Now I have 2 TouchScreen_Calibr_kbv.ino, one in MCUFRIEND_kbv-master and this to download. One is vertical, the other horizontal.

For each I have not crosshairs. Nothing append after "Tap the screen to continue".

I try with Touch_shield_kbv.ino from MCUFRIEND_kbv-master and stilus is detected (wrong direction).

Well yes, this is intended to be an improvement on the example. If users find it helpful, I will replace the current library example with this version.

The Touch_shield_kbv.ino uses exactly the same TouchScreen.h library.
What version does the Library Manager report?

If you find that Touch_shield_kbv "works", please report back with the values you see for LEFT, RT, TOP, BOT when you touch the edges of the screen.

David.

Touch_shield_kbv.ino show me in landscape :
Found unknown LCD
ID=0x9042
calibration is:
LEFT = 920 RT = 150
TOP = 940 BOT = 120

Wiring is: PORTRAIT
YP=15 XM=16
YM=7 XP=6

EXIT

Touche screen for loc
tp.x=162 tp.y=160
tp.x=167 tp.y=939
tp.x=877 tp.y=944
tp.x = 883 tp.y=162

order of touch, 1 is corner up/left of F in "Found unknown LCD"
1 2
EXIT
4 3