Go Down

Topic: mcufriend 2.8 inch TFT LCD display issues (Read 79222 times) previous topic - next topic

david_prentice

@Joe,

Please don't PM.   Ask questions in the public forum e.g. here.

If the Software Scroll is working properly,   the readPixel_kbv example should work too.

Yes,  you can read any rectangular block of screen memory.   You obviously need a big enough buffer to receive the data.

If you explain what you want to do,   someone might show you how to.
Pictures are better than words.   So draw a pencil picture or diagram of before and after.   Remember that many readers are not English but they can all understand pictures.

David.

Joe Engineer

We seem to be talking past each other...

Since I am new to the forum, my basic question is should I start a new thread, or continue with this one (after all, I am using a 2.4" display and not the 2.8" display - but I believe that I have the HX8347-G controller ID 0x7575).

OK - now that we have that out of the way:

I have gone back to the colordump function, and if I look at the pixels read with 'readPixel' then I seem to get results that make sense, but the bits that I am reading are not in the same order that I am writing them.  When I read back a 'yellow' pixel (0xFFE0) I get back 0xFCFC.  

I was quite excited when I saw the '5' in the pixel dump - finally it was starting to make sense.

I believe that the color order is not correct, I will have to do some more experimentation (and bit mapping) to figure out where the bits are going.

Is there anything else that I can provide you to help me figure out what is going on with the readGRAM function?


In my example I am writing a yellow pixel, to a variety of backgrounds, and reading back the pixels using readPixel:

Code: [Select]
ID=0x7575 Background=0000 PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC 0000
 36,  1: FCFC 0000 0000 0000 0000 0000
 36,  2: FCFC FCFC FCFC FCFC 0000 0000
 36,  3: 0000 0000 0000 0000 FCFC 0000
 36,  4: 0000 0000 0000 0000 FCFC 0000
 36,  5: FCFC 0000 0000 0000 FCFC 0000
 36,  6: 0000 FCFC FCFC FCFC 0000 0000
 36,  7: 0000 0000 0000 0000 0000 0000
 36,  8: 0000 0000 0000 0000 0000 0000
 36,  9: 0000 0000 0000 0000 0000 0000
 36, 10: 0000 0000 0000 0000 0000 0000

ID=0x7575 Background=001F PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC 0000
 36,  1: FCFC 0000 0000 0000 0000 0000
 36,  2: FCFC FCFC FCFC FCFC 0000 0000
 36,  3: 0000 0000 0000 0000 FCFC 0000
 36,  4: 0000 0000 0000 0000 FCFC 0000
 36,  5: FCFC 0000 0000 0000 FCFC 0000
 36,  6: 0000 FCFC FCFC FCFC 0000 0000
 36,  7: 0000 0000 0000 0000 0000 0000
 36,  8: 0000 0000 0000 0000 0000 0000
 36,  9: 0000 0000 0000 0000 0000 0000
 36, 10: 0000 0000 0000 0000 0000 0000

ID=0x7575 Background=F800 PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC FC00
 36,  1: FCFC FC00 FC00 FC00 FC00 FC00
 36,  2: FCFC FCFC FCFC FCFC FC00 FC00
 36,  3: FC00 FC00 FC00 FC00 FCFC FC00
 36,  4: FC00 FC00 FC00 FC00 FCFC FC00
 36,  5: FCFC FC00 FC00 FC00 FCFC FC00
 36,  6: FC00 FCFC FCFC FCFC FC00 FC00
 36,  7: FC00 FC00 FC00 FC00 FC00 FC00
 36,  8: FC00 FC00 FC00 FC00 FC00 FC00
 36,  9: FC00 FC00 FC00 FC00 FC00 FC00
 36, 10: FC00 FC00 FC00 FC00 FC00 FC00

ID=0x7575 Background=F81F PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC FC00
 36,  1: FCFC FC00 FC00 FC00 FC00 FC00
 36,  2: FCFC FCFC FCFC FCFC FC00 FC00
 36,  3: FC00 FC00 FC00 FC00 FCFC FC00
 36,  4: FC00 FC00 FC00 FC00 FCFC FC00
 36,  5: FCFC FC00 FC00 FC00 FCFC FC00
 36,  6: FC00 FCFC FCFC FCFC FC00 FC00
 36,  7: FC00 FC00 FC00 FC00 FC00 FC00
 36,  8: FC00 FC00 FC00 FC00 FC00 FC00
 36,  9: FC00 FC00 FC00 FC00 FC00 FC00
 36, 10: FC00 FC00 FC00 FC00 FC00 FC00


Using readGRAM:
Code: [Select]

readID = 0x7575
ID=0x7575 Background=0000 PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  1: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  2: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  3: 0000 0000 0000 0000 0000 0000
 36,  4: 0000 0000 0000 0000 0000 0000
 36,  5: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  6: 0000 0000 0000 0000 0000 0000
 36,  7: 0000 0000 0000 0000 0000 0000
 36,  8: 0000 0000 0000 0000 0000 0000
 36,  9: 0000 0000 0000 0000 0000 0000
 36, 10: 0000 0000 0000 0000 0000 0000

ID=0x7575 Background=001F PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  1: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  2: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  3: 0000 0000 0000 0000 0000 0000
 36,  4: 0000 0000 0000 0000 0000 0000
 36,  5: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  6: 0000 0000 0000 0000 0000 0000
 36,  7: 0000 0000 0000 0000 0000 0000
 36,  8: 0000 0000 0000 0000 0000 0000
 36,  9: 0000 0000 0000 0000 0000 0000
 36, 10: 0000 0000 0000 0000 0000 0000

ID=0x7575 Background=F800 PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  1: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  2: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  3: FC00 FC00 FC00 FC00 FC00 FC00
 36,  4: FC00 FC00 FC00 FC00 FC00 FC00
 36,  5: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  6: FC00 FC00 FC00 FC00 FC00 FC00
 36,  7: FC00 FC00 FC00 FC00 FC00 FC00
 36,  8: FC00 FC00 FC00 FC00 FC00 FC00
 36,  9: FC00 FC00 FC00 FC00 FC00 FC00
 36, 10: FC00 FC00 FC00 FC00 FC00 FC00

ID=0x7575 Background=F81F PORTRAIT
 36,  0: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  1: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  2: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  3: FC00 FC00 FC00 FC00 FC00 FC00
 36,  4: FC00 FC00 FC00 FC00 FC00 FC00
 36,  5: FCFC FCFC FCFC FCFC FCFC FCFC
 36,  6: FC00 FC00 FC00 FC00 FC00 FC00
 36,  7: FC00 FC00 FC00 FC00 FC00 FC00
 36,  8: FC00 FC00 FC00 FC00 FC00 FC00
 36,  9: FC00 FC00 FC00 FC00 FC00 FC00
 36, 10: FC00 FC00 FC00 FC00 FC00 FC00

david_prentice

What happens when you run graphictest_kbv?
Do you get a readPixel() error?
Or do you get the "SOFTWARE SCROLL" text moving horizontally across the screen?

If readPixel says 24bit,   you should add the READ_24BIT to the attributes

It looks as if readGRAM() is not auto-incrementing.    So you remove that attribute.

No,   2.4" or 2.8" screen should make no difference to the logic.   It is likely that you need different Gamma for a different Panel.   Possibly a different direction (mirror) but unlikely.

David.

Joe Engineer

I think that  finally figured out what is going on with your library, and now that I think I have a solution, I think that I might have 'fried' my TFT display.

In playing with the flags for the HD-8347-D (id=0x7575), I did not realize that I also had to add the  'goto common_8347DGI;' line to skip over the balance of the case statement.

In my 'experimentation', I am not sure what flat I set (maybe INVERT_SS), but now my display is all WHITE - even after power cycling and reloading of code.

Did I damage my screen?  (If so, aside from being out $4, I have to start over, as I will probably get a different TFT driver from ebay  :smiley-confuse:  ).

It seems that I can still read data from the screen, but it does not seem to change as it did before (i.e. not incrementing?). 


Uploading graphictest_kbv just causes the white screen to flash a bit.  (This used to work fine.)

Output below:
Code: [Select]
readID = 0x7575
flags at end: 1401
ID=0x7575 Background=0000 PORTRAIT
 36,  0: 0000 0000 0000 0000 0000 0000
 36,  1: 0000 0000 0000 0000 0000 0000
 36,  2: 0000 0000 0000 0000 0000 0000
 36,  3: 0000 0000 0000 0000 0000 0000
 36,  4: 0000 0000 0000 0000 0000 0000
 36,  5: 0000 0000 0000 0000 0000 0000
 36,  6: 0000 0000 0000 0000 0000 0000
 36,  7: 0000 0000 0000 0000 0000 0000
 36,  8: 0000 0000 0000 0000 0000 0000
 36,  9: 0000 0000 0000 0000 0000 0000
 36, 10: 0000 0000 0000 0000 0000 0000

ID=0x7575 Background=001F PORTRAIT
 36,  0: 001C 1C00 001C 1C00 001C 1C00
 36,  1: 001C 1C00 001C 1C00 001C 1C00
 36,  2: 001C 1C00 001C 1C00 001C 1C00
 36,  3: 001C 1C00 001C 1C00 001C 1C00
 36,  4: 001C 1C00 001C 1C00 001C 1C00
 36,  5: 001C 1C00 001C 1C00 001C 1C00
 36,  6: 001C 1C00 001C 1C00 001C 1C00
 36,  7: 001C 1C00 001C 1C00 001C 1C00
 36,  8: 001C 1C00 001C 1C00 001C 1C00
 36,  9: 001C 1C00 001C 1C00 001C 1C00
 36, 10: 001C 1C00 001C 1C00 001C 1C00

ID=0x7575 Background=F800 PORTRAIT
 36,  0: F800 00F8 F800 00F8 F800 00F8
 36,  1: F800 00F8 F800 00F8 F800 00F8
 36,  2: F800 00F8 F800 00F8 F800 00F8
 36,  3: F800 00F8 F800 00F8 F800 00F8
 36,  4: F800 00F8 F800 00F8 F800 00F8
 36,  5: F800 00F8 F800 00F8 F800 00F8
 36,  6: F800 00F8 F800 00F8 F800 00F8
 36,  7: F800 00F8 F800 00F8 F800 00F8
 36,  8: F800 00F8 F800 00F8 F800 00F8
 36,  9: F800 00F8 F800 00F8 F800 00F8
 36, 10: F800 00F8 F800 00F8 F800 00F8

ID=0x7575 Background=F81F PORTRAIT
 36,  0: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  1: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  2: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  3: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  4: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  5: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  6: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  7: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  8: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36,  9: F81C 1CF8 F81C 1CF8 F81C 1CF8
 36, 10: F81C 1CF8 F81C 1CF8 F81C 1CF8




david_prentice

Surely you can delete the current library.  i.e. leave the IDE.  delete library folder.

Then start the IDE.  Install the v2.9.5 Library with the Library Manager.

Add the patches that I posted.

But most importantly,   say exactly what happens.

It looks like you should have READ_24BITS attribute.   But hey-ho,  you said that Software Scroll was working.

David.

Joe Engineer

#140
May 08, 2017, 01:55 am Last Edit: May 08, 2017, 02:45 am by Joe Engineer Reason: fixed case statement
You were right - I reinstalled the latest library version from GITHUB (v2.9.5)

Modified MCUGRIEND_kbv.cpp to just define the HX8347-G and then added the case statement below.

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


case 0x7575:       //HX8347-G
  _lcd_capable = REV_SCREEN | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | AUTO_READINC;
  goto common_8347DGI;


It now appear that the library is reading back the data as expected for both readPixel and readGRAM.

How do I know that the other flags are correct?  Should any other ones be turned on?

Are there any other tests that you want me to run before you commit changes to you code to support the HX8347-G?

david_prentice

Well,  if the BAND SCROLL, SOFTWARE SCROLL, colours, inversion, directions all work in graphictest_kbv,   you must have everything ok.

And your readpixel_kbv sketch should work ok with readGRAM()

I do not own a readable HX8347 or HX8367.   So I have to rely on feedback from owners.

David.

Go Up