Go Down

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

david_prentice

I would still try all the other 320x480 controllers.

Since you have a Uno Shield with HX8357-D you know every colour and direction for each test.
There is no point in mailing anything now that you have it working.

It does seem a little odd to provide for 16-bit interface and only use 8-bit.
You have probably noticed that the Mega is faster than the Uno when you have a "straight" PORTA instead of random pins.   The full 16-bits would be even faster.

David.

Jmartens1114

Hi David
It's coming your way this week. I have two more coming in mail. I wrote this one as a loss. So I prefer you finish testing. Thanks again

Jmartens1114

good day to everyone!
ive been checking all my tft lcd for id and i came across a ID 0x9302.
it works with david prentice library right out of box.
its a red 2.4 mcufriend and i was wondering if thats a normal model number
or if theres a chart that references any cross over model numbers?
sorry for dumb question, im still trying to learn more.

david_prentice

Simple answer:   I don't know who makes the 0x9302 controller.

It does not appear on the Ilitek website.   But I have several Ilitek datasheets for controllers not mentioned on their current website.

Note that "other" manufacturers produce controllers with ID=0x9325 and ID=0x9486.

I suspect that 0x9302 is made by a different company from Ilitek.
If it works ok,  just be happy.

David.

foobarrer

What is the controller IC of the 3.5 inch mcufriend TFT LCD according to the info below?

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) 00 00 80 00   Manufacturer ID
reg(0x0009) 00 00 00 00 00   Status Register
reg(0x000A) 08 08   Get Powsr Mode
reg(0x000C) 66 66   Get Pixel Format
reg(0x0061) 00 00   RDID1 HX8347-G
reg(0x0062) 00 00   RDID2 HX8347-G
reg(0x0063) 00 00   RDID3 HX8347-G
reg(0x0064) 00 00   RDID1 HX8347-A
reg(0x0065) 00 00   RDID2 HX8347-A
reg(0x0066) 00 00   RDID3 HX8347-A
reg(0x0067) 00 00   RDID Himax HX8347-A
reg(0x0070) 00 00   Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00   RD_DDB SSD1963
reg(0x00B0) 00 00   RGB Interface Signal Control
reg(0x00B4) 0C 0C   Inversion Control
reg(0x00B6) 02 02 08 08 08   Display Control
reg(0x00B7) 00 00   Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00   ILI9481, HX8357-B
reg(0x00C0) 44 44 44 10 10 00 00 00 00   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 00   Power Control
reg(0x00D2) 80 80 00 00 00   NVM Read
reg(0x00D3) 00 00 00 00   ILI9341, ILI9488
reg(0x00DA) 00 00   RDID1
reg(0x00DB) 80 80   RDID2
reg(0x00DC) 00 00   RDID3
reg(0x00E0) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   GAMMA-P
reg(0x00E1) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   GAMMA-N
reg(0x00EF) 00 00 00 00 00 00   ILI9327
reg(0x00F2) F1 F1 54 A5 24 1E 44 90 02 2C 2C 32   Adjust Control 2
reg(0x00F6) 00 00 3A 00   Interface Control

david_prentice

You have a Himax HX8357-D.   The current library should recognise it.

Since you probably have a pre-v2.9.3 version,   you should delete the library folder.
Then install from the Library Manager.

David.

foobarrer

Thanks David. How to decode the register read result to know the exact controller IC? There are several IC mentioned, that is why it is very confusing to me.

david_prentice

Just look at the library source code.
Most non-MIPI controllers have ID in reg(0x00)
Most MIPI ones use reg 0xBF, 0xD3, 0xEF.

Problems begin when Himax enter the game.
And Renesas denies access to the ID register by default.   e.g. R61526

Sometimes two manufacturers return the same ID for different devices e.g. Himax HX8347-B returns 0x9325 in reg(0x00).   Raydium RM68140 returns 0x9486 from reg(0xD3)

The general advice is: Paste the LCD_ID_readreg output from the Serial Terminal.
Strange new displays appear on the Ebay / AliExpress market all the time.
Verify any photos on the website with your item.   Post a link so that others can see what you have bought.

David.

foobarrer

Thanks David.

I downloaded the latest mcufriend_kbv master lib and run the LCD_ID_readreg.ino again and I attached the result below. Register 0x00 0xBF 0xD3 0xEF are all 00, does it mean if we get 00 result from reading these registers then the controller IC should be HX8357-D?

By the way, I bought it on eBay, here is the link of the item http://www.ebay.com/itm/401202226171?_trksid=p2057872.m2748.l2649&ssPageName=STRK%3AMEBIDX%3AIT

Pictures of the LCD I received, a little different from the item's pictures on eBay.



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) 00 00 80 00   Manufacturer ID
reg(0x0009) 00 00 00 00 00   Status Register
reg(0x000A) 08 08   Get Powsr Mode
reg(0x000C) 66 66   Get Pixel Format
reg(0x0061) 00 00   RDID1 HX8347-G
reg(0x0062) 00 00   RDID2 HX8347-G
reg(0x0063) 00 00   RDID3 HX8347-G
reg(0x0064) 00 00   RDID1 HX8347-A
reg(0x0065) 00 00   RDID2 HX8347-A
reg(0x0066) 00 00   RDID3 HX8347-A
reg(0x0067) 00 00   RDID Himax HX8347-A
reg(0x0070) 00 00   Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00   RD_DDB SSD1963
reg(0x00B0) 00 00   RGB Interface Signal Control
reg(0x00B4) 0C 0C   Inversion Control
reg(0x00B6) 02 02 08 08 08   Display Control
reg(0x00B7) 00 00   Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00   ILI9481, HX8357-B
reg(0x00C0) 44 44 44 10 10 00 00 00 00   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 00   Power Control
reg(0x00D2) 80 80 00 00 00   NVM Read
reg(0x00D3) 00 00 00 00   ILI9341, ILI9488
reg(0x00DA) 00 00   RDID1
reg(0x00DB) 80 80   RDID2
reg(0x00DC) 00 00   RDID3
reg(0x00E0) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   GAMMA-P
reg(0x00E1) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   GAMMA-N
reg(0x00EF) 00 00 00 00 00 00   ILI9327
reg(0x00F2) F1 F1 54 A5 24 1E 44 90 02 2C 2C 32   Adjust Control 2
reg(0x00F6) 00 00 3A 00   Interface Control



david_prentice

Life is becoming easier.   The shields often have a sticky label:  35310
This is another good clue.

My earlier reply was a little premature.   I saw reg(0x0004) with xx 00 80 00 which might be HX8357-D.
However I then need to write a special value to reg(0xB9) and read reg(0xD0) to confirm.

I will try to find a datasheet for "NT35310" or RM68042 and come back to you.
Edit. I have found RM68042 datasheet and your device is not a RM68042.

David.

joe_smits

Hello to everyone!
What is the controller IC of the 2.4 inch mcufriend (red pcb, 8-bit parallel interface) TFT LCD according to the info below?
I bought it on aliexpress, here is the link of the item https://ru.aliexpress.com/item/LCD-module-TFT-2-4-inch-TFT-LCD-screen-for-Arduino-UNO-R3-Board-and-support/32653693580.html?spm=2114.13010608.0.0.DOvj4g
Pictures of the LCD I received, a little different from the item's pictures on ali.

    readReg(0x00, 2)  0x00, 0x00  ID: ILI9320, ILI9325, ILI9335, ...
    readReg(0x04, 4)  0x00, 0x00, 0x00, 0x00 Manufacturer ID
    readReg(0x09, 5)  0x00, 0x00, 0x61, 0x00, 0x00 Status Register
    readReg(0x0A, 2)  0x00, 0x08 Get Powsr Mode
    readReg(0x0C, 2)  0x00, 0x06 Get Pixel Format
    readReg(0x61, 2)  0x06, 0x06 RDID1 HX8347-G
    readReg(0x62, 2)  0x06, 0x06 RDID2 HX8347-G
    readReg(0x63, 2)  0x06, 0x06 RDID3 HX8347-G
    readReg(0x64, 2)  0x06, 0x06 RDID1 HX8347-A
    readReg(0x65, 2)  0x06, 0x06 RDID2 HX8347-A
    readReg(0x66, 2)  0x06, 0x06 RDID3 HX8347-A
    readReg(0x67, 2)  0x06, 0x06 RDID Himax HX8347-A
    readReg(0x70, 2)  0x06, 0x06 Panel Himax HX8347-A
    readReg(0xA1, 5)  0x06, 0x06, 0x06, 0x06, 0x06 RD_DDB SSD1963
    readReg(0xB0, 2)  0x06, 0x00 RGB Interface Signal Control
    readReg(0xB4, 2)  0x00, 0x02 Inversion Control
    readReg(0xB6, 5)  0x02, 0x0A, 0x82, 0x27, 0x04 Display Control
    readReg(0xB7, 2)  0x04, 0x07 Entry Mode Set
    readReg(0xBF, 6)  0x07, 0x00, 0x00, 0x00, 0x00, 0x00 ILI9481, HX8357-B
    readReg(0xC0, 9)  0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 Panel Control
    readReg(0xC8, 13)  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 GAMMA
    readReg(0xCC, 2) 0x00, 0x3A Panel Control
    readReg(0xD0, 3) 0x3A, 0x00, 0x00 Power Control
    readReg(0xD2, 5) 0x00, 0x00, 0x00, 0x03, 0x03 NVM Read
    readReg(0xD3, 4)  0x03, 0x00, 0x93, 0x40 ILI9341, ILI9488
    readReg(0xDA, 2)  0x00, 0x00  RDID1
    readReg(0xDB, 2)  0x00, 0x00  RDID2
    readReg(0xDC, 2)  0x00, 0x00  RDID3
    readReg(0xE0, 16)  0x00, 0x08, 0x0E, 0x12, 0x05, 0x03, 0x09, 0x47, 0x86, 0x2B, 0x0B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 GAMMA-P
    readReg(0xE1, 16)  0x00, 0x08, 0x1A, 0x20, 0x07, 0x0E, 0x05, 0x3A, 0x8A, 0x40, 0x04, 0x18, 0x0F, 0x3F, 0x3F, 0x0F GAMMA-N
    readReg(0xEF, 6)  0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F ILI9327
    readReg(0xF2, 12)  0x0F, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 Adjust Control 2
    readReg(0xF6, 4); // 0x02, 0x01, 0x00, 0x00  Interface Control

This tft lcd module is connected to stm32 board. It seems that readReg output looks good and i believe that all wire soldered well.
From this string (readReg(0xD3, 4)  0x03, 0x00, 0x93, 0x40 ILI9341, ILI9488) i see that i have ili9340 controller probably.
So i download lastest MCUFRIEND_kbv-master and look for init code for ili9340 chip.
The first code, labeled as "BOE 2.4" give me black screen with slow weak flickering. I try fill screen function with red color - nothing happens on lcd.
The second code, labeled as "Adafruit_TFTLCD" giv e me white screen. If i try fill screen with red color - i got black screen. Any color (white, red, blue ... any) give me black screen.

questions:
1. What is the controller IC?
2. if IC is ili9430 - what is correct init code ?

Joe.

sorry for terrible english

david_prentice

You have an ILI9340.   It is very similar to the ILI9341.   If you try the Beta library on GitHub,  ID=0x9340 will use the 0x9341 initialisation.

If you have an earlier version,  I suggest that you force tft.begin(0x9341) and report back.

If your ILI9340 does not work with 0x9341,  I will post a test_9340 branch on GitHub for you.

How did you get such an unusual output from LCD_ID_readreg.ino?   i.e. all those commas

David.

joe_smits

thanks for your reply.
I have already tried the beta version from GitHub. It does not work for me.
Here my init code:
uint8_t ILI9340_5[] = { //
  0x01, TFTLCD_DELAY, 200,  // 200 ms waits
  0x28, 0,              // Display Off
  0xF6, 3, 0x01, 0x00, 0x00,  //Interface Control needs EXTC=1
  0xB0, 1, 0x40,      //RGB Signal [00]
  0xB1, 2, 0x00, 0x1B,        //Frame Control [00 1B]
  0xC0, 2, 0x26, 0x00,     //Power Control 1 [26]
  0xC1, 1, 0x00,      //Power Control 2 [00]
  0xC5, 2, 0x31, 0x3C,        //VCOM 1 [31 3C]
  0xC7, 1, 0xC0,      //VCOM 2 [C0]
  0x36, 1, 0x48,      //Memory Access [00]
  0x3A, 1, 0x55,
  0x26, 1, 0x01,      //Gamma Set [01]
  0xE0, 15, 0x0f, 0x26, 0x24, 0x0b, 0x0e, 0x09, 0x54, 0xa8, 0x46, 0x0c, 0x17, 0x09, 0x0f, 0x07, 0x00,
  0xE1, 15, 0x00, 0x19, 0x1b, 0x04, 0x10, 0x07, 0x2a, 0x47, 0x39, 0x03, 0x06, 0x06, 0x30, 0x38, 0x0f,
  0x11, TFTLCD_DELAY, 200,
  0x29, 0,               // Display On
  0xFF                  // end of list
};

I have my own function readReg (void readReg (uint16_t reg, uint8_t n)). I does not use LCD_ID_readreg.ino

Joe

david_prentice

Your 0xFF for end of list will crash the library.    In fact your table is seriously wrong.

Would you like me to create a test_9340 branch on GitHub?   Or do you prefer to "do your own function"?

David.

joe_smits

which command in table have the wrong parameters? (except the last 0xFF)

Don't create branch on GitHub. Can you show the correct init sequence for ili9340?

Joe

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy