Go Down

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

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

joe_smits

just test next init code (from GitHub):

uint8_t ILI9340_6[] = { //
  0xF6, 3, 0x01, 0x01, 0x00,  //Interface Control needs EXTC=1 MV_EOR=0, TM=0, RIM=0
  0xCF, 3, 0x00, 0x81, 0x30,  //Power Control B [00 81 30]
  0xED, 4, 0x64, 0x03, 0x12, 0x81,    //Power On Seq [55 01 23 01]
  0xE8, 3, 0x85, 0x10, 0x78,  //Driver Timing A [04 11 7A]
  0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02,      //Power Control A [39 2C 00 34 02]
  0xF7, 1, 0x20,      //Pump Ratio [10]
  0xEA, 2, 0x00, 0x00,        //Driver Timing B [66 00]
  0xB0, 1, 0x00,      //RGB Signal [00]
  0xB1, 2, 0x00, 0x1B,        //Frame Control [00 1B]
//            0xB6, 2, 0x0A, 0xA2, 0x27, //Display Function [0A 82 27 XX]    .kbv SS=1 
  0xB4, 1, 0x00,      //Inversion Control [02] .kbv NLA=1, NLB=1, NLC=1
  0xC0, 1, 0x21,      //Power Control 1 [26]
  0xC1, 1, 0x11,      //Power Control 2 [00]
  0xC5, 2, 0x3F, 0x3C,        //VCOM 1 [31 3C]
  0xC7, 1, 0xB5,      //VCOM 2 [C0]
  0x36, 1, 0x48,      //Memory Access [00]
  0xF2, 1, 0x00,      //Enable 3G [02]
  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
};

the screen went black, and has a slight flicker.

david_prentice

I have created a test_9340 branch.   You can see where your "syntax" was wrong.

Please tell me whether the ILI9340_regValues_ada table works.   And then try the ILI9340_5 and ILI9340_6 tables.

Which target are you building for?
The tables must be 100% accurate format.   If the target is Harvard,  SRAM tables and Flash tables are different.   On an ARM,  your definition does not matter.

David.

Edit.   Ilitek publish App Notes for ILI9341 e.g. Initialisation sequences for different panels
Similar App Notes are published for ILI9163, ILI9481, ILI9486, ...
I can't find one for an ILI9340.

joe_smits

i test three init code from branch on GitHub.
1. ILI9340_regValues_ada give me white screen. One line of pixels flickers. Writing data to graphics memory does not affect the screen.
2. ILI9340_5 - white screen, but not as bright as in the case ILI9340_regValues_ada. Writing data to graphics memory does affect the screen. But i get only one color - black.
3. ILI9340_6 - black screen with weak flickering. Writing data to graphics memory does not affect the screen.

my target is stm32f103rb.
thank you for pdf "Initialisation sequences for different panels". i did not see it before. i will try tomorrow.

david_prentice

Are you sure that everything else is working?
Shields are easiest to test on a Uno.   Or on a NUCLEO-F103RB

i.e. are all other shields working correctly?   e.g. ILI9341

If you look in extras/ili9341_init.h you will see some machine generated sequences.  i.e. I passed the App Note through a SED script.

You have to do some hand-editing.   i.e. extract the argument count. make sure that you have the correct commas.

I will do the edits and add them to the test branch tomorrow.

David.

joe_smits

what do you mean "everything else is working"?
unfortunately i do not have UNO or NUCLEO-F103RB.
as for other shields, i have 1.8'' tft lcd with ST7735R controller (SPI version). Work fine with bitbang (slow) and with hardware SPI (fast). And another one is NHD‐2.7‐12864UCY3 (OLED, SPI) - also work fine.
i will try init from extra folder tomorrow.

But, I'm starting to think that the 2.4'' module on (ILI9340) is defective.

david_prentice

I can't believe that you do not own a regular Arduino board.   This is an Arduino forum.

If you have an STM32,   which STM32 board?
The stm32duino software is full of "features".

Life is much easier if I know what hardware and software you are using.
e.g.  your ILI9340 Shield plugged into a Uno, Mega, Zero, Due, ...

I bet your Shield is 100% fine.

David.

david_prentice

I have added init sequences from ILI9341 app note to GitHub.

They were hand-edited.  So I might have a typo.

David.

foobarrer

I got different register read result by putting the same LCD on UNO board. Previous result was from MEGA2560.

By the way, I have found datasheet for NT35310 at http://jmp.sh/qNZRuT9

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


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.

david_prentice

Thanks for the link to the datasheet.   I struggled with your "Jumpshare" site but managed to save the English PDF.
I am impressed.   My normal Google Search got nowhere.   If you can find "NT35310 app note" then it would be brilliant.

I have just come back from the pub.   Don't expect anything until tomorrow.
It looks a little different to a regular MIPI controller.

David.

 

joe_smits

1. today test all init code for ILI9340 from MCUFRIEND_kbv-test_9340 branch. no luck.
2. i perform test all signals with logic analyzer. all signals are correct.
3. I ask my friends, maybe someone has a UNO board or Arduino.

Joe

david_prentice

I can't believe that you do not have a regular Arduino.

Ok,  stm32duino works on several STM32F103 boards.   It is extremely unlikely that someone buys a STM32 board and starts to learn about Arduino from scratch.   If they did,  they would probably be able to say Maple, Maple-mini, BlueBoard, Nucleo-F103, ...

It is even less likely that they create a whole new STM32 board by themselves.   If they did,   they would have a pretty good idea about the "full-featured" nature of stm32duino.

In message #1180, you say:
Quote
Pictures of the LCD I received, a little different from the item's pictures on ali.
Either post real photo or describe the "differences".

Incidentally,  if you run the real LCD_ID_readreg.ino sketch it would verify your wiring.  Just paste the #defines to your message to show which shield pin is connected to which STM32 pin.

David.

foobarrer

The controller of my TFT LCD with a sticker "35310" on the back is indeed an NT35310. Thanks David for pointing it out. I have modified register 0xB7, 0x36 and 0xB0 and fixed inverted color and inverted X-axis problem when using the aspect_kbv.ino sketch.





Thanks for the link to the datasheet.   I struggled with your "Jumpshare" site but managed to save the English PDF.
I am impressed.   My normal Google Search got nowhere.   If you can find "NT35310 app note" then it would be brilliant.

I have just come back from the pub.   Don't expect anything until tomorrow.
It looks a little different to a regular MIPI controller.

David.

 

foobarrer

Also the register 0xD401, 0xD402 content is 0x5310, which confirmed the controller is Novatek NT35310.

LCD id1 =
5310


The controller of my TFT LCD with a sticker "35310" on the back is indeed an NT35310. Thanks David for pointing it out. I have modified register 0xB7, 0x36 and 0xB0 and fixed inverted color and inverted X-axis problem when using the aspect_kbv.ino sketch.






Go Up