Go Down

Topic: MCUFRIEND_kbv Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields (Read 483302 times) previous topic - next topic

david_prentice

You should edit the defines in LCD_ID_readreg to match your wiring.

Then post the defines here.

Seriously.    God invented Shields.    Use them.
If you want speed with a Mega2560 buy a Mega Display Shield in the first place.

Or hand wire and solder a Mega Protoshield to work as an Adapter for the Uno Shield.

David.

Khalil-Errahmane

I ran the graphictest_kbv example setting tft.begin(ID) in setup() to tft.begin(0x9320).
Now! the good thing is I'm seeing frames changing, colors.. but the display is unstable and frames seem to overlap! it is not working properly!!!
the Serial monitor is showing the following msg:
___________________
Serial took 0ms to start
ID = 0x8A28
___________________

david_prentice

Well,   at least you have got something.    Colours and directions are easy to fix.

Unstable displays are very difficult unless I have the same display on my desk.

Read the mcufriend_how_to.txt
You can try other 0x9320-style controllers e.g. 0x9325, 0x7783, 0x4532, 0x4535, 0x0154, 0x0139, 0x5408, 0x1580
Note that some of these require enabling a SUPPORT_xxxx define

David.

skala

So far i have handmade shield, from UNO display to MEGA according to definition....... i want to test if will work,.....

after your reccomendation i wrote this definition:
#define LCD_RST A4
#define LCD_CS A3
#define LCD_RS A2
#define LCD_WR A1
#define LCD_RD A0

#define LCD_D0 22
#define LCD_D1 23
#define LCD_D2 24
#define LCD_D3 25
#define LCD_D4 26
#define LCD_D5 27
#define LCD_D6 28
#define LCD_D7 29

and  put in to sketch  "LCD_ID_readreg.ino"  and finally i have answer from display :
reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 FE FE FE Manufacturer ID
reg(0x0009) 09 09 09 09 09 Status Register
reg(0x000A) 00 00 Get Power Mode
reg(0x000C) 64 64 Get Pixel Format
reg(0x0061) 01 01 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 01 01 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 01 01 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 01 01 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 01 01 01 01 01 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 02 02 Inversion Control
reg(0x00B6) 04 04 04 04 04 Display Control
reg(0x00B7) 05 05 Entry Mode Set
reg(0x00BF) 01 01 01 01 01 01 ILI9481, HX8357-B
reg(0x00C0) 80 26 00 00 00 00 00 00 80 Panel Control
reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 00 Panel Control
reg(0x00D0) 00 00 FE Power Control
reg(0x00D2) 00 00 76 94 00 NVM Read
reg(0x00D3) 01 01 77 95 ILI9341, ILI9488
reg(0x00D4) 00 FE FE FE Novatek ID
reg(0x00DA) FE FE RDID1
reg(0x00DB) FF FF RDID2
reg(0x00DC) 04 36 RDID3
reg(0x00E0) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA-P
reg(0x00E1) F1 03 07 0B 0D 0F 3D 77 4F 0F 17 17 23 23 01 01 GAMMA-N
reg(0x00EF) 01 01 01 00 00 01 ILI9327
reg(0x00F2) F8 E4 F0 00 00 00 00 00 00 00 00 00 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

that is fine, but when I put the same definitions in to "graphictest_kbv.ino"  - my screen is still gray, ...

Khalil-Errahmane

I got curious, so I tried other SUPPORT_xxxx define, i found out that when i use the 0x8230 the display turns stable, still, there is a problem of overlapping.. Any other 0x8230-style controllers?
Thanks :)

david_prentice

@skala,

Code: [Select]
reg(0x00D3) 01 01 77 95 ILI9341, ILI9488
You have a Sitronix ST7795

There is a ready-made SPECIAL i.e. #define USE_MEGA_8BIT_PROTOSHIELD

Follow the instructions in mcufriend_how_to.txt
You do not change the sketch.

David.

david_prentice

@Khalil,

I forgot about the UC8230.

If you can post a video of the "most stable" display,   we will see how to get you going.
Don't worry about colours, directions.

David.

skala

Hello David !
Thanks for your help ! Finally I have picture on display !  There was 2 problems - the first  - the right definition of shield  (#define USE_MEGA_8BIT_PROTOSHIELD  -  your help) , and second problem  -  I had too long wires for data D0-D7 (about 15cm). I made the wires more short and picture on displej is stable.  I tried touch as well ( I changed  D6,D7 to D28,D29) - working well, .... thanks a lot for your help again !!!!! 
Skala

valmor_jr

Good morning, I'm trying to use the mcufriend_kvb library on my arduino uno with tft 2.4 ILI9340, was the only library that can make the sdhc 8gb card work, but the colors are wrong, a rgb image I have, instead the colors appear, red cyan appears, green appears purple and blue appears tan, I'm using the mcufriend_kvb showBMP_kvb_uno library example,
thanks

david_prentice

Run the graphictest_kbv example.

Observe the colours in the Penguin screens.
At the end of the Penguins there is "INVERT SCREEN".

If the colours are wrong in Penguins but correct in "INVERT DISPLAY" there are two fixes.

1.  call tft.invertDisplay(1) in your setup() function.
2.  or edit MCUFRIEND_kbv.cpp e.g. remove the REV_SCREEN attribute
Code: [Select]

    case 0x9340:                //ILI9340 thanks Ravi_kanchan2004.
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN;
        goto common_9341;


(2) is a better fix.    It is not unusual to have panels with different characteristics.  I just try to post the "most common" type

David.

david_prentice

Did you remove the REV_SCREEN attribute?
i.e. you have the same attributes as 0x9341

David.

valmor_jr

I applied invert at the beginning of setup, but without success, I applied invert at the end of setup, and now it's working perfectly,
thanks for the help david

david_prentice

invertDisplay() in setup() is fine for most programs.

It is no good for graphictest_kbv.ino because I change the invertDisplay() in loop()

Editing the CPP file is a better solution.

valmor_jr

Perfect friend, I will make this change in cpp. again thanks for the help

valmor_jr

even removing REV_SCREEN from the cpp file. the image is still wrong colors, only the last image penguin is correct

Go Up