UC8230 driver?

Hi all, I bought a Chinese 2.8" LCD touch shield that looks just like the Adafruit touch shield, but with a UC8230 driver chip, and the adafruit library doesn't work with it. After a lot of searching around, I found that a Taiwan manufacturer makes the UC8230, with a datasheet. Can anyone help me see if this chip is compatible with any of the libraries?

All help is appreciated!

Hi,

I bought on Amazon a Kuman K60 display that uses a UC8230 controller.
After testing many libraries and solutions I contacted the seller that sent me the libraries.
So far I tried only a "Hello World" example but it works, so I believe that they are ok.

Bye

Your Amazon link "looks" like a regular Blue 2.8" Mcufriend Shield.

The UC8230S register set "looks" very similar to an ILI9320.

Try the MCUFRIEND_kbv library. Edit the graphictest_kbv.ino sketch from the Examples. Force setup() to think it is using an ILI9320:

     tft.begin(0x9320);

Please let me know how you get on. Copy-Paste the output from LCD_ID_readreg.ino on the Seial Terminal.

David.

Hi David,

thank you for your answer. I tried what you suggested and it seems to work but the strings are mirrored.

This is the output of LCD_ID_readreg.ino:

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) 82 30	ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00	Manufacturer ID
reg(0x0009) 00 00 00 00 00	Status Register
reg(0x000A) 00 00	Get Powsr Mode
reg(0x000C) 00 00	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) 84 10	Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00	RD_DDB SSD1963
reg(0x00B0) 00 00	RGB Interface Signal Control
reg(0x00B4) 00 00	Inversion Control
reg(0x00B6) 00 00 00 00 00	Display Control
reg(0x00B7) 00 00	Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00	ILI9481, HX8357-B
reg(0x00C0) 00 00 00 00 00 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) 00 00 00 00 00	NVM Read
reg(0x00D3) 00 00 00 00	ILI9341, ILI9488
reg(0x00DA) 00 00	RDID1
reg(0x00DB) 00 00	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) 00 00 00 00 00 00 00 00 00 00 00 00	Adjust Control 2
reg(0x00F6) 00 00 00 00	Interface Control

Any suggestion?
Thank you

That is good news.

Now repeat the exercise with 0x5408, 0x6809, 0x9325, 0x9335.

Please observe the Colours. i.e. does RED appear red, blue, magenta, ... ?
Please note down the aspects. i.e. is PORTRAIT the right way up? (any printed Touch icons or Touch ribbon at the bottom of panel. Any reset button at top of panel.)
Does Software Scrolling work?

With luck, one of those IDs will work 100%. At worst, I just have to change horizontal mirror.

David.

David, please find below the report:

with 0x5408:

OK:
Strings correctly displayed

NOT OK:
- blue color grade is red
- scrolling in portrait doesn't work well: after the first scroll up and scroll down when appears "only the color band" it makes another scroll but it stops at half

Notes:
String read pixel says "BGR"

with 0x6809:

Screen blank

with 0x9325:

Screen blank

with 0x9335:

Screen blank

Sometimes it doesn't work correctly by displaying some blurred noise, maybe a missed software reset. Disconnecting and reconnecting the USB (power cycle) fixes the issue

Thanks for your feedback. I can either create a test branch on GitHub or simply suggest that you edit your mcufriend_kbv.cpp file by hand:

    case 0x8230:
        _lcd_capable = 0 | REV_SCREEN | INVERT_GS | INVERT_RGB;
        goto common_9320;
    case 0x5408:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS;
        goto common_9320;
    case 0x9320:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR;
      common_9320:

You don't need to force the ID any more. It should recognise ID=0x8230

The older ILI9320 style of controller can only scroll the whole screen.
The Band Scroll test scrolls 64 rows of screen.

If Band "works" you just see a small section scrolling in a steady picture.
On a non-Band controller, you will see the whole screen scroll by 64 rows and stay there.

If you still get a "reads BGR" message, add the READ_BGR attribute.

First off, unpeel the protective plastic film on your Touch Glass.
Does your screen look blurred, shaky, ... ?

David.

I tried to add the case for the 0x8230 but did not work, I still have to force the identifier using

tft.begin(0x5408);

Regarding the other tests, it seems to be good apart the "BLUE COLOR GRADES" that appear red.
It also seems that UC8230 is not capable of band scrolling...

Did you save the CPP file after editing?

You could force tft.begin(0x8230)

Yes, the UC8230 is in the same class as ILI9320. i.e. no Band Scroll.

David.

Ok, that's funny.

I tried even to change to the following:

case 0x8230:
        //_lcd_capable = 0 | REV_SCREEN | INVERT_GS | INVERT_RGB;
		_lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS;
		goto common_9320;
    case 0x5408:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS;
		goto common_9320;

but if I try

tft.begin(0x8230);

or

tft.begin(identifier);

it doesn't work.
It works only with

tft.begin(0x5408);

Maybe there is something else...
BTW I checked! I saved the cpp file!!! :slight_smile: I confess that I was not so sure...

That is very odd !

As you can see, there is nothing very high-tech about the edit.

When you run the graphictest_kbv sketch. It should say:

ID = 0x8230

on the Serial Terminal.

Anyway, if case 0x5408 "works", just edit the attributes in that line.

Ah-ha. I see this in the readID() method:

    if (ret == 0x5408)          //the SPFD5408 fails the 0xD3D3 test.
        return 0x5408;

So you could add:

    if (ret == 0x5408)          //the SPFD5408 fails the 0xD3D3 test.
        return 0x5408;
    if (ret == 0x8230)          // ?? perhaps the UC8230 fails the 0xD3D3 test.
        return 0x8230;

However, your readreg report showed the expected result:

reg(0x00D3) 00 00 00 00	ILI9341, ILI9488

David.

I really don't know. I tried to add the other code but the sketch works only if I leave 0x5408.

For now it is ok, I will make further tests with my own sketch.

Thank you very much!

Dear David,

I haven't been able to fix the color issue. Using graphictest_kbv.ino I still get a red graded bar while the strings stats "blue color grades".

I managed to make the microSD accessible on the MEGA and tried the BMP test.
The image loads but the color are not correct.

Considering I'm still forcing 0x5408, I tried to remove the READ_BGR in the library but nothing changed.

Do you have any suggestion?

What ID is reported in the Serial Terminal?
Or in the Adafruit Tests Report screen.

Did you add the INVERT_RGB attribute?
I can set RGB in a different register if necessary.

Incidentally, the R61526 ignores that attribute.

David.

Edit. The 9320 group was not handling INVERT_RGB correctly. This should fix it:

    case 0x8230:
        _lcd_capable = 0 | REV_SCREEN | INVERT_GS | INVERT_RGB;
        goto common_9320;
    case 0x5408:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS;
        goto common_9320;
    case 0x9320:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR;
      common_9320:
        static const uint16_t ILI9320_regValues[] PROGMEM = {
            0x00e5, 0x8000,
            0x0000, 0x0001,
            0x0001, 0x100,
            0x0002, 0x0700,
            0x0003, 0x0030,   //default without BGR.  handled in setRotation()
            ...

The ID reported by the serial monitor is 0x8230.
I tried to add/change the following:

case 0x8230:
    _lcd_capable = 0 | REV_SCREEN | INVERT_GS | INVERT_RGB;
    goto common_9320;
case 0x5408:
    //_lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS;
    _lcd_capable = 0 | REV_SCREEN | INVERT_RGB | INVERT_GS;
    goto common_9320;
case 0x9320:
    _lcd_capable = 0 | REV_SCREEN | READ_BGR;
    common_9320:
        static const uint16_t ILI9320_regValues[] PROGMEM = {
            0x00e5, 0x8000,
            0x0000, 0x0001,
            0x0001, 0x100,
            0x0002, 0x0700,
            0x0003, 0x0030,
            0x0004, 0x0000,
            0x0008, 0x0202,
.........

but the result is the same. The supposed blue grades are red... :slight_smile:

Let me have a think about it. i.e. test it on a real ILI9320. Probably this evening.

I don't have SPFD5408 or UC8230.

There is nothing much to worry about. I am sure that bit#12 in reg(0x0003) will determine the Red / Blue swap.

I am still worried about your white screen with tft.begin(0x8230)
The code sequence is pretty straightforward.

Which Arduino are you using? Uno, Mega, Due, ... ?

David.

I'm using Arduino Mega 2560.
I really don't understand why I get a blank screen using 0x8230...
Unfortunately using Arduino IDE I miss all the tracing tools of the AVR Studio.

BTW the thing that puzzles me is that of the four "color grades" only the blue one is inverted. I expected that also the red would be blue, but the issue is only on the blue grade...

Well, I just tested INVERT_RGB with an ILI9320 on a NUCLEO-F103 board.
It swapped Blue and Red as expected.

Unfortunately, my ILI9320 is 3.3V so I can't use it on a Mega2560.
I can put a ILI9325 onto a Mega2560. (and change that block's reg(0x0003) default to 0x0030)

There seems to be something very odd with your Compiler. RGB / BGR is a single bit in reg(0x0003)

If you are happy with GitHub, I will add a test_UC8230 branch later.
And then I know that you are using the same code as me. You don't need to run GitHub. Just copy-paste the mcufriend_kbv.cpp file directly to your editor.

I have only managed to find a "Register list" for the UC8230. Not a full datasheet.
The Registers and bitfields seem to be in the same places as ILI9320 / SPFD5408.
The finer details might be different. e.g. VCOM tables.

David.

Dear David,

I downloaded the UC8320 branch and on my side is the same.
I confirm that RED and BLUE are inverted.

Really strange...

Does readID() return 0x8230 ?
Does begin(0x8230) work properly ?

Does Software Scroll work?
Is the display blurred or shaky? With the App Note, I can fix that.

David.