Recommending a Parallel Display for your next project

Status
Not open for further replies.

roomtek

Active member
Hi Folks,

I would just want to recommend this display for any projects you might have upcoming. It is based on the S6D04D1 driver. and has a resolution of 432 x 200. The best part is that it is an IPS display, which means great viewing angles.

On a teensy 3.6, I used ports C 0-7 and Port D 0-7, and then 4 other pins for [RS, RD, RW, RST]. The Display can only be driven in 8 bit or 16bit mode, so you would need at least 11 pins from your teensy.


I was able to write my own library based off info on the datasheets. I also bought the LQFN MK66, so that I used the whole Port D of the chip, and now get even faster results from the benchmarks.

I am using this display in a Digital Radio project I am working on, and the refresh rates are off the charts!!! (I have font antialiasing going on for all the text on the display, so they look smooth), and I am running at 180Mhz

very well worth the cost of 20 digital pins from the teensy.
 
very interesting!

can you provide links to purchases the displays? Also, will you be sharing your software work?

thanks!
 
This is where i got mine LinkToPage

It came with a adapter PCB, so I could wire it directly.

I could share parts of the software, but I would not be releasing the whole project online.
 
Good afternoon. Ask for forgiveness immediately, I write through the translator. I brought the same display from Samsung
S 5233 (S6D04D1) , I launched it with the c library UTFT Arduino nano 328p. Long tormented with a double image, but launched it. Now I want to transform into the Adafruit library , but it does not work. Again there is a problem with a split image. Do not tell where you took tft_drivers on the display. img_2503.jpgimg_2502.jpg
 
Roomtek, this looks interesting for my own project. Do you mind sharing the driving code?
 
Last edited:
this is the settings table:

Code:
#define S6D04D1_TFTWIDTH 240
#define S6D04D1_TFTHEIGHT 432

#define PWRCTL 0xF3
#define VCMCTL 0xF4
#define SRCCTL 0xF5
#define SLPOUT 0x11
#define MADCTL 0x36
#define COLMOD 0x3A
#define DISCTL 0xF2
#define IFCTL 0xF6
#define GATECTL 0xFD
#define CASET 0x2A
#define PASET 0x2B
#define RAMWR 0x2C
#define RAMRD 0x2E
#define DISPON 0x29
#define DISPOFF 0x28
#define SLPIN 0x10

#define RPGAMCTL 0xF7
#define WRDISBV 0x51
#define WRCABCMB 0x5E
#define MIECTL1 0xCA
#define BCMODE 0xCB
#define MIECTL2 0xCC
#define MIDCTL3 0xCD
#define RNGAMCTL 0xF8
#define GPGAMCTL 0xF9
#define GNGAMCTL 0xFA
#define BPGAMCTL 0xFB
#define BNGAMCTL 0xFC
#define DCON 0xD9
#define WRPWD 0xF0
#define EDSTEST 0xFF
#define TEON 0x35
#define MDDICTL1 0xE0
#define WRCTRLD 0x53
#define WRCABC 0x55

struct setting_table
{
    byte command;
    byte parameters;
    byte parameter[15];
    byte wait;
};

static struct setting_table power_on_setting_table[] = {
    {PWRCTL, 7, {0x80, 0x00, 0x00, 0x0B, 0x33, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {VCMCTL, 5, {0x6E, 0x6E, 0x7F, 0x7F, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {SRCCTL, 5, {0x12, 0x00, 0x03, 0xF0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {SLPOUT, 0, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 120},
    {MADCTL, 1, {0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {COLMOD, 1, {0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 30},
    {DISCTL, 11, {0x14, 0x14, 0x03, 0x03, 0x04, 0x03, 0x04, 0x10, 0x04, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00}, 0},
    {GATECTL, 2, {0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {WRDISBV, 1, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0}, //BRIGHTNESS
    {WRCABCMB, 1, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {MIECTL1, 3, {0x80, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {BCMODE, 1, {0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {MIECTL2, 3, {0x20, 0x01, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {MIDCTL3, 2, {0x7C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 0},
    {DISPON, 0, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 50},
};
 
Code:
    inline void LCDSettingTableWrite(struct setting_table *table)
    {
        LCD_Write_COM(table->command);
        if ((table->parameters) > 0)
        {
            for (int i = 0; i < (table->parameters); i++)
            {
                LCD_Write_DATA(table->parameter[i]);
            }
        }
        if ((table->wait) > 0)
            delay(table->wait);
    }

    void INITB()
    { // toggle RST low to resetset
        RST_LOW
        delay(5);
        RST_HIGH
        delay(10);

        CS_LOW
        for (int i = 0; i < (int)(sizeof(power_on_setting_table) / sizeof(struct setting_table)); i++)
        {
            LCDSettingTableWrite(&power_on_setting_table[i]);
        }
        CS_HIGH
    }
 
this is how I would initialize:

Code:
void S6D04D1::begin()
{
    pinMode(__BACKLIGHTPIN, OUTPUT);
    setBacklight(0);
    PORTS_AS_GPIO();
    IO_OUTPUT();
    // init lcd
    INITB();
    setRotation(3);
    fillScreen(COLORS_BLACK);
}

I use the display in 16bit mode, so Port D is configured as outputs when writing, and inputs when reading from the display, including 4 lines on Port C:

Code:
#define GPIOOUT PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);

void PORTS_AS_GPIO()
    {
        // config PTD as GPIO
        PORTD_PCR0 = GPIOOUT;
        PORTD_PCR1 = GPIOOUT;
        PORTD_PCR2 = GPIOOUT;
        PORTD_PCR3 = GPIOOUT;
        PORTD_PCR4 = GPIOOUT;
        PORTD_PCR5 = GPIOOUT;
        PORTD_PCR6 = GPIOOUT;
        PORTD_PCR7 = GPIOOUT;
        PORTD_PCR8 = GPIOOUT;
        PORTD_PCR9 = GPIOOUT;
        PORTD_PCR10 = GPIOOUT;
        PORTD_PCR11 = GPIOOUT;
        PORTD_PCR12 = GPIOOUT;
        PORTD_PCR13 = GPIOOUT;
        PORTD_PCR14 = GPIOOUT;
        PORTD_PCR15 = GPIOOUT;
        // config PTC as GPIO
        PORTC_PCR16 = GPIOOUT; //RS
        PORTC_PCR17 = GPIOOUT; //WR
        PORTC_PCR18 = GPIOOUT; //CS
        PORTC_PCR19 = GPIOOUT; //RST

        // direction as OUTPUT
        GPIOC_PDDR |= (0x1 << __PINRS) | (0x1 << __PINCS) | (0x1 << __PINWR) | (0x1 << __PINRST);
    }

   inline void IO_OUTPUT()
    {
        RD_HIGH
        RS_HIGH
        CS_HIGH
        WR_HIGH
        GPIOD_PDDR = 0xFFFF; // 16 bits as OUTPUT
    }
 
I am using PWM to drive the LCD backlight:

Code:
#define __BACKLIGHTPIN 10

uint8_t bacltpwm = 0;
 
uint8_t S6D04D1::setBacklight(byte value)
{
    bacltpwm = value;
    analogWrite(__BACKLIGHTPIN, value);
    return value;
}

Please note, on the Teensy, PTD10 is missing, so I am using a custom Teensy (144 LQFP).
 
Thank you. I will understand, my only display in 8 bits. My init is necessary to substitute in the library UTFT in place ili9327_8 and everything works. Your project want to make c libraries Adafruit, there are more possibilities.
Code:
//samsung g5233(S6D04D1) replacement in UTFT 8 bits ili9327_8:
	LCD_Write_COM(0xF5); 
	LCD_Write_DATA(0x12);
        LCD_Write_DATA(0x00);
        LCD_Write_DATA(0x0B);
        LCD_Write_DATA(0xF0);
        LCD_Write_DATA(0x00);
        delay(10);
        
	LCD_Write_COM(0x11); 
	delay(150);
        
	LCD_Write_COM(0x3A);  
        LCD_Write_DATA(0x05);
	
	LCD_Write_COM(0xF2);   
	LCD_Write_DATA(0x10);
	LCD_Write_DATA(0x10);
	LCD_Write_DATA(0x01);
        LCD_Write_DATA(0x08);
        LCD_Write_DATA(0x08);
        LCD_Write_DATA(0x08);
        LCD_Write_DATA(0x08);
        LCD_Write_DATA(0x00);
        LCD_Write_DATA(0x06);  // 0x00 two screens
        LCD_Write_DATA(0x1A);
        LCD_Write_DATA(0x1A);
        
	LCD_Write_COM(0xF3);  
	LCD_Write_DATA(0x80);
        LCD_Write_DATA(0x00);
        LCD_Write_DATA(0x00);
        LCD_Write_DATA(0x0B);  
        LCD_Write_DATA(0x33);
        LCD_Write_DATA(0x7F);  
        LCD_Write_DATA(0x7F);  
                             
	LCD_Write_COM(0xF4);   
	LCD_Write_DATA(0x59);  
        LCD_Write_DATA(0x59);
        LCD_Write_DATA(0x52); 
        LCD_Write_DATA(0x52);
        LCD_Write_DATA(0x11);

	LCD_Write_COM(0xF6);   
	LCD_Write_DATA(0x00);  
	LCD_Write_DATA(0x88);
	LCD_Write_DATA(0x10);

	LCD_Write_COM(0xFD);  
	LCD_Write_DATA(0x11);
	LCD_Write_DATA(0x01);

	LCD_Write_COM(0x36);   
	LCD_Write_DATA(0x08);  
                                
        LCD_Write_COM(0x35);   
        LCD_Write_DATA(0x00);
                                     
	LCD_Write_COM(0xF1);  
	LCD_Write_DATA(0x5A);
                                     
	LCD_Write_COM(0xFF);  
	LCD_Write_DATA(0x00);
	LCD_Write_DATA(0x00);
	LCD_Write_DATA(0x00);
	LCD_Write_DATA(0x40);
                                   
	LCD_Write_COM(0x53); 
	LCD_Write_DATA(0x2C);
        
        LCD_Write_COM(0x55); 
	LCD_Write_DATA(0x00);
                                  
	LCD_Write_COM(0x29);  //display on      
	LCD_Write_COM(0x2C);
//	break;

Display I took with a cell phone and collected a fee for the connection with Arduino Pro Mini.
 
Last edited:
I work only with the library UTFT. If necessary I will. It is working with the library UTFT.

How are you connecting this to the Arduino?

Roomtek: Cheers, I'm using a T3.6 so if I get one of these, which looks quite nice, it'll be 8bit mode only.
 
For 8 bit mode, you can use the port d 0-7.

Depending on the COLMOD (RGB565 or RGB888) you want to use, you would just need to split up the bytes of data you wish to send, and toggle WR.

Code:
uint16_t color = 0xFFFF;
GPIOD_PDOR |= color >> 8; // sending upper bytes
TOGGLE_WR
GPIOD_PDOR |= color & 0xFF; // sending lower bytes
TOGGLE_WR
 
For 8 bit mode, you can use the port d 0-7.

Depending on the COLMOD (RGB565 or RGB888) you want to use, you would just need to split up the bytes of data you wish to send, and toggle WR.

Code:
uint16_t color = 0xFFFF;
GPIOD_PDOR |= color >> 8; // sending upper bytes
TOGGLE_WR
GPIOD_PDOR |= color & 0xFF; // sending lower bytes
TOGGLE_WR

I've ordered this display, it best not let me down:) Should have it in around 4 weeks.
Did you perchance perform any benchmarks comparing 16bit vs 8bit?

I have a Samsung s5830 which contains an almost identical display and controller but @ 320x480 pixels. Considered using this instead of buying in, but then I'd have to deal with sourcing the correct connector and producing a PCB with the LCD driving circuit and what not. Easier just to buy it.
 
I dont have any benchmarks for 8bit vs 16bit, but I guess it would be like double the time for 16 bit in most cases.

For 16 bit mode, the speedup is usually because we dont have to set the data line for pixel with the same color. We would set the data line, and just toggle the WR line for as many repeating pixels we want. In 8 bit mode, you will need to toggle the WR line twice per pixel regardless. This is still very fast, as I still have to add (asm nop) delays because the code is too fast for the display.

this is for 16bit:

Benchmark Time (microseconds)
Screen fill 37485
Text 4491
Lines 28426
Horiz/Vert Lines 2539
Rectangles (outline) 1302
Rectangles (filled) 45235
Circles (filled) 13060
Circles (outline) 18814
Triangles (outline) 4833
Triangles (filled) 18426
Rounded rects (outline) 5280
Rounded rects (filled) 51234
Done!
 
Got the display.

Looking at T3.6 to LCD pin selection, I believe 16bit mode is still viable and with only a single write toggle, if using both of the lower 8 bits of ports C and D:
Code:
uint16_t colour = 0xFFFF;
GPIOC_PDOR = colour & 0xFF;   // set lower byte
GPIOD_PDOR = colour >> 8;     // set upper byte
TOGGLE_WR;
This should leave TX1/RX1, SPI2 and the internal SD unaffected, which amounts to my most basic requirements.

Roomtek: Have you connected the backlight directly to the Teensy? The seller of the display lists a backlight drive current of 20ma, but interestingly incorrectly lists the module supply voltage at 2.85v, which is actually the panel voltage and obtained via the on board buck converter.
I imagine the display would have at least 4 LEDs, one per side, which would take the drive current above the pin max of 25ma.
 
You might want to do an orequal, since you are using other devices on the same ports

Code:
uint16_t colour = 0xFFFF;
GPIOC_PDOR |= colour & 0xFF;   // set lower byte
GPIOD_PDOR |= colour >> 8;     // set upper byte
TOGGLE_WR;

I did drive the backligth pin directly using pin 3 and PWM initially, but when creating a PCB, I added an N-channel enhancement mode mosfet.
 
You might want to do an orequal, since you are using other devices on the same ports

Code:
uint16_t colour = 0xFFFF;
GPIOC_PDOR |= colour & 0xFF;   // set lower byte
GPIOD_PDOR |= colour >> 8;     // set upper byte
TOGGLE_WR;

I did drive the backligth pin directly using pin 3 and PWM initially, but when creating a PCB, I added an N-channel enhancement mode mosfet.

I'm aware of the logic, but I selected port C and D as that would leave the SD on PTE 0-5, Serial1 on PTB 16/17 (digital pins 0/1), and SPI2 on PTB 20-23 (digital pins 43-46). It isn't clear to me here where the conflict with port C and D is. Though I could be misreading both the schematic and the pinout card.
 
There may not be any conflicts. I was just assuming that you may want to use other pins on the ports C and D. if other peripherals work, then you are good to go.

Let me know if you need any codes to get it working.
 
Status
Not open for further replies.
Back
Top