Go Down

Topic: [Solved] 2.4 TFT LCD shield - 0x4747 - SCREEN WHITE (Read 6471 times) previous topic - next topic

david_prentice

What hardware do you have?
Is it Adafruit ?
Is it from Itead ?
Is it a "Mcufriend" Uno shield?

If the ID is reported as 0x7575 you have a HX8347-G controller.

No,  I have never seen or used any of these displays with 8080-8 parallel interface.   I support -A, -D, -G, -I variants in MCUFRIEND_kbv library with feedback from genuine owners.

So I have never tried the Adafruit library.   I would be very suspicious of all the hacked versions of Adafruit_TFTLCD.   But since Adafruit sold these displays I would hope their library is maintained correctly by Adafruit.

I do own Waveshare Shield that has a HX8347-D controller with a write-only SPI interface.

If you look at the source code of my HX8347D_kbv library,  you will see an uncomplicated library.
Both Adafruit_TFTLCD and MCUFRIEND_kbv support multiple controllers.   This makes it harder to understand.

Regarding MADCTL values.   You configure the Panel with the Manufacturer Registers.   e.g. Inverted Colours, RGB / BGR colours, GateScan, ...

Likewise Touch Panels can be glued in any direction.  But once attached,  they always report X, Y values relative to their manufactured connections.   You just run a Calibration sketch to determine X, Y directions and values for LEFT, RT, TOP, BOT.

David.

stern

oh, haven´t seen your answer.

meanwhile my several displays are working  just well.  

i´m using  adafruit  ili 9341 and hi 4747  (7575).

I think this are the last changes id did in cpp.    even the rotation is working.

Code: [Select]

  } else if(driver == ID_7575) {

    uint8_t hi, lo;
    switch(rotation) {
     default: lo = 0   ; break;
     case 1 : lo = 0x20; break;
     case 2 : lo = 0x50; break;
     case 3 : lo = 0xe0; break;
    }
    writeRegister8( HX8347G_MEMACCESS ,lo);//0x50 bei rot 2

    // Only upper-left is set -- bottom-right is full screen default
    writeRegisterPair(HX8347G_COLADDRSTART_HI, HX8347G_COLADDRSTART_LO, x);
    writeRegisterPair(HX8347G_ROWADDRSTART_HI, HX8347G_ROWADDRSTART_LO, y);
    hi = color >> 8; lo = color;
    CD_COMMAND; write8(0x22); CD_DATA; write8(hi); write8(lo);

  } else if ((driver == ID_9341) || (driver == ID_HX8357D)) {
    setAddrWindow(x, y, _width-1, _height-1);
    CS_ACTIVE;
    CD_COMMAND;
    write8(0x2C);
    CD_DATA;
    write8(color >> 8); write8(color);
  }

  CS_IDLE;
}

// Issues 'raw' an array of 16-bit color values to the LCD; used
// externally by BMP examples.  Assumes that setWindowAddr() has
// previously been set to define the bounds.  Max 255 pixels at
// a time (BMP examples read in small chunks due to limited RAM).
void Adafruit_TFTLCD::pushColors(uint16_t *data, uint8_t len, boolean first) {
  uint16_t color;
  uint8_t  hi, lo;
  CS_ACTIVE;
  if(first == true) { // Issue GRAM write command only on first call
    CD_COMMAND;
    if(driver == ID_932X) write8(0x00);
    if ((driver == ID_9341) || (driver == ID_HX8357D)){
       write8(0x2C);
     }  else {
       write8(0x22);
     }
  }
  CD_DATA;
  while(len--) {
    color = *data++;
    hi    = color >> 8; // Don't simplify or merge these
    lo    = color;      // lines, there's macro shenanigans
    write8(hi);         // going on.
    write8(lo);
  }
  CS_IDLE;
}

void Adafruit_TFTLCD::setRotation(uint8_t x) {

  // Call parent rotation func first -- sets up rotation flags, etc.
  Adafruit_GFX::setRotation(x);
  // Then perform hardware-specific rotation operations...

  CS_ACTIVE;
  if(driver == ID_932X) {

    uint16_t t;
    switch(rotation) {
     default: t = 0x1030; break;
     case 1 : t = 0x1028; break;
     case 2 : t = 0x1000; break;
     case 3 : t = 0x1018; break;
    }
    writeRegister16(0x0003, t ); // MADCTL
    // For 932X, init default full-screen address window:
    setAddrWindow(0, 0, _width - 1, _height - 1); // CS_IDLE happens here

  }
 if(driver == ID_7575) {

    uint8_t t;
    switch(rotation) {
     default: t = 0   ; break;
     case 1 : t = 0x20; break;
     case 2 : t = 0x50; break;
     case 3 : t = 0xe0; break;
    }
    writeRegister8(HX8347G_MEMACCESS,t);//0x050   rot2

    // 7575 has to set the address window on most drawing operations.
    // drawPixel() cheats by setting only the top left...by default,
    // the lower right is always reset to the corner.
    setLR(); // CS_IDLE happens here
  }

 if (driver == ID_9341) {
   // MEME, HX8357D uses same registers as 9341 but different values
   uint16_t t;

   switch (rotation) {
   case 2:
     t = ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR;
     break;





the parts destinated to ili9341  ...there MADCTL  is  noted




guy1a

hi all

i am facing this issue of white empty screen.
it identifies as : 0x4747
it is connected to arduino uno.

and i think i found in MCUFRIEND_kbv.cpp support for this kind of lcd.

i was trying to find / understand the reply above my msg. but .. appears to be above my abilities ..


i was also trying the bmp example but got only bad location reply in the com terminal screen.

any help will be appreciated.

thank you.

david_prentice

Make sure that you install/upgrade MCUFRIEND_kbv, Adafruit_GFX, TouchScreen libraries from the IDE Library Manager.

Edit MCUFRIEND_kbv.cpp  change this line from:
Code: [Select]

//#define SUPPORT_8347D             //HX8347-D, HX8347-G, HX8347-I, HX8367-A +520 bytes, 0.27s

to this:
Code: [Select]

#define SUPPORT_8347D             //HX8347-D, HX8347-G, HX8347-I, HX8367-A +520 bytes, 0.27s


That is all there is to it.   Removing the two // slash characters.

David.

guy1a


simoninthelakes

Thank you for your guidance here David, and all the related MCUFRIEND work over on GutHub, much appreciated!

Ricardo_da_Silva

Hello!

I´m having the white screen problem with my TFT Touch screen too...  :smiley-confuse:
I´ve tried to solve the problem like you said but i can´t!

This is the link of the product!
https://www.electrofun.pt/arduino/display-lcd-touchscreen-shield-arduino

david_prentice

Thanks for the link.  It shows a red shield with yellow header pins and an AMS1117 regulator U1.   The text says that it has an ILI9341 controller.

Please confirm whether the photos of the pcb are accurate.
Please confirm the ID that is reported on the Serial Terminal e.g. from graphictest_kbv or diagnose_TFT_support

Follow the instructions in #18
Make notes on paper.

Please type from paper notes to your message.
Please copy-paste any messages from the Serial Terminal.   (Click on the Terminal Screen.  Press ctl-A ctl-C to copy.  Press ctl-V to paste to your message.)

David.

Ricardo_da_Silva

I have the product in front of me and it is the same but this my first time ever using an Arduino.... :smiley-confuse:

I´ve followed the instructions but the controller ILI9341 doesn´t even appear on the document...

Ricardo_da_Silva

Comparing the pcb photos there are some differences...

david_prentice

#25
May 22, 2019, 03:30 pm Last Edit: May 22, 2019, 03:30 pm by david_prentice
You do not need to understand technical things.
Just describe the difference(s) between the pcb and the photos on the link e.g.
1.  colour of header pins.   Yellow or Black?
2.  presence of regulator U1.  Yes or No?

Do you know how to run the Serial Terminal? Click the icon at the top-right of your Sketch window.  Set to 9600 baud.

Do you know how to install Libraries?

Everyone has to start with Arduino.   There are a lot of things to learn.   Many are intuitive if you are familiar with a PC.

If English is not your first language,  use Google to translate.

David.

Ricardo_da_Silva

1- The header pins are yellow

2 - Yes
     
     
the only difference is that there are not those two small components called C1 and C2 (as you can see in the link photo) and the other "components" are in slightly diffrent positions...

I don´t think so...  :smiley-confuse: i can´t find the option to change that to 9600 baud. ( i´m using IDE on Windows).

Yes i think so but it´s better if you tell me the right way to install them so i can confirm please.

thanks for all the help you´re providing!


david_prentice

Quote
Make sure that you install/upgrade MCUFRIEND_kbv, Adafruit_GFX, TouchScreen libraries from the IDE Library Manager.
Sketch->Include Library->Manage Libraries...  (works with all IDEs)

Then search for "kbv" or "GFX" to find the library.   Click on [Upgrade] or [Install]

The current IDE v1.8.9 can reach the Library Manager via  Tools->Library Manager

Regarding Serial Terminal:
1.  did you see any text ?
2.  have you tried to copy-paste ?

David.

Ricardo_da_Silva


ok the libraries are ready and I downloaded the touch screen library from the internet and then I used the function: add zip library.


When I ran the diagnostic_TFT_suport and opened the Terminal Serial appeared this:


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

tft.readID() finds: ID = 0x0

MCUFRIEND_kbv version: 2.9.8


This ID is not supported
look up ID in extras/mcufriend_how_to.txt
you may need to edit MCUFRIEND_kbv.cpp
to enable support for this ID
e.g. #define SUPPORT_8347D

New controllers appear on Ebay often
If your ID is not supported
run LCD_ID_readreg.ino from examples/
Copy-Paste the output from the Serial Terminal
to a message in Displays topic on Arduino Forum
or to Issues on GitHub

Note that OPEN-SMART boards have diff pinout
Edit the pin defines in LCD_ID_readreg to match
Edit mcufiend_shield.h for USE_SPECIAL
Edit mcufiend_special.h for USE_OPENSMART_SHIELD_PINOUT

Go Up