Go Down

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

NuuSG

I have the same problem...  :smiley-confuse:  for a moment it seemed to work but it was not true ... This is the result of the diagnostic_TFT_support example:

Code: [Select]

Diagnose whether this controller is supported
There are FAQs in extras/mcufriend_how_to.txt

tft.readID() finds: ID = 0x0

MCUFRIEND_kbv version: 2.9.9


This ID is not supported
look up ID in extras/mcufriend_how_to.txt
you may need to edit MCUFRIEND_kbv.cpp
to enable support for this ID
e.g. #define SUPPORT_8347D

New controllers appear on Ebay often
If your ID is not supported
run LCD_ID_readreg.ino from examples/
Copy-Paste the output from the Serial Terminal
to a message in Displays topic on Arduino Forum
or to Issues on GitHub

Note that OPEN-SMART boards have diff pinout
Edit the pin defines in LCD_ID_readreg to match
Edit mcufiend_shield.h for USE_SPECIAL
Edit mcufiend_special.h for USE_OPENSMART_SHIELD_PINOUT

david_prentice

#16
Feb 18, 2019, 04:29 pm Last Edit: Feb 18, 2019, 04:34 pm by david_prentice
Did you edit the CPP file?
Or replace the file from GitHub?
Or delete directory and download ZIP again?

The purpose of GitHub is to show each individual change to a file.
You can select Branch and click on the change.
Or read  the new version of CPP file

Alternatively you could just tft.begin(0x9163); in graphictest_kbv sketch.

David.

NuuSG

#17
Feb 18, 2019, 04:45 pm Last Edit: Feb 18, 2019, 04:50 pm by NuuSG
I deleted the directory and downloaded the ZIP again, with the test_9163 branch.

In graphictest_kbv sketch I have two problems, it is for SPI and reports an error that is too big for Arduino Pro Mini.

david_prentice

#18
Feb 18, 2019, 05:01 pm Last Edit: Feb 18, 2019, 05:05 pm by david_prentice
How big is it?

Change graphictest to show wifi_full[ ] instead of penguin[ ]

But the diagnose_TFT_controller sketch should work if you have replaced the ZIP.

David.

Did you select "test_9163" Branch when you downloaded the new ZIP ?
The Arduino IDE "Install from ZIP" requires you to leave IDE, delete directory, start IDE, install from ZIP

NuuSG

#19
Feb 18, 2019, 06:09 pm Last Edit: Feb 18, 2019, 06:10 pm by NuuSG
I got it!!  :D

But this is the result in Font_simple and graphictest_kbv examples, Is it possible that dimensions are not well defined?




david_prentice

Edit the CPP file.   Hint.  Look for case 0x9163:  and change the lcd_capable line to
Code: [Select]

#ifdef SUPPORT_9163
    case 0x9163:                //
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | INVERT_GS | READ_24BITS;

NuuSG

I have changed this and there are no changes ... it shows the same.

david_prentice

I don't believe you.
What is printed on the Serial Terminal?

Please copy-paste the lines from your MCUFRIEND_kbv.cpp that correspond to #20.

This is what the whole block should look like:
Code: [Select]

#ifdef SUPPORT_9163
    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
            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
        };
        table8_ads = table9163C, table_size = sizeof(table9163C);   //
        p16 = (int16_t *) & HEIGHT;
        *p16 = 160;
        p16 = (int16_t *) & WIDTH;
        *p16 = 128;
        break;
#endif


David.

NuuSG

#23
Feb 19, 2019, 09:33 am Last Edit: Feb 19, 2019, 09:33 am by NuuSG
This is the result on Serial Terminal:
Code: [Select]

Serial took 0ms to start
ID = 0x9163


This is my code on MCUFRIEND_kbv.cpp:
Code: [Select]

#ifdef SUPPORT_9163
    case 0x9163:                //
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN | 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
            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
        };
        table8_ads = table9163C, table_size = sizeof(table9163C);   //
        p16 = (int16_t *) & HEIGHT;
        *p16 = 160;
        p16 = (int16_t *) & WIDTH;
        *p16 = 128;
        break;
#endif


And this is my screen:


david_prentice

Your version with inverted colours (REV_SCREEN) and upside down printing
Code: [Select]
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN | READ_24BITS;

My version with correct colours and correct Gate Scan
Code: [Select]
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | INVERT_GS | READ_24BITS;


I am 99.9% confident that this should fix the display.

Does the Vertical Scroll and Band Scroll work ?
I am not sure if you will be able to see Software Scroll.
I was expecting to see the "WiFi Full" icon instead of a Penguin.
Or was it too big for your Pro Mini?   (the Pro Mini bootloader is bigger than a Uno bootloader)

David.

NuuSG

#25
Feb 19, 2019, 11:57 am Last Edit: Feb 19, 2019, 11:58 am by NuuSG
I got it!!!  :smiley-lol:

Right, that was the problem. I don't know why the changes had not been saved and the previous version was running.

This is the result:




Thank you very much for your help David! It has been very useful.

david_prentice

Please run the examples.    Make notes.

Does Vertical Scroll work?
Your photo seems to show a stationary image.

Many examples will adjust to the screen dimensions.
I have only used MCUFRIEND_kbv with 176x220, 240x320, 240x400, 320x480, 800x480

I would like to know if and how they work on your 128x160 display.

A recent question seems to be about a Mcufriend 1.8 inch display.
Your experience can help me answer.

David.

NuuSG

#27
Feb 19, 2019, 01:30 pm Last Edit: Feb 19, 2019, 05:17 pm by NuuSG
I have executed different examples and it works. Yes, vertical scroll works. I think I have to modify some elements to adjust it exactly to 1.8 '', since I believe that some elements are possibly lost by the difference in screen size. Correct me if I'm wrong.

In this link you can see a short video of the working screen:

https://we.tl/t-92KoqhX0gX





david_prentice

Looking at your photo,   the ribbon comes out of the screen on the right hand side.
If you rotate the photo 90 degrees clockwise,  the ribbon comes out of the bottom of the screen.   Your cables come out of the top of the screen.

Your video is showing vertical scroll in the wrong direction.
For Landscape (GREEN) I would expect UP to show the screen moving right to left.
For Portrait (BLUE) I would expect UP to show the screen moving from bottom to top

I only have SPI 128x128 ILI9163C
I have an SPI 128x160 ST7735
I will run the "drawBitmap_kbv" example on the SPI screens.   (with my SPI kbv library not parallel MCUFRIEND_kbv)

I am not sure why the scroll directions are wrong.

David.

NuuSG

I will continue working on this. If you have news please let me know.

Thanks!

Nuria.

Go Up