2.8" TFT LCD, unknown ID.

casemod:
can your confirm the resolution of yours is 240320 as advertised?
The ILI9327 is 240
400, unless the software is customized.

Because this LCD is QVGA, it will be either ILI9320 ILI9325 ILI9328 ILI9341 HX8347 HX8357
(8bit pararell mode)
The process of the initialization is the same.

I rewrite the Sketch File of this library.
And comment out the ID determining part of from 47 lines to 84 lines.
change tft.begin (identifier); to tft.begin (0x8357);

BLOG0614.JPG

Hi, when i use Heer Lorcan Code, i got this errors :

sketch_jan03a:10: error: 'tft' was not declared in this scope
sketch_jan03a:12: error: expected unqualified-id before 'if'

I have the Adafruit lib's and the STDINT.h

Am i missing something ??

Finaly I got it working, but I need programming experts to give me a hand to fix some issues:

  1. Text is mirrored
  2. to hook it to Arduino MEGA without any hardware mods (adafruit library need to be changed I guess)

Here is the results and wiring:

http://www.voltrans.az/en/2015/01/06/2-8-tft-lcd-дисплей-на-чипе-hx8357-в-связке-с-arduino-mega/

samuraijap:
http://www.amazon.co.uk/Generic-Touch-Screen-Card-Socket/dp/B00K0F2QR0

http://www.ebay.com/itm/2-8-TFT-LCD-Display-Touch-Screen-Module-with-SD-Solt-Arduino-UNO-TOP-M63-/351206859044?pt=LH_DefaultDomain_0&hash=item51c58f6124

These shields are fake and imitation. :fearful:

This is nothing but LCD and backlight.
Driver IC is not at all to this shield.

I have the same shield and while I havent got it working 100% it does display some graphics if I force my library to ignore the returned device ID and only try to use a ILI9325 controller chip.

That said I am pretty sure the board is actually using an lgdp4535 chip since the returned ID is 0x4535.

Unfortunatly I have not found a datasheet on the lgdp4535 yet.

BTW, A lot of people do not seem to understand most of these shields are designed to work with an UNO. As such they will ony work with boards like the Mega if the library supports it (and it is configured correctly) or they need to abandon the shield and wire the interconnects manually.

Hello,
I have a tft lcd with and the returned ID is 0x4535 just the same as you... and I could not get it to work... did you succeed?? any help is apreciated :slight_smile:

Actually yes I have a working lgdp4535 display (device ID 0x4535).

I was unable to find a programming datasheet for the lgdp4535 but I did turn-up some code for a different micropocessor platform that made this possible.

So this is a hack of the "Adafruit_TFTLCD" library where the ILI9341 initialisation valuse are replace with the values for the lgdp4535 and the library is initalised forced to use the ILI9341.

To do this modify "Adafruit_TFTLCD.cpp" and replace the array "ILI932x_regValues" with the following:

static const uint16_t ILI932x_regValues[] PROGMEM = {

0x15, 0x0030, /* Set the internal vcore voltage /
0x9A, 0x0010, /
Start internal OSC /
0x11, 0x0020, /
set SS and SM bit /
0x10, 0x3428, /
set 1 line inversion /
0x12, 0x0002, /
set GRAM write direction and BGR=1 /
0x13, 0x1038, /
Resize register /
TFTLCD_DELAY, 40,
0x12, 0x0012, /
set the back porch and front porch /
TFTLCD_DELAY, 40,
0x10, 0x3420, /
set non-display area refresh cycle ISC[3:0] /
0x13, 0x3045, /
FMARK function /
TFTLCD_DELAY, 70,
0x30, 0x0000, /
RGB interface setting /
0x31, 0x0402, /
Frame marker Position /
0x32, 0x0307, /
RGB interface polarity /
0x33, 0x0304, /
SAP, BT[3:0], AP, DSTB, SLP, STB /
0x34, 0x0004, /
DC1[2:0], DC0[2:0], VC[2:0] /
0x35, 0x0401, /
VREG1OUT voltage /
0x36, 0x0707, /
VDV[4:0] for VCOM amplitude /
0x37, 0x0305, /
SAP, BT[3:0], AP, DSTB, SLP, STB /
0x38, 0x0610, /
DC1[2:0], DC0[2:0], VC[2:0] /
0x39, 0x0610, /
VREG1OUT voltage /
0x01, 0x0100, /
VDV[4:0] for VCOM amplitude /
0x02, 0x0300, /
VCM[4:0] for VCOMH /
0x03, 0x1030, /
GRAM horizontal Address /
0x08, 0x0808, /
GRAM Vertical Address /
0x0A, 0x0008,
0x60, 0x2700, /
Gate Scan Line /
0x61, 0x0001, /
NDL,VLE, REV */
0x90, 0x013E,
0x92, 0x0100,
0x93, 0x0100,
0xA0, 0x3000,
0xA3, 0x0010,
0x07, 0x0001,
0x07, 0x0021,
0x07, 0x0023,
0x07, 0x0033,
0x07, 0x0133,
};

Then in your setup code use: "tft.begin(0x9341);"

Thats it!

Thanks for your answer :).

However it did still not works for me...

disneysw:
To do this modify "Adafruit_TFTLCD.cpp" and replace the array "ILI932x_regValues" with the following:
...
Then in your setup code use: "tft.begin(0x9341);

I replaced ILI9341 values and I am still getting a white screen....Later I tried to use ILI932x values and only got a white screen...

Could you send me your hacked TFTLCD library please so I can be sure if my screen is defective or not?

Anyway thanks a lot for your answer :slight_smile:

It finally worked!!! Thank you very much Dysneysw, if you wish I can put " hacked by Disneysw" at the beginig of the code :slight_smile:

Glad I could be of help and you got it working.

I don't need any credit for this, there actually was not much to it, the only issue was lack of information on lgdp4535.The people who wrote the original library for Adafruit did all the heavy lifting.

I was going to port the initialisation code into the UTFT library but have been unsuccessful in getting it to work for reasons I don't understand at the moment. Given I can do what I need to with the current library I may just stick with it :slight_smile:

Hi

In my case, for 2.8 mcufriend board, I had to use 0x9325 as an identifier instead of 0x9341. What can be important, I do not have an original UNO board. I have "Version Board ATmega328P UNO R3 CH340T Instead 16U2" http://www.ebay.com/itm/Version-Board-ATmega328P-UNO-R3-CH340T-Instead-16U2-Free-USB-Cable-for-Arduino-D-/261562132907

Anyway, thank you very much for above solution with PROGMEM :wink:
I thought that I will have to throw away this TFT.

Hi every one .
I bought 2.8 TFT LCD Shield and i don't know how determined the type of Controller :frowning: .
I ask the seller about the the type of it controller he give me ILI9341 .
I'm try use many more Library without any result :frowning: .
there is one library Loaded in Arduino , library from Adafruit-GFX , serial monitor find LCD Identifier is 139 ! !
Does this mean it's working but it's not realizes the type of controller ??
There is something caught my attention the shield does't have any ICs like all shield i see during my search !!
i attach photo to the LCD shield >
Can any one help me :slight_smile: ?
thanks

The Shield in side .

It's functions good with the changes from disneysw,
but only with

tft.begin(0x9325);

thanks !

I saw above also the mirror issue, with this driver ili9341
but i can not find the solution
i did change the data in the ccp file but that did not help

can someone point me to the solution or give me a solution

Thanks.

Marc

disneysw:
Actually yes I have a working lgdp4535 display (device ID 0x4535).

I was unable to find a programming datasheet for the lgdp4535 but I did turn-up some code for a different micropocessor platform that made this possible.

So this is a hack of the "Adafruit_TFTLCD" library where the ILI9341 initialisation valuse are replace with the values for the lgdp4535 and the library is initalised forced to use the ILI9341.

To do this modify "Adafruit_TFTLCD.cpp" and replace the array "ILI932x_regValues" with the following:

static const uint16_t ILI932x_regValues[] PROGMEM = {

0x15, 0x0030, /* Set the internal vcore voltage /
0x9A, 0x0010, /
Start internal OSC /
0x11, 0x0020, /
set SS and SM bit /
0x10, 0x3428, /
set 1 line inversion /
0x12, 0x0002, /
set GRAM write direction and BGR=1 /
0x13, 0x1038, /
Resize register /
TFTLCD_DELAY, 40,
0x12, 0x0012, /
set the back porch and front porch /
TFTLCD_DELAY, 40,
0x10, 0x3420, /
set non-display area refresh cycle ISC[3:0] /
0x13, 0x3045, /
FMARK function /
TFTLCD_DELAY, 70,
0x30, 0x0000, /
RGB interface setting /
0x31, 0x0402, /
Frame marker Position /
0x32, 0x0307, /
RGB interface polarity /
0x33, 0x0304, /
SAP, BT[3:0], AP, DSTB, SLP, STB /
0x34, 0x0004, /
DC1[2:0], DC0[2:0], VC[2:0] /
0x35, 0x0401, /
VREG1OUT voltage /
0x36, 0x0707, /
VDV[4:0] for VCOM amplitude /
0x37, 0x0305, /
SAP, BT[3:0], AP, DSTB, SLP, STB /
0x38, 0x0610, /
DC1[2:0], DC0[2:0], VC[2:0] /
0x39, 0x0610, /
VREG1OUT voltage /
0x01, 0x0100, /
VDV[4:0] for VCOM amplitude /
0x02, 0x0300, /
VCM[4:0] for VCOMH /
0x03, 0x1030, /
GRAM horizontal Address /
0x08, 0x0808, /
GRAM Vertical Address /
0x0A, 0x0008,
0x60, 0x2700, /
Gate Scan Line /
0x61, 0x0001, /
NDL,VLE, REV */
0x90, 0x013E,
0x92, 0x0100,
0x93, 0x0100,
0xA0, 0x3000,
0xA3, 0x0010,
0x07, 0x0001,
0x07, 0x0021,
0x07, 0x0023,
0x07, 0x0033,
0x07, 0x0133,
};

Then in your setup code use: "tft.begin(0x9341);"

Thats it!

I tried to change the file with no success, any chance you could post the modified fil? anh help is greatly apriciated.

Thos who have uno board pins on the display try my TFTLCD library. It just bit bangs datato the display. You can also invert xy coordinates if you wish.

The thing is that most TFT libraries are designed for UNO. The UNO digital pins does not match in MEGA so none of the libraries works when used with MEGA. So I have edited Mikes TFTLCD library that had MEGA support.

What I have found that TFTLCD libraries made for uno suffers in mega, because mega is slower with digitalWrites and also because TFT libraries need 11 more sift operations per command in MEGA. My edited lib uses only portmanipulation and MEGA don't have issues atm, and is faster than any current libraries when used out of the box UNO shield in MEGA.

Atleast when I look this display on ebay:

It has same 8bit controllers that the 2.4" display has. The one chip just controlls read write direction and backlight and the second just amplifies byte that is coming from arduino to the display.

Sure the pins can be changed to match the pinout on the mega, but what does the speed look like? For the mega an SPI display is likelly to offer faster refresh rates?

So plug it into a mega and wire pins 50-53 to 10-13 (check the order) so SPI can be used.
SPI offers the fastest data write speeds, up to 8 MHz clock if the device can accept data at rate.

I was given one of these displays, identical to the images in earlier posts. After trying it out with the Adafruit libraries, I discovered that my example used the ST7783 driver chip.

This led me to the st7783 library mentioned in this post: mcufriend 2.8 inch TFT LCD display issues - Displays - Arduino Forum

The example programs (MyGraphicTest and tftpaint) worked with a couple of problems:

  • The touchscreen was "mirror imaging" my inputs - left was being interpreted as right, top as bottom and so on. Also, the calibration was a bit out on the Y axis.
  • The screen was very bright with low contrast colours.

The first problem was an easy fix. Taking the tftpaint program as an example, I changed this ...

#define TS_MINX 150
#define TS_MINY 120
#define TS_MAXX 920
#define TS_MAXY 940

... to this ...

#define TS_MINX 920	
#define TS_MINY 980		
#define TS_MAXX 150		
#define TS_MAXY 160

The second problem was harder. Looking more closely, it seemed that every other row of pixels was showing white.

I found a couple of posts where people had fixed similar sounding problems by changing some of the settings made to the SST7783 registers when the TFT library initialises the display.

After some trial and error, the following changes to TFTLCD.cpp (in the st7783 library) solved the problem. Near the bottom of the file, there is a PROGMEM array of register addresses and values.

I changed this line ...

0x0002,0x0700,

... to this ...

  // CHANGED ENTRY BELOW TO AVOID "WHITE INTERLACED LINES"
  0x0002,0x0500,

I now had deep colours without the extra white lines, but the display was flickering badly. So I made a further change from this ...

  0x0029,0x0015,

... to this ...

  0x0029,0x0015,
  // ADDED ENTRY BELOW TO INCREASE FRAME RATE AND AVOID FLICKER
  0x002B,0x000E,

The display is now near perfect. The only issue is that, since the backlight is at one end of the LCD, that end is always a bit brighter than elsewhere.

Regards

Ray

I have this display blue pcb with TS and tft as pictured above.

Adafruit-GFX-Library-master dated 21 Jan 2015 (.cpp is newer) and renamed AdaLGDP4535TFTLCD

was my solution