Dear All,
I followed so many thread on this forum to program my LCD but I couldn't. Please advice to program my UTFT
Please see the attached picture for LCD
I am using Arduino mega board
Dear All,
I followed so many thread on this forum to program my LCD but I couldn't. Please advice to program my UTFT
Please see the attached picture for LCD
I am using Arduino mega board
I have a similar shield on my desk. The Components are in the same locations. The copper traces follow the same pattern. The only difference is in the big copper land that is on the route from RP7 to the unmounted flex connector.
You (and I) have 7 resistor packs RP1 - RP7. Which normally means 16-bit interface.
My particular Display has an HX8357-D controller with 8-bit interface.
I use MCUFRIEND_kbv with USE_SPECIAL and USE_MEGA_8BIT_SHIELD
Of course your Display might have a completely different controller.
UTFT does not support HX8357-D with 8-bit interface.
David.
Dear David,
Can you please recommend any library with example
Grate thanks if possible
Thanks in advance
UTFT does not support HX8357-D with 8-bit interface.
I am the author of MCUFRIEND_kbv. I am not the author of UTFT.
Mega2560 Shields are write-only. There is no way that you can read the controller or interface. You just have to guess. Ok, I know what subtle differences exist between controllers. So I can do a bit of diagnosis.
UTFT has no concept of reading anyway.
If you do choose to use MCUFRIEND_kbv, please note that the ID for HX8357-D has changed to 0x9090 in v2.9.5. Previous versions have an ID = 0x8357. i.e. you use tft.begin(0x8357)
David.
I recommend you this library the rinkydinkelectronics are good, for the sd use sdraw.. I had this screen and had have problems with sd. I believe that this screen use the ILI9486
Dear david_prentice;
I used force ID with " MCUFRIEND_kbv-master "
Can you please advice me that any pin modification is needed for MEGA board
Thanks in advance
PA3040
Dear Hizard,
I used that Library and change the controller number as per your advice but I could not see any result
Any advice
PA3040:
Dear david_prentice;I used force ID with " MCUFRIEND_kbv-master "
Can you please advice me that any pin modification is needed for MEGA board
Thanks in advance
PA3040
I explained in #1.
Edit mcufriend_shield.h for USE_SPECIAL
Edit mcufriend_special.h for USE_MEGA_8BIT_SHIELD
Edit sketch for tft.begin(0x8357)
Plug the shield into the Mega making sure that all the male pins mate with female sockets.
Please let me know how you get on. The library is intended for Uno Shields. It is fiddly to enable SPECIALs for unusual hardware.
David.
Dear david Thanks for the advice
I did as per your advice
following is the reading of LCD_ID Reading
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) 04 04 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 04 04 04 04 Manufacturer ID
reg(0x0009) 05 05 05 05 05 Status Register
reg(0x000A) 06 06 Get Power Mode
reg(0x000C) 04 04 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) 44 44 44 44 44 44 44 44 04 Panel Control
reg(0x00C8) 44 44 44 44 44 44 44 44 44 44 04 04 04 GAMMA
reg(0x00CC) 44 44 Panel Control
reg(0x00D0) 54 54 54 Power Control
reg(0x00D2) 56 56 56 56 56 NVM Read
reg(0x00D3) 57 57 57 57 ILI9341, ILI9488
reg(0x00D4) 54 54 54 54 Novatek ID
reg(0x00DA) 56 56 RDID1
reg(0x00DB) 57 57 RDID2
reg(0x00DC) 54 54 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
Please advice
Dear David
Following errors also comes when GLUE_Demo_420x320 compiling
C:\Program Files\Arduino\libraries\MCUFRIEND_kbv-master\MCUFRIEND_kbv.cpp:26:38: fatal error: utility/mcufriend_shield.h: No such file or directory
#include "utility/mcufriend_shield.h"
^
compilation terminated.
Error compiling
Why are you trying to compile GLUE_Demo_420x320 ?
For a start, only GLUE_Demo_480x320 exists.
Secondly, it is not a native MCUFRIEND_kbv sketch.
You are always advised to run graphictest_kbv as a definitive test.
LCD_ID_readreg clearly says "Uno Shield". Of course you can never read anything from a write-only Mega Shield.
Did you make the edits that I advised?
If unsure, say so. Or paste your edited line(s) to your message.
Did you install library via the Library Manager?
David.
You are always advised to run graphictest_kbv as a definitive test.
Agreed
Did you make the edits that I advised?
Please see the attached image what I edited
Did you install library via the Library Manager?
No. I directly copy the folder to library folder
Please advice
Thanks in advance
Dear david
I compiled graphictest_kbv then following error has occurred
C:\Program Files\Arduino\libraries\MCUFRIEND_kbv-master\MCUFRIEND_kbv.cpp:26:43: fatal error: utility/mcufriend_USE_SPECIAL.h: No such file or directory
#include "utility/mcufriend_USE_SPECIAL.h"
^
compilation terminated.
Error compiling.
Please follow instructions exactly.
#define USE_SPECIAL //check for custom drivers
#if defined(USE_SPECIAL)
#include "mcufriend_special.h"
...
#define SSD1289_JUMPERS 2 //Uno Shield with VERY different pin-out to Mcufriend
// only define one "USE_XXX" macro at any time
//#define USE_SSD1289_SHIELD_UNO
//#define USE_SSD1289_SHIELD_MEGA
//#define USE_SSD1289_SHIELD_DUE
//#define USE_MEGA_8BIT_PROTOSHIELD
#define USE_MEGA_8BIT_SHIELD
//#define USE_MEGA_16BIT_SHIELD //RD on PL6 (D43)
//#define USE_BLD_BST_MEGA32U4
//#define USE_BLD_BST_MEGA2560
//#define USE_DUE_8BIT_PROTOSHIELD
//#define USE_DUE_16BIT_SHIELD //RD on PA15 (D24)
//#define USE_BOBCACHELOT_TEENSY
//#define USE_FRDM_K20
//#define USE_OPENSMART_SHIELD_PINOUT //thanks Michel53
...
void setup(void) {
Serial.begin(9600);
uint32_t when = millis();
// while (!Serial) ; //hangs a Leonardo until you connect a Serial
if (!Serial) delay(5000); //allow some time for Leonardo
Serial.println("Serial took " + String((millis() - when)) + "ms to start");
// tft.reset(); //hardware reset
uint16_t ID = tft.readID(); //
Serial.print("ID = 0x");
Serial.println(ID, HEX);
if (ID == 0xD3D3) ID = 0x8357; // write-only shield
ID = 0x8357; // force ID
tft.begin(ID);
}
I have shown edits from the Beta. It might be slightly different. The end effect is the same.
The "edits" are nothing more than removing one pair of forward-slashes in the H files.
And adding a line to the end of setup()
Ask if you do not understand.
David.
Dear David I have done all thins as per your advice
following message print after uploading graphictest_kbv sckech
Serial took 0ms to start
ID = 0xD3D3
Please advice next step
Yes, the Serial will say 0xD3D3.
Did you edit the setup() function for:
ID = 0x8357; // force ID
tft.begin(ID);
If you still have problems, please copy-paste the results of your edit(s).
David.
Dear David Thanks for the reply and continuous support
Please fine the attached for modified mcufriend_shield.h
mcufriend_shield.h (20.2 KB)
mcufriend_special.h (35.3 KB)
graphictest_kbv.ino (17.3 KB)
You have done all the edits correctly.
You did not say. I presume that it was not successful.
There was no guarantee that your Shield is the same as my one.
It is possible to use 16BIT or 8BIT with your pcb.
Change mcufriend_special.h to enable USE_MEGA_16BIT_SHIELD instead of USE_MEGA_8BIT_SHIELD
David.
Dear David
I edited the as follows
#define SSD1289_JUMPERS 2 //Uno Shield with VERY different pin-out to Mcufriend
// only define one "USE_XXX" macro at any time
//#define USE_SSD1289_SHIELD_UNO
//#define USE_SSD1289_SHIELD_MEGA
//#define USE_SSD1289_SHIELD_DUE
//#define USE_MEGA_8BIT_PROTOSHIELD
//#define USE_MEGA_8BIT_SHIELD
#define USE_MEGA_16BIT_SHIELD //RD on PL6 (D43)
//#define USE_BLD_BST_MEGA32U4
//#define USE_BLD_BST_MEGA2560
//#define USE_DUE_8BIT_PROTOSHIELD
//#define USE_DUE_16BIT_SHIELD //RD on PA15 (D24)
//#define USE_BOBCACHELOT_TEENSY
//#define USE_FRDM_K20
Result is same
Serial took 0ms to start
ID = 0xD3D3
Please advice further
I can't suggest anything else. Your Red Shield looks like the regular pinout used by most mega2560 shields.
I would expect you to see something with 16BIT or 8BIT. Even if it was not the correct controller.
You can try ID = 0x6814, 0x8357, 0x9481, 0x9486, 0x9488 with 16BIT and then try those IDs with 8BIT.
Your Shield says 3.5 inch and it looks like a 320x480 shape. So there is little point in trying any 240x400 controllers.
David.