Go Down

Topic: Problems with TFT LCD Shield (Read 921 times) previous topic - next topic

mikronum

Mar 22, 2017, 07:10 pm Last Edit: Mar 22, 2017, 07:36 pm by mikronum
Hello, I've bought this LCD shield:
Link

I cannot get it to work, could someone show me some example code? I have also attached a photo.

I have this result from LCD_ID_Reader:
Code: [Select]
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) 04 04 04 04 Manufacturer ID
reg(0x0009) 08 08 08 08 08 Status Register
reg(0x000A) 08 08 Get Power Mode
reg(0x000C) 0C 0C Get Pixel Format
reg(0x0061) 20 20 RDID1 HX8347-G
reg(0x0062) 20 20 RDID2 HX8347-G
reg(0x0063) 20 20 RDID3 HX8347-G
reg(0x0064) 24 24 RDID1 HX8347-A
reg(0x0065) 24 24 RDID2 HX8347-A
reg(0x0066) 24 24 RDID3 HX8347-A
reg(0x0067) 24 24 RDID Himax HX8347-A
reg(0x0070) 20 20 Panel Himax HX8347-A
reg(0x00A1) 20 20 F3 20 20 RD_DDB SSD1963
reg(0x00B0) 20 20 RGB Interface Signal Control
reg(0x00B4) 24 24 Inversion Control
reg(0x00B6) 24 24 24 24 24 Display Control
reg(0x00B7) 24 26 Entry Mode Set
reg(0x00BF) 2E 2E 2C 2C 2C 2C ILI9481, HX8357-B
reg(0x00C0) 00 00 00 00 00 00 00 00 00 Panel Control
reg(0x00C8) 08 08 08 08 08 08 08 08 08 08 08 08 08 GAMMA
reg(0x00CC) 0C 0C 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(0x00D4) 04 04 04 04 Novatek ID
reg(0x00DA) 08 08 RDID1
reg(0x00DB) 08 08 RDID2
reg(0x00DC) 0C 0C RDID3
reg(0x00E0) 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 GAMMA-P
reg(0x00E1) 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 GAMMA-N
reg(0x00EF) 2C 2C 2C 2C 2C 2C ILI9327
reg(0x00F2) 20 20 20 20 20 20 20 20 20 20 20 20 Adjust Control 2
reg(0x00F6) 24 24 24 24 Interface Control


I've tried SD through SPI and it works with Arduino SD library.

david_prentice

#1
Mar 22, 2017, 07:31 pm Last Edit: Mar 22, 2017, 07:33 pm by david_prentice
You have an OPEN-SMART Shield.   It works with MCUFRIEND_kbv but only as a SPECIAL.  
You must edit two files.  (just remove the double slashes // )  e.g.

utility/mcufriend_shield.h:
Code: [Select]
#define USE_SPECIAL

utility/mcufriend_special.h:
Code: [Select]
#define USE_OPENSMART_SHIELD_PINOUT //thanks Michel53

The LCD_ID_readreg.ino sketch should work if you edit the #defines to match the pinout printed on the pcb.

David.

p.s.  it is only supported for UNO and MEGA.   If anyone is using  other boards,  please ask.

mikronum

@david_prentice thank you very much, now it works :D

vanhan123

You have an OPEN-SMART Shield.   It works with MCUFRIEND_kbv but only as a SPECIAL. 
You must edit two files.  (just remove the double slashes // )  e.g.

utility/mcufriend_shield.h:
Code: [Select]
#define USE_SPECIAL

utility/mcufriend_special.h:
Code: [Select]
#define USE_OPENSMART_SHIELD_PINOUT //thanks Michel53

The LCD_ID_readreg.ino sketch should work if you edit the #defines to match the pinout printed on the pcb.

David.

p.s.  it is only supported for UNO and MEGA.   If anyone is using  other boards,  please ask.
To david_prentice:

I have a OPEN-SMART shield ILI9327 special LCD. I follow your instructions and make it work, but the color is not correct.
Can you help to fix it.

thanks

david_prentice

Run the graphictest_kbv example.

Report back with what colours are wrong.

David.

vanhan123

#5
May 09, 2017, 06:57 pm Last Edit: May 09, 2017, 07:25 pm by vanhan123
Run the graphictest_kbv example.

Report back with what colours are wrong.

David.
this is result

https://youtu.be/a74O96AnD5U

I think color is inverted
I modified in test code with add
tft.invertDisplay(true);
after
tft.begin(ID);
and it is OK.
can you fix it on library?

vanhan123

I have add below code into function void MCUFRIEND_kbv::invertDisplay(boolean i)  of MCUFRIEND_kbv.cpp file

    if(_lcd_ID == 0x9327){
     i = i?false:true;
   }

this is fixed.

david_prentice

There are two ways to solve your problem:

Code: [Select]

    case 0x9327:
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN;
        ...

Since most apps never change rotations or colour inversion in loop(),  you just add this line to setup()
Code: [Select]

    if (ID == 0x9327) tft.invertDisplay(1);


David.

VictorErnesto

#8
Dec 06, 2017, 06:20 pm Last Edit: Dec 06, 2017, 06:28 pm by VictorErnesto
To david_prentice:

My tft only show for few seconds an image when open the monitor serial of the ide arduino.

The driver of my tft is ILI9225.

How I can resolv this problem?

david_prentice

To david_prentice:

My tft only show for few seconds an image when open the monitor serial of the ide arduino.

The driver of my tft is ILI9225.

How I can resolv this problem?
Please post a link to the actual ILI9225 shield that you have.
And say which Arduino board you have plugged it into.

David.

VictorErnesto

I use the OPEN-SMART 2.2" TFT LCD Touch Screen Board Module with Touch Pen (http://www.dx.com/p/open-smart-2-2-tft-lcd-touch-screen-board-module-with-touch-pen-467508#.WihC5jdrzIU) and the board that I use is the Arduino Mega 2560.

david_prentice

#11
Dec 06, 2017, 09:07 pm Last Edit: Dec 06, 2017, 09:09 pm by david_prentice
From your link:
Quote
- Operating voltage: 3.3V;
- Logic level: 3.3V;
The Mega2560 is a 5V device.

Things do not emit smoke immediately.   But I would not expect it to survive for more than a few minutes.

The link also advise:
Quote
- Compatibility: Because the logic level is 3.3V, it is compatible with 3.3V Arduino board, you need to add a level conversion circuit if you use a 5V Arduino Board (Arduino UNO R3 / Arduino Mega2560 / Arduino Leonardo).
I have one of these displays.  (for testing the library code)
It works fine.   With VCC = 3.3V and 3.3V logic.  e.g. from Zero or Due.

David.

VictorErnesto

From your link:
The Mega2560 is a 5V device.

Things do not emit smoke immediately.   But I would not expect it to survive for more than a few minutes.

The link also advise:
I have one of these displays.  (for testing the library code)
It works fine.   With VCC = 3.3V and 3.3V logic.  e.g. from Zero or Due.

David.
Actually I have used the port 3.3V of the arduino, that port shouldn't enough for supply the TFT?

david_prentice

No.  It says quite clearly that you should use 3.3V Logic or provide level shifters with 5V Logic.

Obey the advice.   Everything might be ok if you have not already damaged your ILI9225.

David.


Go Up