MCUFriend 480 x 320, 3.5" TFT with Touch screen.....

I bought one of these on Ebay about a year ago and after much fiddling, managed to get the display functions working using Adafruit libraries (as I think most do, at least to start!)
So I left it in the "bits" box, to cool my temper down......
Today I resurrected the part, and already it has got my blood boiling!!!!

The command
uint16_t identifier = tft.readID();
returns a zero rather than a chip I/D

I'd found a clue online that the ID I need is 0x9341 and that made some of the LCD functions work on the demo program, but not necessarily at the coordinates expected!

But later I tried the Touch test program "TTFPaint" which drew the colour bar on the lhs of the screen, but no touch facilities actually worked.

I'm inclined to bin the part and put MCUFriend on my "Below Minimum Acceptable Quality" manufacturers list in terms of Customer Orientation.... but - like most hobbyists I think - I don't like throwing good money away.

Is there a simple, working solution that fills in all of the gaps that MCUFriend seem to have built IN????

Although it's quite possible that you have a faulty touch screen it's just as likely there is something that needs to be changed in the sketch, Whats is tftpaint? It's not in the examples for the mcufriend library.

Adonis has chosen to use Adafruit_TFTLCD library which does not support many 320x480 controllers.

3.5 inch screens are generally 320x480. So it is unlikely to be ILI9341.

Install / Update MCUFRIEND_kbv and Adafruit_GFX via the IDE Library Manager.

Run the examples. If you have a problem, copy-paste any messages from the Serial Terminal.

David.

Oh yeah, didn't read the post properly, just assumed if he was using an mcufriend display he would using the mcufriend library.

david_prentice:
Adonis has chosen to use Adafruit_TFTLCD library which does not support many 320x480 controllers.

3.5 inch screens are generally 320x480. So it is unlikely to be ILI9341.

Install / Update MCUFRIEND_kbv and Adafruit_GFX via the IDE Library Manager.

Run the examples. If you have a problem, copy-paste any messages from the Serial Terminal.

David.

David, many many thanks for your fast analysis and advisory.
This is First Class and a credit to both yourself and this Forum!.

Following your advice, I loaded up the most likely "starter" MCUFriend example (diagnose_TFT_support) which immediately showed me that the controller ID that I'd been using (via UTube guidance) was WRONG!

My commendation on your polite, to-the-point advice that has already very obviously got me back on the rails!

Too often questions like my own are met with arrogant disdain, elsewhere, and completely ignore the fact that if I KNEW where the problem was, I wouldn't have asked the question in the first place!!!

I will now get back into FORWARD gear (!) and run through the examples towards the Touch control stuff too- which will hopefully help bridge the language barrier between Chinese suppliers and practicality.
Thanks again.

You are now promoted to Hero of The First Order!

[Why didn't I ask this question of the forum l-o-n-g ago????]

Go on. Which controller do you have?

David.

it detects 0x6814

That is Raydium RM68140. I don’t think that any other library supports this controller.

Re. the RM68140 Uno shield that I have. The backlight takes far too much current. The bottom of the screen is warm/hot to the touch.
Other RM68140 owners do not report high current.

Yes, Mcufriend boards are “badly designed” electrically.
But they are incredibly cheap.

David.

Here are printouts from Diagnose_TFT_support, followed by TouchScreen_Calibr_native:

Diagnose whether this controller is supported
There are FAQs in extras/mcufriend_how_to.txt

tft.readID() finds: ID = 0x6814

MCUFRIEND_kbv version: 2.9.8

PORTRAIT is 320 x 480

Run the examples/graphictest_kbv sketch
All colours, text, directions, rotations, scrolls
should work. If there is a problem, make notes on paper
Post accurate description of problem to Forum
Or post a link to a video (or photos)

I rely on good information from remote users

TouchScreen.h GFX 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) = 23
Testing : (A2, D6) = 33
Diagnosing as:-
XM,XP: (A1, D7) = 23
YP,YM: (A2, D6) = 33
ID = 0x6814

cx=381 cy=509 cz=172 LEFT, TOP, Pressure
cx=429 cy=654 cz=172 LEFT, MIDH, Pressure
cx=400 cy=738 cz=173 LEFT, BOT, Pressure
cx=479 cy=605 cz=172 MIDW, TOP, Pressure
cx=486 cy=732 cz=173 MIDW, BOT, Pressure
cx=557 cy=566 cz=172 RT, TOP, Pressure
cx=588 cy=638 cz=173 RT, MIDH, Pressure
cx=609 cy=754 cz=174 RT, BOT, Pressure
MCUFRIEND_kbv ID=0x6814 320 x 480

const int XP=7,XM=A1,YP=A2,YM=6; //320x480 ID=0x6814
const int TS_LEFT=396,TS_RT=590,TS_TOP=556,TS_BOT=744;
PORTRAIT CALIBRATION 320 x 480
x = map(p.x, LEFT=396, RT=590, 0, 320)
y = map(p.y, TOP=556, BOT=744, 0, 480)
Touch Pin Wiring XP=7 XM=A1 YP=A2 YM=6
LANDSCAPE CALIBRATION 480 x 320
x = map(p.y, LEFT=556, RT=744, 0, 480)
y = map(p.x, TOP=590, BOT=396, 0, 320)

Graphics test works fine, so then I tried Touch_shield_new....

I commented out the given lines for the ones above
const int XP=7,XM=A1,YP=A2,YM=6; //320x480 ID=0x6814
const int TS_LEFT=396,TS_RT=590,TS_TOP=556,TS_BOT=744;
(no problems)

I suspect that I need to also add in the lines,

x = map(p.y, LEFT=556, RT=744, 0, 480)
y = map(p.x, TOP=590, BOT=396, 0, 320)

But I get compile errors so far when I add them into Touch_shield_new.
Without them, I have a "scaling" problem in that the drawing is a magnified version of the stylus movement. I'm guessing that something is wrong with the calibration (learning curve issues are easier to deal with though!!!)

What's the secret in adding the map lines?
Regards,
Adonis

Diagnosing as:-
XM,XP:  (A1, D7) = 23
YP,YM:  (A2, D6) = 33
...
const int XP=7,XM=A1,YP=A2,YM=6; //320x480 ID=0x6814
const int TS_LEFT=396,TS_RT=590,TS_TOP=556,TS_BOT=744;

Your XP, XM, ... pins look normal.

The LEFT, RT and TOP, BOT values are strange. This is what my 6814 calibration is:

const int XP=7,XM=A1,YP=A2,YM=6; //320x480 ID=0x6814
const int TS_LEFT=134,TS_RT=906,TS_TOP=114,TS_BOT=924;

i.e. the typical difference between LEFT and RT is normally about 800.

I suggest that you substitute my calibration into the Touch_shield_new sketch and see how it behaves.

Do you see good colours when displaying BMP files from the microSD ?

David.

Haven’t tried the Micro SD stuff yet.
Your suggestion to use your settings produces a big improvement though.
I’ll get my head around what’s been done so far (especially on the touch screen things) and see if I can get the hang of things!
… and figure out the “map” things if I can!

Many thanks again for your help on this - I’m very much moving forwards again.
regards,
Adonis