Go Down

Topic: 3.5" TFT display problem (Read 881 times) previous topic - next topic

artisticforge

What does the pcb look like?   
Can you post a photo?   
Is it red? 
Does it say "mcufriend.com" ?

Your readreg output looks a bit different to me HX8357-D output.

What ID is reported by my examples?
0x9090 means HX8357-D

David.

Edit.   Your photo is  a blue pcb.   I thought the blue 3.5 inch Uno shields always contain an ILI9481.   The Red 2.4, Blue 2.8, Red 3.5, Red 3.6 shields might contain any controller.    Hence the purpose of the library:  to work with many different controllers.

Why do you think it is HX8357-C ?

Most PC Paint programs can convert JPG or PNG photos.  e.g. reduce resolution, size, ...
People often change hi-res photos to a medium resolution for email or website.



I have seen this type of board. A friend has one. These have either LI9481 or ILI9488 driver.
Several people have these and my friend says that they are all either LI9481 or ILI9488 driver.
He said that they were sold on amazon by several vendors.

Link to amazon WINGONEER UNO R3 3.5 TFT Display Screen with SD Card Socket for Arduino MEGA 2560 Board Module SC3A


I do not do much with displays but my friend and his friends have come by to tinker with their arduino stuff.

prateekvhegde

What does the pcb look like?   
Can you post a photo?   
Is it red? 
Does it say "mcufriend.com" ?

Your readreg output looks a bit different to me HX8357-D output.

What ID is reported by my examples?
0x9090 means HX8357-D

David.

Edit.   Your photo is  a blue pcb.   I thought the blue 3.5 inch Uno shields always contain an ILI9481.   The Red 2.4, Blue 2.8, Red 3.5, Red 3.6 shields might contain any controller.    Hence the purpose of the library:  to work with many different controllers.

Why do you think it is HX8357-C ?

Most PC Paint programs can convert JPG or PNG photos.  e.g. reduce resolution, size, ...
People often change hi-res photos to a medium resolution for email or website.



It is written in the cover that it is  HX8357-C.
Are you saying that this display capacity itself is bad, should I go for little higher end display?
If so which is the display I should go for?

david_prentice

So the HX8357-C is printed on the antistatic bag that the shield arrived in?

What ID is reported by the library?
The library will use the ID returned by tft.readID() to select the correct controller type in tft.begin(ID).

Please provide an accurate photo of the screen displaying the tiger.  And what ID was used.
Most examples report this on the Serial Terminal.

I am quite willing to sort out your problems.    But only if you answer MY questions.

David.

prateekvhegde

So the HX8357-C is printed on the antistatic bag that the shield arrived in?

What ID is reported by the library?
The library will use the ID returned by tft.readID() to select the correct controller type in tft.begin(ID).

Please provide an accurate photo of the screen displaying the tiger.  And what ID was used.
Most examples report this on the Serial Terminal.

I am quite willing to sort out your problems.    But only if you answer MY questions.

David.
Sorry for the late reply.

Yes HX8357-C is printed on the antistatic bag that the shield arrived in.

TFT Id is 0x9090.

The image is already attached, that itself I am using.


david_prentice

Please run this program.  Copy-paste from the Serial Terminal.
Code: [Select]

#include <MCUFRIEND_kbv.h>   // Hardware-specific library
MCUFRIEND_kbv tft;


void setup(void)
{
    uint16_t ID = tft.readID();
    if (ID == 0xD3D3) ID = 0x9481;  //write-only shield
    tft.begin(ID);
    uint8_t cmds[] = {0xFF, 0x83, 0x57};
    tft.pushCommand(0xB9, cmds, 3);
    ID = tft.readReg(0xD0);
    Serial.begin(9600);
    Serial.print("reg(0xD0) = 0x");
    Serial.println(ID, HEX);
    tft.fillScreen(0x0000);
    tft.setTextSize(2);
    tft.print("reg(0xD0) = 0x");
    tft.println(ID, HEX);
}

void loop(void)
{
}


I identify your controller as a HX8357-D.   According to the datasheet the -D returns 0x99 but I have only ever received 0x90.

According to the HX8357-C datasheet,  it does not have a register 0xD0.

David.

prateekvhegde

Please run this program.  Copy-paste from the Serial Terminal.
Code: [Select]

#include <MCUFRIEND_kbv.h>   // Hardware-specific library
MCUFRIEND_kbv tft;


void setup(void)
{
    uint16_t ID = tft.readID();
    if (ID == 0xD3D3) ID = 0x9481;  //write-only shield
    tft.begin(ID);
    uint8_t cmds[] = {0xFF, 0x83, 0x57};
    tft.pushCommand(0xB9, cmds, 3);
    ID = tft.readReg(0xD0);
    Serial.begin(9600);
    Serial.print("reg(0xD0) = 0x");
    Serial.println(ID, HEX);
    tft.fillScreen(0x0000);
    tft.setTextSize(2);
    tft.print("reg(0xD0) = 0x");
    tft.println(ID, HEX);
}

void loop(void)
{
}


I identify your controller as a HX8357-D.   According to the datasheet the -D returns 0x99 but I have only ever received 0x90.

According to the HX8357-C datasheet,  it does not have a register 0xD0.

David.

Hi David, This is what it is printing on the serial terminal.

reg(0xD0) = 0x0



david_prentice

Why did you say that readID() returned 0x9090 ?

It does look as if you really do have an HX8357-C.
I will have to recognise HX8357-C and support it.

David.

prateekvhegde

Why did you say that readID() returned 0x9090 ?

It does look as if you really do have an HX8357-C.
I will have to recognise HX8357-C and support it.

David.
Yes David it is readID() returned 0x9090.
What to do now??

david_prentice

#38
Jan 09, 2018, 02:01 pm Last Edit: Jan 09, 2018, 02:03 pm by david_prentice
I am pretty certain that you have the same controller as me.
My apologies.   The earlier sketch sometimes returns 0x90 and sometimes 0x00.

Please run this sketch:
Code: [Select]


#include <MCUFRIEND_kbv.h>   // Hardware-specific library
MCUFRIEND_kbv tft;

#include <stdio.h>
char printbuf[40];
#define SER_PRINTF(fmt ...)  { sprintf(printbuf, fmt); Serial.print(printbuf); }
#define BOTH_PRINTF(fmt ...)  { SER_PRINTF(fmt); tft.print(printbuf); }

void setup(void)
{
    Serial.begin(9600);
    uint16_t ID = tft.readID();
    if (ID == 0xD3D3) ID = 0x9481;  //write-only shield
    tft.begin(ID);
    tft.fillScreen(0x0000);
    tft.setTextSize(2);
    BOTH_PRINTF("readID() = 0x%04X\n\n", tft.readID()); //unlocks HX8357
    uint8_t cmds[] = {0xFF, 0x83, 0x57}; //unlock key
    //    tft.pushCommand(0xB9, cmds, 3);  //not needed if readID()
    for (int i = 0; i < 10; i++) {
        uint16_t result = tft.readReg(0xD0);
        BOTH_PRINTF("%d: reg(0xD0) = 0x%04X\n", i, result);
    }
}

void loop(void)
{
}


Note that the hi-byte is a dummy.

David.

prateekvhegde

I am pretty certain that you have the same controller as me.
My apologies.   The earlier sketch sometimes returns 0x90 and sometimes 0x00.

Please run this sketch:
Code: [Select]


#include <MCUFRIEND_kbv.h>   // Hardware-specific library
MCUFRIEND_kbv tft;

#include <stdio.h>
char printbuf[40];
#define SER_PRINTF(fmt ...)  { sprintf(printbuf, fmt); Serial.print(printbuf); }
#define BOTH_PRINTF(fmt ...)  { SER_PRINTF(fmt); tft.print(printbuf); }

void setup(void)
{
    Serial.begin(9600);
    uint16_t ID = tft.readID();
    if (ID == 0xD3D3) ID = 0x9481;  //write-only shield
    tft.begin(ID);
    tft.fillScreen(0x0000);
    tft.setTextSize(2);
    BOTH_PRINTF("readID() = 0x%04X\n\n", tft.readID()); //unlocks HX8357
    uint8_t cmds[] = {0xFF, 0x83, 0x57}; //unlock key
    //    tft.pushCommand(0xB9, cmds, 3);  //not needed if readID()
    for (int i = 0; i < 10; i++) {
        uint16_t result = tft.readReg(0xD0);
        BOTH_PRINTF("%d: reg(0xD0) = 0x%04X\n", i, result);
    }
}

void loop(void)
{
}


Note that the hi-byte is a dummy.

David.
This is what I am getting on the serial monitor.

reg(0xD0) = 0x0390

david_prentice

Yes,   that is exactly what I get.

The HX8357-C datasheet does not have reg(0xD0)
The HX8357-D datasheet says reg(0xD0) returns xx 99 i.e. first byte is dummy.

Of course datasheets sometimes have errors.
Either -C does have reg(0xD0) and it returns xx 90 i.e. we all have -C and not -D
Or the -D datasheet should say xx 90

This is all hypothetical.   My 0x9090 screens all give reasonable colours and render BMP correctly.
I have a Red Uno 0x9090 shield and also Red Mega shields with both 16-bit and 8-bit interface.

Perhaps we will hear from someone else with Blue Uno 0x9090 shield.

I would still like to see a real photo of the screen displaying the Tiger BMP.   i.e. a JPEG photo

David.

prateekvhegde

Yes,   that is exactly what I get.

The HX8357-C datasheet does not have reg(0xD0)
The HX8357-D datasheet says reg(0xD0) returns xx 99 i.e. first byte is dummy.

Of course datasheets sometimes have errors.
Either -C does have reg(0xD0) and it returns xx 90 i.e. we all have -C and not -D
Or the -D datasheet should say xx 90

This is all hypothetical.   My 0x9090 screens all give reasonable colours and render BMP correctly.
I have a Red Uno 0x9090 shield and also Red Mega shields with both 16-bit and 8-bit interface.

Perhaps we will hear from someone else with Blue Uno 0x9090 shield.

I would still like to see a real photo of the screen displaying the Tiger BMP.   i.e. a JPEG photo

David.
But JPEG image is more than 1 mb I am not able to upload.

david_prentice

Put your JPEG into Paint or IrfanView.   You can reduce the size and still keep a reasonable quality.

People do this all the time.   Most formats have some form of compression and it works well.

David.

prateekvhegde

The original image is present in the MCUFriend_Kbv library. I also attached the  .jpg image.

david_prentice

Your JPEG renders nicely on this Tablet.  As a 366x270 image using 41kB
That is a different tiger to the one in your original question.

You must have an incredibly steady hand to take this photo of your TFT screen.    I can not see the edge  of the TFT Panel or any sign of the Arduino that the shield is plugged into.

Personally,  I would be very happy with the showBMP program that gives such a nice picture.

David.

Go Up