MCUFRIEND_kbv Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields

Hi David,
Thanks a lot for the info. Did you fix your NT35310 LCD shield? I'd like to see some pictures of the 0R SMD resistors on the flex-ribbon. Did you get the component designator (R1, R2) from the silksreen printed on the flex-ribbon or schematics? Thanks a lot.

david_prentice:
It is clear that these "Blue Screen" NT35310 Shields have been made with an 8080-16 interface.
I strongly recommend that you all ask for a replacement / refund.

Only for the very brave owners:

  1. Buy some 12mm x 2mm sticky foam tape or pads.
  2. carefully cut through the existing foam tape with a sharp blade to release the display module from the pcb.
  3. remove the 0R SMD resistor on the flexi-ribbon called R1. solder the 0R resistor on the empty footprint marked R2.
  4. your NT35310 module should now be configured for 8080-8 interface.
  5. replace the butchered foam pads with your nice new foam pads and press the module back on the pcb.

I do not think that this is a job that can be attempted by many owners. The Ebay vendor supplied non-working goods. He should replace it.

David.

@foobarrer
I took a picture of my NT35310 shield ribbon before I reassembled with new foam pads.

You can see the SMD resistor now removed from R1 and the short soldered across R2. The pad spacing is perhaps 2mm.

@C12BLF
Great, thanks a lot for the picture.

C12BLF:
@foobarrer
I took a picture of my NT35310 shield ribbon before I reassembled with new foam pads.

You can see the SMD resistor now removed from R1 and the short soldered across R2. The pad spacing is perhaps 2mm.

I have just got an OPEN-SMRT 3.2" TFT LCD Sheield. Not marked mcufriend, but as the software used is based on mcufriend_kbv, I thought it best to inform about it here. Especially as I see many people have ordered.
The lcd is:
https://www.aliexpress.com/item/3-2-TFT-LCD-Touch-Screen-Expansion-Shield-W-Touch-Pen-For-Arduino/32795070895.html
and the driver is found at:
https://drive.google.com/open?id=0B6uNNXJ2z4CxYktCQlViUkI1Sms
Do not remember where I found out about it while waiting for the lcd to arrive. Did write the supplier for more info as I had forgotten about it.
The lcd arrived in a box and wrapped in foam, no damages.
Works perfectly well plugged into an Arduino Uno using the software examples.

MCUFRIEND_kbv has had the appropriate SPECIAL for some time. (for Uno and Mega)

I have never been asked by "SMART".

David.

Just found the entry in mcufriend_special.h.
Much better to only use the original MCUFRIEND_kbv.

Carl

Hi,
I got a new tft shield. This one is working with your library. It's identified as 0x9325.
Can someone point me to guide how to use my arduino and screen? :slight_smile:
So what I'd like to do is to use my Arduino as a display to my OrangePi (via usb).

My setup is done so that OrangePi is used as a thermometer (with 1-wire sensors) and a squeezebox -client.
I'd like to use my Arduino to show the temperature and song that squeezebox is playing.
My first idea was to connect screen directly to my OPi, but I think that the screen and 1-wire won't work at the same time... :slight_smile:

  • Samuli

Hi.

I am new to the forum.

David,thank you very much for this great library. Thank you very much everybody else.

I have an ILI935 2.4 mcufriend tft shield. I am running all the sketches but I have some problems.

The x axis appears inverted on the touch_shield sketch. I think it is a matter of calibration, as pointed here Project | Star Trek X-Ray device | Hackaday.io , but then , when I run the UTouch_Calibration sketch, I always end up with the " Unable to read the position of the press" message.
I have read this thread and there is some information about this issue around #688
(Sep 10, 2016, 04:39 pm ) but I cant get it to work prpperly.

Do I have to do something with NUMSAMPLES?

Please help.

Thank you.

Hey David,

I recently bought a 3.5" LCD screen from eBay for use with a STM32, but since it is a Uno form-factor shield, I want to get it working on an Uno first.

The seller claims that it is a ILI9488 @ 480x320, but it doesn't seem to be giving the correct ID, or working out of the box with mcufriend_kbv. Instead, the graphics test appears to be working in a smaller area of the screen... more like a 240x320 area. Am I doing something wrong, or have I been sold a lemon? I'm using the 'normal' mcufriend_kbv library (v2.9.4), with adafruit_gfx v1.1.9 and Arduino IDE v1.8.1, and running the graphicstest_kbv. Please let me know if you want any more info or pictures.

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) 00 00	ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00	Manufacturer ID
reg(0x0009) 00 00 71 00 00	Status Register
reg(0x000A) 00 08	Get Powsr Mode
reg(0x000C) 00 77	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 F0 F0 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

@nickanor,

Run the diagnose_touchpins sketch to identify which pins are X and Y. (in portrait)

If the X direction is wong, exchange the LEFT and RIGHT calibration values.

@pfeerick,

Many Ebay vendors supply the same useless information.
Does the pcb look like the photos?
Does it have a paper sticky label?
It is certainly NOT an ILI9488. The link shows an initialisation for an ILI9327. It is not an ILI9327.

I don't recognise any of the usual places where an ID might be stored.

Please enable the for loop in the LCD_ID_readreg sketch. This will test every register. If you find some response, post it here.

Ebay Vendors seldom know what they are selling. But it is always worth asking them.

David.

About the only similarity between the board I received (as pictured in the prior message) is the uno form factor and that it is red.
No paper label, and mcufriend decal in a different place.

Here is the (slightly trimmed) extended register dump - doesn't look very promising :-/ Have to post in two parts as exceeds 9000 character post limit...

reg(0x0000) 00 00 00 00 00 00 00 f.k
reg(0x0001) 00 00 00 00 00 00 00 f.k
reg(0x0002) 00 00 00 00 00 00 00 f.k
reg(0x0003) 00 00 00 00 00 00 00 f.k
reg(0x0004) 00 00 00 00 00 00 00 f.k
reg(0x0005) 00 00 00 00 00 00 00 f.k
reg(0x0006) 00 00 00 00 00 00 00 f.k
reg(0x0007) 00 00 00 00 00 00 00 f.k
reg(0x0008) 00 00 00 00 00 00 00 f.k
reg(0x0009) 00 00 71 00 00 00 00 f.k
reg(0x000A) 00 08 00 00 00 00 00 f.k
reg(0x000B) 00 00 00 00 00 00 00 f.k
reg(0x000C) 00 77 00 00 00 00 00 f.k
reg(0x000D) 00 00 00 00 00 00 00 f.k
reg(0x000E) 00 00 00 00 00 00 00 f.k
reg(0x000F) 00 00 00 00 00 00 00 f.k
reg(0x0010) 00 00 00 00 00 00 00 f.k
reg(0x0011) 00 00 00 00 00 00 00 f.k
reg(0x0012) 00 00 00 00 00 00 00 f.k
reg(0x0013) 00 00 00 00 00 00 00 f.k
reg(0x0014) 00 00 00 00 00 00 00 f.k
reg(0x0015) 00 00 00 00 00 00 00 f.k
reg(0x0016) 00 00 00 00 00 00 00 f.k
reg(0x0017) 00 00 00 00 00 00 00 f.k
reg(0x0018) 00 00 00 00 00 00 00 f.k
reg(0x0019) 00 00 00 00 00 00 00 f.k
reg(0x001A) 00 00 00 00 00 00 00 f.k
reg(0x001B) 00 00 00 00 00 00 00 f.k
reg(0x001C) 00 00 00 00 00 00 00 f.k
reg(0x001D) 00 00 00 00 00 00 00 f.k
reg(0x001E) 00 00 00 00 00 00 00 f.k
reg(0x001F) 00 00 00 00 00 00 00 f.k
reg(0x0020) 00 00 00 00 00 00 00 f.k
reg(0x0021) 00 00 00 00 00 00 00 f.k
reg(0x0022) 00 00 00 00 00 00 00 f.k
reg(0x0023) 00 00 00 00 00 00 00 f.k
reg(0x0024) 00 00 00 00 00 00 00 f.k
reg(0x0025) 00 00 00 00 00 00 00 f.k
reg(0x0026) 00 00 00 00 00 00 00 f.k
reg(0x0027) 00 00 00 00 00 00 00 f.k
reg(0x0028) 00 00 00 00 00 00 00 f.k
reg(0x0029) 00 00 00 00 00 00 00 f.k
reg(0x002A) 00 00 00 00 00 00 00 f.k
reg(0x002B) 00 00 00 00 00 00 00 f.k
reg(0x002C) 00 00 00 00 00 00 00 f.k
reg(0x002D) 00 00 00 00 00 00 00 f.k
reg(0x002E) 00 A2 A9 6A F8 AA 5A f.k
reg(0x002F) 00 00 00 00 00 00 00 f.k
reg(0x0030) 00 00 00 00 00 00 00 f.k
reg(0x0031) 00 00 00 00 00 00 00 f.k
reg(0x0032) 00 00 00 00 00 00 00 f.k
reg(0x0033) 00 00 00 00 00 00 00 f.k
reg(0x0034) 00 00 00 00 00 00 00 f.k
reg(0x0035) 00 00 00 00 00 00 00 f.k
reg(0x0036) 00 00 00 00 00 00 00 f.k
reg(0x0037) 00 00 00 00 00 00 00 f.k
reg(0x0038) 00 00 00 00 00 00 00 f.k
reg(0x0039) 00 00 00 00 00 00 00 f.k
reg(0x003A) 00 00 00 00 00 00 00 f.k
reg(0x003B) 00 00 00 00 00 00 00 f.k
reg(0x003C) 00 00 00 00 00 00 00 f.k
reg(0x003D) 00 00 00 00 00 00 00 f.k
reg(0x003E) 00 00 00 00 00 F8 AA f.k
reg(0x003F) 00 00 00 00 00 00 00 f.k
reg(0x0040) 00 00 00 00 00 00 00 f.k
reg(0x0041) 00 00 00 00 00 00 00 f.k
reg(0x0042) 00 00 00 00 00 00 00 f.k
reg(0x0043) 00 00 00 00 00 00 00 f.k
reg(0x0044) 00 00 00 00 00 00 00 f.k
reg(0x0045) 00 00 00 00 00 00 00 f.k
reg(0x0046) 00 00 00 00 00 00 00 f.k
reg(0x0047) 00 00 00 00 00 00 00 f.k
reg(0x0048) 00 00 00 00 00 00 00 f.k
reg(0x0049) 00 00 00 00 00 00 00 f.k
reg(0x004A) 00 00 00 00 00 00 00 f.k
reg(0x004B) 00 00 00 00 00 00 00 f.k
reg(0x004C) 00 00 00 00 00 00 00 f.k
reg(0x004D) 00 00 00 00 00 00 00 f.k
reg(0x004E) 00 00 00 00 00 00 00 f.k
reg(0x004F) 00 00 00 00 00 00 00 f.k
reg(0x0050) 00 00 00 00 00 00 00 f.k
reg(0x0051) 00 00 00 00 00 00 00 f.k
reg(0x0052) 00 00 00 00 00 00 00 f.k
reg(0x0053) 00 00 00 00 00 00 00 f.k
reg(0x0054) 00 00 00 00 00 00 00 f.k
reg(0x0055) 00 00 00 00 00 00 00 f.k
reg(0x0056) 00 00 00 00 00 00 00 f.k
reg(0x0057) 00 00 00 00 00 00 00 f.k
reg(0x0058) 00 00 00 00 00 00 00 f.k
reg(0x0059) 00 00 00 00 00 00 00 f.k
reg(0x005A) 00 00 00 00 00 00 00 f.k
reg(0x005B) 00 00 00 00 00 00 00 f.k
reg(0x005C) 00 00 00 00 00 00 00 f.k
reg(0x005D) 00 00 00 00 00 00 00 f.k
reg(0x005E) 00 00 00 00 00 00 00 f.k
reg(0x005F) 00 00 00 00 00 00 00 f.k
reg(0x0060) 00 00 00 00 00 00 00 f.k
reg(0x0061) 00 00 00 00 00 00 00 f.k
reg(0x0062) 00 00 00 00 00 00 00 f.k
reg(0x0063) 00 00 00 00 00 00 00 f.k
reg(0x0064) 00 00 00 00 00 00 00 f.k
reg(0x0065) 00 00 00 00 00 00 00 f.k
reg(0x0066) 00 00 00 00 00 00 00 f.k
reg(0x0067) 00 00 00 00 00 00 00 f.k
reg(0x0068) 00 00 00 00 00 00 00 f.k
reg(0x0069) 00 00 00 00 00 00 00 f.k
reg(0x006A) 00 00 00 00 00 00 00 f.k
reg(0x006B) 00 00 00 00 00 00 00 f.k
reg(0x006C) 00 00 00 00 00 00 00 f.k
reg(0x006D) 00 00 00 00 00 00 00 f.k
reg(0x006E) 00 00 00 00 00 00 00 f.k
reg(0x006F) 00 00 00 00 00 00 00 f.k
reg(0x0070) 00 00 00 00 00 00 00 f.k
reg(0x0071) 00 00 00 00 00 00 00 f.k
reg(0x0072) 00 00 00 00 00 00 00 f.k
reg(0x0073) 00 00 00 00 00 00 00 f.k
reg(0x0074) 00 00 00 00 00 00 00 f.k
reg(0x0075) 00 00 00 00 00 00 00 f.k
reg(0x0076) 00 00 00 00 00 00 00 f.k
reg(0x0077) 00 00 00 00 00 00 00 f.k
reg(0x0078) 00 00 00 00 00 00 00 f.k
reg(0x0079) 00 00 00 00 00 00 00 f.k
reg(0x007A) 00 00 00 00 00 00 00 f.k
reg(0x007B) 00 00 00 00 00 00 00 f.k
reg(0x007C) 00 00 00 00 00 00 00 f.k
reg(0x007D) 00 00 00 00 00 00 00 f.k
reg(0x007E) 00 00 00 00 00 00 00 f.k
reg(0x007F) 00 00 00 00 00 00 00 f.k
reg(0x0080) 00 00 00 00 00 00 00 f.k
reg(0x0081) 00 00 00 00 00 00 00 f.k
reg(0x0082) 00 00 00 00 00 00 00 f.k
reg(0x0083) 00 00 00 00 00 00 00 f.k
reg(0x0084) 00 00 00 00 00 00 00 f.k
reg(0x0085) 00 00 00 00 00 00 00 f.k
reg(0x0086) 00 00 00 00 00 00 00 f.k
reg(0x0087) 00 00 00 00 00 00 00 f.k
reg(0x0088) 00 00 00 00 00 00 00 f.k
reg(0x0089) 00 00 00 00 00 00 00 f.k
reg(0x008A) 00 00 00 00 00 00 00 f.k
reg(0x008B) 00 00 00 00 00 00 00 f.k
reg(0x008C) 00 00 00 00 00 00 00 f.k
reg(0x008D) 00 00 00 00 00 00 00 f.k
reg(0x008E) 00 00 00 00 00 00 00 f.k
reg(0x008F) 00 00 00 00 00 00 00 f.k
reg(0x0090) 00 00 00 00 00 00 00 f.k
reg(0x0091) 00 00 00 00 00 00 00 f.k
reg(0x0092) 00 00 00 00 00 00 00 f.k
reg(0x0093) 00 00 00 00 00 00 00 f.k
reg(0x0094) 00 00 00 00 00 00 00 f.k
reg(0x0095) 00 00 00 00 00 00 00 f.k
reg(0x0096) 00 00 00 00 00 00 00 f.k
reg(0x0097) 00 00 00 00 00 00 00 f.k
reg(0x0098) 00 00 00 00 00 00 00 f.k
reg(0x0099) 00 00 00 00 00 00 00 f.k
reg(0x009A) 00 00 00 00 00 00 00 f.k
reg(0x009B) 00 00 00 00 00 00 00 f.k
reg(0x009C) 00 00 00 00 00 00 00 f.k
reg(0x009D) 00 00 00 00 00 00 00 f.k
reg(0x009E) 00 00 00 00 00 00 00 f.k
reg(0x009F) 00 00 00 00 00 00 00 f.k

And here's the rest... (sheesh... had to wait five minutes before I could post it!)

reg(0x00A0) 00 00 00 00 00 00 00 f.k
reg(0x00A1) 00 F0 F0 00 00 00 00 f.k
reg(0x00A2) 00 00 00 00 00 00 00 f.k
reg(0x00A3) 00 00 00 00 00 00 00 f.k
reg(0x00A4) 00 00 00 00 00 00 00 f.k
reg(0x00A5) 00 00 00 00 00 00 00 f.k
reg(0x00A6) 00 00 00 00 00 00 00 f.k
reg(0x00A7) 00 00 00 00 00 00 00 f.k
reg(0x00A8) 00 F0 F0 F0 F0 F0 F0 f.k
reg(0x00A9) 00 00 00 00 00 00 00 f.k
reg(0x00AA) 00 00 00 00 00 00 00 f.k
reg(0x00AB) 00 00 00 00 00 00 00 f.k
reg(0x00AC) 00 00 00 00 00 00 00 f.k
reg(0x00AD) 00 00 00 00 00 00 00 f.k
reg(0x00AE) 00 00 00 00 00 00 00 f.k
reg(0x00AF) 00 00 00 00 00 00 00 f.k
reg(0x00B0) 00 00 00 00 00 00 00 f.k
reg(0x00B1) 00 00 00 00 00 00 00 f.k
reg(0x00B2) 00 00 00 00 00 00 00 f.k
reg(0x00B3) 00 00 00 00 00 00 00 f.k
reg(0x00B4) 00 00 00 00 00 00 00 f.k
reg(0x00B5) 00 00 00 00 00 00 00 f.k
reg(0x00B6) 00 00 00 00 00 00 00 f.k
reg(0x00B7) 00 00 00 00 00 00 00 f.k
reg(0x00B8) 00 00 00 00 00 00 00 f.k
reg(0x00B9) 00 00 00 00 00 00 00 f.k
reg(0x00BA) 00 00 00 00 00 00 00 f.k
reg(0x00BB) 00 00 00 00 00 00 00 f.k
reg(0x00BC) 00 00 00 00 00 00 00 f.k
reg(0x00BD) 00 00 00 00 00 00 00 f.k
reg(0x00BE) 00 00 00 00 00 00 00 f.k
reg(0x00BF) 00 00 00 00 00 00 00 f.k
reg(0x00C0) 00 00 00 00 00 00 00 f.k
reg(0x00C1) 00 00 00 00 00 00 00 f.k
reg(0x00C2) 00 00 00 00 00 00 00 f.k
reg(0x00C3) 00 00 00 00 00 00 00 f.k
reg(0x00C4) 00 00 00 00 00 00 00 f.k
reg(0x00C5) 00 00 00 00 00 00 00 f.k
reg(0x00C6) 00 00 00 00 00 00 00 f.k
reg(0x00C7) 00 00 00 00 00 00 00 f.k
reg(0x00C8) 00 00 00 00 00 00 00 f.k
reg(0x00C9) 00 00 00 00 00 00 00 f.k
reg(0x00CA) 00 00 00 00 00 00 00 f.k
reg(0x00CB) 00 00 00 00 00 00 00 f.k
reg(0x00CC) 00 00 00 00 00 00 00 f.k
reg(0x00CD) 00 00 00 00 00 00 00 f.k
reg(0x00CE) 00 00 00 00 00 00 00 f.k
reg(0x00CF) 00 00 00 00 00 00 00 f.k
reg(0x00D0) 00 00 00 00 00 00 00 f.k
reg(0x00D1) 00 00 00 00 00 00 00 f.k
reg(0x00D2) 00 00 00 00 00 00 00 f.k
reg(0x00D3) 00 00 00 00 00 00 00 f.k
reg(0x00D4) 00 00 00 00 00 00 00 f.k
reg(0x00D5) 00 00 00 00 00 00 00 f.k
reg(0x00D6) 00 00 00 00 00 00 00 f.k
reg(0x00D7) 00 00 00 00 00 00 00 f.k
reg(0x00D8) 00 00 00 00 00 00 00 f.k
reg(0x00D9) 00 00 00 00 00 00 00 f.k
reg(0x00DA) 00 00 00 00 00 00 00 f.k
reg(0x00DB) 00 00 00 00 00 00 00 f.k
reg(0x00DC) 00 00 00 00 00 00 00 f.k
reg(0x00DD) 00 00 00 00 00 00 00 f.k
reg(0x00DE) 00 00 00 00 00 00 00 f.k
reg(0x00DF) 00 00 00 00 00 00 00 f.k
reg(0x00E0) 00 00 00 00 00 00 00 f.k
reg(0x00E1) 00 00 00 00 00 00 00 f.k
reg(0x00E2) 00 00 00 00 00 00 00 f.k
reg(0x00E3) 00 00 00 00 00 00 00 f.k
reg(0x00E4) 00 00 00 00 00 00 00 f.k
reg(0x00E5) 00 00 00 00 00 00 00 f.k
reg(0x00E6) 00 00 00 00 00 00 00 f.k
reg(0x00E7) 00 00 00 00 00 00 00 f.k
reg(0x00E8) 00 00 00 00 00 00 00 f.k
reg(0x00E9) 00 00 00 00 00 00 00 f.k
reg(0x00EA) 00 00 00 00 00 00 00 f.k
reg(0x00EB) 00 00 00 00 00 00 00 f.k
reg(0x00EC) 00 00 00 00 00 00 00 f.k
reg(0x00ED) 00 00 00 00 00 00 00 f.k
reg(0x00EE) 00 00 00 00 00 00 00 f.k
reg(0x00EF) 00 00 00 00 00 00 00 f.k
reg(0x00F0) 00 00 00 00 00 00 00 f.k
reg(0x00F1) 00 00 00 00 00 00 00 f.k
reg(0x00F2) 00 00 00 00 00 00 00 f.k
reg(0x00F3) 00 00 00 00 00 00 00 f.k
reg(0x00F4) 00 00 00 00 00 00 00 f.k
reg(0x00F5) 00 00 00 00 00 00 00 f.k
reg(0x00F6) 00 00 00 00 00 00 00 f.k
reg(0x00F7) 00 00 00 00 00 00 00 f.k
reg(0x00F8) 00 00 00 00 00 00 00 f.k
reg(0x00F9) 00 00 00 00 00 00 00 f.k
reg(0x00FA) 00 00 00 00 00 00 00 f.k
reg(0x00FB) 00 00 00 00 00 00 00 f.k
reg(0x00FC) 00 00 00 00 00 00 00 f.k
reg(0x00FD) 00 00 00 00 00 00 00 f.k
reg(0x00FE) 00 00 00 00 00 00 00 f.k
reg(0x00FF) 00 00 00 00 00 00 00 f.k

You could have just pasted 0xA1, 0xA8. 0x2E and 0x3E are just screen memory.

There are zero clues for me to follow. I suggest that you just try different 320x480 controllers e.g. tft.begin(0x8357)

There are more controllers in v2.9.5-beta from Github. e.g. 0x9090, 0x5310, ...

David.

david_prentice:
@nickanor,

Run the diagnose_touchpins sketch to identify which pins are X and Y. (in portrait)

If the X direction is wong, exchange the LEFT and RIGHT calibration values.

Hi David,

Thank you for your response.

I think I tried both things yesterday before posting. Not sure if I run the diagnose_touchpins in portrait( I guess I tried the default skecth).

I will try again today more thoroughly nevertheless.

david_prentice:
@nickanor,

Run the diagnose_touchpins sketch to identify which pins are X and Y. (in portrait)

If the X direction is wong, exchange the LEFT and RIGHT calibration values.

This is what I get from the diagnose sketch:
XM,XP: (A1,D7) =29
YP;YM: (A2,D6)=35
Not sure if I am running it in Portait or landscape mode. I loaded the default sketch. I guess you meant the diagnose sketch will return the x axis considered such when you see the screen like a portrait, that is, the minor axis.

Then I run this in the touch_shield sketch

uint8_t YP = A2; // must be an analog pin, use "An" notation!
uint8_t XM = A1; // must be an analog pin, use "An" notation!
uint8_t YM = 6; // can be a digital pin
uint8_t XP = 7; // can be a digital pin
uint8_t SwapXY = 0;

x coordinate increases downwards in the first screen and y coordinate increases rightwards.

Then I press exit and start to draw. Y axis works but x axis is drawn reveversed.

Then I change what I think are the calibration values to these:

uint16_t TS_LEFT = 150; // changed by me
uint16_t TS_RT = 920; // changed by me
uint16_t TS_TOP = 940;
uint16_t TS_BOT = 120;

Same results. X coordinate increases downwards in the first screen and y coordinate increases rightwards. X axis is drawn reveversed again.

Then I run the UTouch sketch with the following sets:
#define YP A2 //A3 for ILI9320
#define YM 6 //9
#define XM A1
#define XP 7 //8

Again unable to read the posisition of the press.
If I press another corner, no matter wich one, instead the highlighted, still the same message "Unable to read the position of the press. This is a hardware issue and can not be corrected in software"

I ran the diagnose_Touchpins on a typical Blue 2.8" Shield:

Diagnosing as:-
YP,YM:  (A1, D7) = 29
XM,XP:  (A2, D6) = 23

And ran the Touch_shield_kbv sketch:

Found ILI9341 BLUE LCD driver
ID=0x9341
Screen is 240x320
Calibration is: 
LEFT = 920 RT  = 139
TOP  = 944 BOT = 150
Wiring is: PORTRAIT
YP=15 XM=16
YM=7 XP=6

As I move the stylus around the screen, the tp.x showed 890 at the left of the screen, 160 at the right.
tp.y showed 923 at the top, 125 at the bottom.

Pressing the EXIT in the middle of the screen took me to the "Paint" screen.
As I move the stylus, the coloured dot follows correctly.

Note that the tp.x value always represents the value returned from a physical position on the screen.
If your tp.x does not correspond to the TS_LEFT and TS_RT values, you can change them.
The Touch_shield_kbv value is "good enough". The TouchScreen_Calibr_kbv sketch will give you a more accurate value for TS_LEFT and TS_RT.

Your actual application e.g. Paint will map the physical location (tp.x tp.y) to the logical pixel address.
i.e. it maps differently for each rotation.

I strongly advise users to map to the Pixel address. Then your application logic is easy.
Many other sketches seem to use convoluted values.

David.

David,
My programing skills are very limited and I haven't worked with this library or with the adafruit library before.

It will take some time to understand what you are saying.

A few questions to help me do my homework:

tp.x and tp.y are methods from a class?
Where is that class implemented?
Do they return the position of the stylo?
What are TS_LEFT and TS_RT ?
Where are they defined to investigate their behaviour?

Dear David,

I purchased 3.95inch TFT LCD for Arduino MEGA from mcufriend. Unfortunately I could not initialize LCD properly.
Attached image for your reference.

However I run read register sketch and provided results here.
Can you please help me which type is LCD to initialize it?

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) 0C 0C ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 0C 0C 0C 0C Manufacturer ID
reg(0x0009) 0D 0D 0D 0D 0D Status Register
reg(0x000A) 0E 0E Get Power Mode
reg(0x000C) 0C 0C Get Pixel Format
reg(0x0061) 65 65 RDID1 HX8347-G
reg(0x0062) 66 66 RDID2 HX8347-G
reg(0x0063) 67 67 RDID3 HX8347-G
reg(0x0064) 64 64 RDID1 HX8347-A
reg(0x0065) 65 65 RDID2 HX8347-A
reg(0x0066) 66 66 RDID3 HX8347-A
reg(0x0067) 67 67 RDID Himax HX8347-A
reg(0x0070) 74 74 Panel Himax HX8347-A
reg(0x00A1) A5 A5 A5 A5 A5 RD_DDB SSD1963
reg(0x00B0) B4 B4 RGB Interface Signal Control
reg(0x00B4) B4 B4 Inversion Control
reg(0x00B6) B6 B6 B6 B6 B6 Display Control
reg(0x00B7) B7 B7 Entry Mode Set
reg(0x00BF) BF BF BF BF BF BF ILI9481, HX8357-B
reg(0x00C0) 4C 4C 4C 4C 4C 4C 4C 4C 4C Panel Control
reg(0x00C8) 4C 4C 4C 4C 4C 4C 4C 4C 4C 4C 4C 4C 4C GAMMA
reg(0x00CC) 4C 4C Panel Control
reg(0x00D0) 5C 5C 5C Power Control
reg(0x00D2) 5E 5E 5E 5E 5E NVM Read
reg(0x00D3) 5F 5F 5F 5F ILI9341, ILI9488
reg(0x00D4) 5C 5C 5C 5C Novatek ID
reg(0x00DA) 5E 5E RDID1
reg(0x00DB) 5F 5F RDID2
reg(0x00DC) 5C 5C RDID3
reg(0x00E0) E4 E4 E4 E4 E4 E4 E4 E4 E4 E4 E4 E4 E4 E4 E4 E4 GAMMA-P
reg(0x00E1) E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 GAMMA-N
reg(0x00EF) EF EF EF EF EF EF ILI9327
reg(0x00F2) F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 Adjust Control 2
reg(0x00F6) F6 F6 F6 F6 Interface Control

Go on. Your attached PNG shows a 3.6" Shield for a mega2560

The LCD_ID_readreg sketch is for:

Read Registers on MCUFRIEND [color=red]UNO[/color] shield

Please post a genuine photo. Or at least count the number of resistor-packs.
The 3.6" photo shows RP1-RP7 which implies a 16-bit interface.

David.