Go Down

Topic: TFT with ILI9163C and MCU control (Read 1 time) previous topic - next topic

david_prentice

Sorry about forgetting you.    I have updated the Branch on GitHub.

Please can you try it.   I hope that it corrects the scroll directions.

David.

NuuSG

Previously I had download "test_9163" Branch and it doesn't works. Then I downloaded "master" and modified code in this and finally it works, but how you say, showing vertical scroll in the wrong direction.


Now I have tried both methods for test it but I can't get it to work, the screen is in white color. Could you tell me what lines do you have modified now and I try to modify it in my previous version?

david_prentice

#32
Feb 26, 2019, 10:36 am Last Edit: Feb 26, 2019, 11:05 am by david_prentice
I would expect the "test_9163" to work because I have already enabled SUPPORT_9163 for you.
I would expect the "master" to work if you enable SUPPORT_9163 in MCUFRIEND_kbv.cpp

The change that I made was to
Code: [Select]

    case 0x9163:                //
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS;
        static const uint8_t PROGMEM table9163C[] = {
            //  (COMMAND_BYTE), n, data_bytes....
            0x26, 1, 0x04,       // [01] GAMMASET
            0xF2, 1, 0x01,       // [00] GAMRSEL
            0xE0, 16, 0x0f, 0x1a, 0x0f, 0x18, 0x2f, 0x28, 0x20, 0x22, 0x1f, 0x1b, 0x23, 0x37, 0x00, 0x07, 0x02, 0x10,
            0xE1, 16, 0x0f, 0x1b, 0x0f, 0x17, 0x33, 0x2c, 0x29, 0x2e, 0x30, 0x30, 0x39, 0x3f, 0x00, 0x07, 0x03, 0x10,
            0xB1, 2, 0x08, 0x02,  //[0E 14] FRMCTR1 if GM==011 61.7Hz
            0xB4, 1, 0x07,       // [02] INVCTR
            0xB8, 1, 0x01,       // [00] GSCTRL
            0xC0, 2, 0x0A, 0x02, // [0A 05] PWCTR1 if LCM==10
            0xC1, 1, 0x02,       // [07] PWCTR2
            0xC5, 2, 0x50, 0x63, // [43 4D] VMCTR1
            0xC7, 1, 0,          // [40] VCOMOFFS
            //  0x33, 6, 0, 0, 0, 128 + 0, 0, 0, //VSCLLDEF
        };

If you have a white screen, change it back to
Code: [Select]

    case 0x9163:                //
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | INVERT_GS | READ_24BITS;
        static const uint8_t PROGMEM table9163C[] = {
            //  (COMMAND_BYTE), n, data_bytes....
            0x26, 1, 0x04,       // [01] GAMMASET
            0xF2, 1, 0x01,       // [00] GAMRSEL
            0xE0, 16, 0x0f, 0x1a, 0x0f, 0x18, 0x2f, 0x28, 0x20, 0x22, 0x1f, 0x1b, 0x23, 0x37, 0x00, 0x07, 0x02, 0x10,
            0xE1, 16, 0x0f, 0x1b, 0x0f, 0x17, 0x33, 0x2c, 0x29, 0x2e, 0x30, 0x30, 0x39, 0x3f, 0x00, 0x07, 0x03, 0x10,
            0xB1, 2, 0x08, 0x02,  //[0E 14] FRMCTR1 if GM==011 61.7Hz
            0xB4, 1, 0x07,       // [02] INVCTR
//            0xB8, 1, 0x01,       // [00] GSCTRL
            0xC0, 2, 0x0A, 0x02, // [0A 05] PWCTR1 if LCM==10
            0xC1, 1, 0x02,       // [07] PWCTR2
            0xC5, 2, 0x50, 0x63, // [43 4D] VMCTR1
            0xC7, 1, 0,          // [40] VCOMOFFS
            //  0x33, 6, 0, 0, 0, 128 + 0, 0, 0, //VSCLLDEF
        };

  
and I will have to find another way to fix the scroll direction.

David.

Edit.   I have changed GSCTRL on an SPI ILI9163 and it works fine.   So I see no problem.

The first steps in ANY test is to read the ID and any messages written on the Serial Terminal.
Then make careful notes on paper about what you have done.

Life is much simpler (for me) if you are a GitHub member and have cloned the project.   You can access my Branch at any time.

You can always re-install a library from GitHub and start again.

NuuSG

I have run SUPPORT_9163.

This is the result. But I am not sure what you say that it's not ok.

https://we.tl/t-TejTbMAji8

david_prentice

#34
Feb 26, 2019, 11:58 am Last Edit: Feb 26, 2019, 12:02 pm by david_prentice
The scroll directions are still wrong.

BLUE SCROLL DN  moves up (instead of DOWN)
BLUE BAND moves down (instead of UP)
GREEN SCROLL UP is to the right (instead of to the left)
GREEN SCROLL DN is to the left (instead of to the right)
RED SCROLL UP moves down (instead of UP)
RED BAND moves down (instead of UP)

I presume that you have used today's "master" from GitHub (with SUPPORT_9163)

Thanks for the feedback.   I will have to think hard !!

David.

david_prentice

#35
Mar 01, 2019, 11:54 am Last Edit: Mar 01, 2019, 11:55 am by david_prentice
I was looking at the ILI9163 data sheet and noticed that you reported:
Code: [Select]

reg(0x00D3) 00 91 63 00 ILI9341, ILI9488
reg(0x00D4) 00 00 00 00 Novatek ID
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 80 RDID2
reg(0x00DC) 00 66 RDID3

The ILI9163 datasheet says that reg(0xD3) should be
Code: [Select]

reg(0x00D3) xx 01 21 YY xx    //RDID4 where YY is Driver IC version ID

So perhaps your controller was not made by Ilitek.

Unfortunately I can only read certain registers with the SPI interface.  e.g. 0x04, 0xDA, 0xDB, 0xDC which are all correct.
I would be very interested in reading all the other registers via LCD_ID_readreg.   This is only possible with a parallel interface.

Yes,  I can correct the directions in #34 on my SPI ILI9163.
Did you make the video in #33 with the current "test_9163" Branch from GitHub?
This branch has already enabled SUPPORT_9163

David.

NuuSG


Yes, the video in #33 is done with "test_9163" Branch from GitHub.

I will continue trying it, if I have news I say to you.

Thanks!





david_prentice

#37
Mar 01, 2019, 01:07 pm Last Edit: Mar 01, 2019, 01:13 pm by david_prentice
Please can you run the LCD_ID_readnew.ino sketch from the examples.
Replace setup() with this function.
Code: [Select]

void setup()
{
    Serial.begin(9600);
    while (!Serial) ;
    Serial.println(F("Read Registers on MCUFRIEND UNO shield"));
    Serial.println(F("controllers either read as single 16-bit"));
    Serial.println(F("e.g. the ID is at readReg(0)"));
    Serial.println(F("or as a sequence of 8-bit values"));
    Serial.println(F("in special locations (first is dummy)"));
    Serial.println(F(""));
    lcdInit();
    lcdReset();      //ensures that controller is in default state
    //    unlock = unlock_1520;
    //    unlock = unlock_1526;
    //    unlock = unlock_8357;
    //    unlock = unlock_5310;
    //    page_N = d5310_1_in;
    //    for (uint16_t i = 0x00; i <= 0xFE; i++) readReg(i, 10, "f.k");
//    read_regs("diagnose any controller");
    //    read_xxxx("mystery");
    //    read_5310_P0("NT35310 P0");
    //    read_5310_P1("NT35310 P1");
    //    read_61509("R61509 / ILI9326");
    //    read_61526("R61520 / R61526");
    //    read_8357("HX8357X");
    //    read_9320("ILI9320");
    //    read_9327("ILI9327");
    read_9338("ILI9302 / ILI9329 / ILI9338 / ILI9341");
    //    read_9481("ILI9481 / HX8357-B / R61581");
    //    read_9486("ILI9486 / 1LI9488");
}

Copy-paste the Serial Terminal to your message.

Then run the sketch in the attachment.    
I suspect that all the scroll directions will be wrong.   Which are correct?
Please observe Marilyn.   Different Gammas (1 - 4) are used. Which is the best picture?

David.

NuuSG

I have tested LCD_ID_readnew.ino with replacement, this is the message in Serial Terminal.

Code: [Select]

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)

ILI9302 / ILI9329 / ILI9338 / ILI9341
reg(0x0004) 00 54 80 66 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 00 08 Get Powsr Mode
reg(0x000B) 00 00 Get Address Mode
reg(0x000C) 00 06 Get Pixel Format
reg(0x000D) 00 00 Get Display Mode
reg(0x000E) 00 00 Get Signal Mode
reg(0x000F) 00 00 Get Diagnostic Result
reg(0x00B0) 00 00 Interface Mode
reg(0x00B1) 00 0E 14 Frame Rate Normal
reg(0x00B2) 00 0E 14 Frame Rate Idle
reg(0x00B3) 00 0E 14 Frame Rate Partial
reg(0x00B4) 00 02 02 Inversion Control
reg(0x00B5) 00 08 03 00 00 Blanking Porch
reg(0x00B6) 00 06 02 02 Display Control
reg(0x00B7) 00 00 Entry Mode Set
reg(0x00C0) 00 0A Power Control 1
reg(0x00C1) 00 05 Power Control 2
reg(0x00C2) 00 00 Power Control 3
reg(0x00C3) 00 00 Power Control 4
reg(0x00C4) 00 00 Power Control 5
reg(0x00C5) 00 3C 48 VCOM Control 1
reg(0x00C7) 00 40 VCOM Control 2
reg(0x00D2) 00 00 00 NVM Status
reg(0x00D3) 00 91 63 00 RDID4
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 66 RDID3
reg(0x00E0) 00 0F 1A 0F 18 2F 08 20 22 1F 1B 23 37 00 07 02 GAMMA-P
reg(0x00E1) 00 0F 1B 0F 17 33 0C 29 2E 30 10 39 3F 00 07 03 GAMMA-N
reg(0x00F2) 00 00 GAMMA-3G
reg(0x00F6) 00 00 00 00 Interface Control


This is a video of the result of the attached example.
https://we.tl/t-gEOOPFJQ46

It's ok, true?

david_prentice

Woo-hoo.   The Rotations are correct.   The Directions are correct.

Gamma set #2 looks best from the video.    Which is best from your real-life eyes ?

Please edit the setGamma() function to change to tft.pushCommand(0xF2, &on, 1); 
Run the sketch again.    It will use the Gamma settings from begin() instead of the fixed curves.

I am a little surprised by reg(0xDB).   I expected to see 0x80
Code: [Select]

reg(0x0004) 00 54 80 66 Manufacturer ID
...
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 66 RDID3


Thanks for the feedback.

David.

Go Up