Go Down

Topic: SAMSUNG S6D04H0X controller, NEED HELP (Read 22298 times) previous topic - next topic

catalin123m

I`ve bought a 2.4 inch TFT display and turns out it has a SAMSUNG S6D04H0X controller.
The problem is I can`t find a easy to use library fot it. All I have is this sketch wich works with the display, but I don`t know hot to use it to write some text on the display .Other libraries have easy commands like LCD_print() or something like that

Can someone please help me??

simmisj

Hi catalin123m, I have the exact same problem. Bought my display from banggood.com and saw that in the comments section people were using the Adafruit libraries but when I got my screen and started testing it the libraries did not function correctly. I sent them an email and they told me that now this screen had the Samsung controller and sent me a similar file.

Your file is missing some stuff in the loop. I am not sure if you deleted it before posting it here or not so I am just going to post the code in the loop function from my file to show something on the screen.

Here it is:
Code: [Select]
int p;
  for(int i=0;i<1000;i++)
  {
    Rect(random(300),random(300),random(300),random(300),random(65535)); // rectangle at x, y, with, hight, color
    /*LCD_Clear(0xf800);
    delay(1000);
    LCD_Clear(0x07E0);
    delay(1000);
    LCD_Clear(0x001F);
    delay(1000);
    LCD_Clear(0xffff);
    delay(1000);*/
  }
//  LCD_Clear(0xf800);


The LCD_Clear function is incredibly slow. It takes something like 5-10 seconds to clear the whole screen.

Anyways, I have the exact same problem as catalin123m and hope there is some help out there.

Cheers!

catalin123m

I also bought this display from banggood and you are right I deleted the loop, but not intentionally. I tried something out and it did not worked

simmisj

One of the main reasons why I bought it was because people were saying how easy they had managed to set it up and get it working with the Adafruit library in the comments section on banggood.com.

Now they have changed the controller :/


rowboteer

#4
Apr 09, 2015, 08:16 pm Last Edit: Apr 09, 2015, 08:21 pm by rowboteer
I have an Instructable here that has a library for the Samsung S6D02A1.  I have looked at the data sheet for the  S6D04H0X and the commands look identical, so the library for the S6D02A1 should work, it is called Adafruit_QDTech_AS

You will need to change the following two lines in the Adafruit_QDTech_AS.h file found inside the library folder to the correct display resolution (if needed):

#define QDTech_TFTWIDTH  128
#define QDTech_TFTHEIGHT 160

e.g. I do not know the resolution of your display, maybe:

#define QDTech_TFTWIDTH  240
#define QDTech_TFTHEIGHT 320

Let me know how you get on!

simmisj

#5
Apr 09, 2015, 09:33 pm Last Edit: Apr 09, 2015, 09:49 pm by simmisj
Nice.
Yes. The display is 240x320 pixels.

Do you think we will need to change the connection pins in your library?
This display we are using is a shield that goes on top of the Arduino Uno and the pin arrangement is impossible to change physically.

EDIT: BTW, here is the datasheet straight from banggood.com customer service: Controller datasheet

rowboteer

#6
Apr 09, 2015, 09:48 pm Last Edit: Apr 09, 2015, 09:50 pm by rowboteer
Change the connection pins in the sketch.

I hope the shield uses the hardware SPI pins otherwise display updates will be slow.

Find these definitions in the sketch:

#define sclk 13  // Don't change
#define mosi 11  // Don't change
#define cs   9
#define dc   8
#define rst  7  // you can also connect this to the Arduino reset

You can change pins 7, 8 and 9 to match your board

11 and 13 are the hardware SPI pins so are fixed

If the display uses different pins for sclk and mosi get back to me.

simmisj

I am not sure if it uses SPI.
Here is a quote from the webpage: "8 bit digital interface, plus 4 control lines
Uses digital pins 5-13 and analog 0-3. That means you can use digital pins 2, 3 and analog 4 and 5. Pin 12 is available if not using the micro SD"

Since it uses so many pins then I doubt it is using SPI.

rowboteer

Ah!

All is not lost but I need to know what the pin connections are, or a link to the display details.

rowboteer


simmisj

Yes, I believe so. But I bought it together with an Arduino. This one: Arduino + TFT shield
They seem to be the same.

rowboteer

#11
Apr 09, 2015, 10:44 pm Last Edit: Apr 10, 2015, 01:14 am by rowboteer
Try the attached library and example in the library.

I have a similar board that claimed to have the Spfd5408 controller but actually has a ILI9341 compatible controller so I put this library together from the work of others.

Let me know if it works.

The 8 bit interface is not going to be as fast as SPI due to the way 8 data bits have been split across two microcontroller ports but you should find the performance reasonable with this library.

Currently size 1 text will not plot as the lower level GFX library assumes SPI but at least we will find out if we have the correct driver initialisation code!


simmisj

Wow!
You are amazing! :)

It works.
Here is the serial output with the benchmarks:
Code: [Select]
TFT LCD test
TFT size is 240x320
Benchmark                Time (microseconds)
Screen fill              1322060
Text                     379704
Lines                    3895628
Horiz/Vert Lines         135860
Rectangles (outline)     98160
Rectangles (filled)      3068100
Circles (filled)         1153564
Circles (outline)        1697108
Triangles (outline)      1236720
Triangles (filled)       1483228
Rounded rects (outline)  572648
Rounded rects (filled)   3567336
Done!


This is MUCH better than the code that we got from banggood.com. Filling the screen with one color took 10 seconds. With this library it takes around 250ms.


I am sure catalin123m will be very happy when he sees his thread next time :)

Not sure if I should dare ask but have you made any code that reads bitmaps from the SD card and displays the bitmap on the screen? :D

Thanks again.

rowboteer

#13
Apr 09, 2015, 11:28 pm Last Edit: Apr 10, 2015, 01:17 am by rowboteer
Great, come back and check in a couple of days and I will have finished the library adaptions and will point you to where you can get the updated libraries.

Yes to the SD Card images. I created an Instructable recently to do just this but adaptions may be needed before you can use the sketch.  I will test on my display now we know we have the same display driver.

catalin123m

OMG!!! it works :D:D:D   A big thanx from the bottom of our hearts.  I hope simmisj won`t mind I included him in this Thank You note :P

Again all the health and fortune in the world for rowboteer :d

Go Up