Pages: [1]   Go Down
Author Topic: Help: 3.0" 400x240 LCD R61509V Library for Arduino?  (Read 867 times)
0 Members and 1 Guest are viewing this topic.
France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to use the 3.0" inch TFT LCD module 16:9 400x240 w/touchpad PCB adapter connected to an Arduino ATmega2560 through the TFT/SD Shield for Arduino MEGA 2560 LCD Module SD level translation.

I've added the following code specific to the R61509V but unfortunately, nothing is displayed.

Thank you for your help.


Edited UTFT_Demo_400x240.ino main sketch with
Code:
UTFT myGLCD(R61509V,38,39,40,41);   // R61509V  (16bit)

Added to function UTFT::UTFT(byte model, int RS, int WR,int CS, int RST, int SER)
Code:
...
        case R61509V:
disp_x_size=239;
disp_y_size=399;
display_transfer_mode=16;
break;
...

Added to function void UTFT::InitLCD(byte orientation)
Code:
...
#ifndef DISABLE_R61509V
    #include "tft_drivers/R61509V/initlcd.h"
#endif
...

Added to function void UTFT::setXY(word x1, word y1, word x2, word y2)
Code:
...
#ifndef DISABLE_R61509V
    #include "tft_drivers/R61509V/setxy.h"
#endif
...

New file tft_drivers/R61509V/setxy.h
Code:
case R61509V:
LCD_Write_COM(0x0210); /* GRAM Vertical/Horizontal ADDR Set(AD0~AD7) */
LCD_Write_DATA(x1);
LCD_Write_COM(0x0211); /* GRAM Vertical/Horizontal ADDR Set(AD8~AD16) */
LCD_Write_DATA(x2);
LCD_Write_COM(0x0212); /* GRAM Vertical/Horizontal ADDR Set(AD0~AD7) */
LCD_Write_DATA(y1);
LCD_Write_COM(0x0213); /* GRAM Vertical/Horizontal ADDR Set(AD8~AD16) */
LCD_Write_DATA(y2);

LCD_Write_COM(0x0200); /* GRAM Vertical/Horizontal ADDR Set(AD8~AD16) */
LCD_Write_DATA(x1);
LCD_Write_COM(0x0201); /* GRAM Vertical/Horizontal ADDR Set(AD0~AD7) */
LCD_Write_DATA(y1);

LCD_Write_COM(0x0202); /* Write Data to GRAM */
break;

New file tft_drivers/R61509V/initlcd.h
Code:
case R61509V:

/* Initialize R61509V */
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
delay(10);
LCD_Write_COM(0x0400);
LCD_Write_DATA(0x6200);
LCD_Write_COM(0x0008);
LCD_Write_DATA(0x0808);
LCD_Write_COM(0x0010);
LCD_Write_DATA(0x0010);
LCD_Write_COM(0x0400);
LCD_Write_DATA(0x6200);

/* GAMMA */
LCD_Write_COM(0x0300);
LCD_Write_DATA(0x0c06);
LCD_Write_COM(0x0301);
LCD_Write_DATA(0x9d0f);
LCD_Write_COM(0x0302);
LCD_Write_DATA(0x0b05);
LCD_Write_COM(0x0303);
LCD_Write_DATA(0x1217);
LCD_Write_COM(0x0304);
LCD_Write_DATA(0x3333);
LCD_Write_COM(0x0305);
LCD_Write_DATA(0x1712);
LCD_Write_COM(0x0306);
LCD_Write_DATA(0x950b);
LCD_Write_COM(0x0307);
LCD_Write_DATA(0x0f0d);
LCD_Write_COM(0x0308);
LCD_Write_DATA(0x060c);
LCD_Write_COM(0x0309);
LCD_Write_DATA(0x0000);

LCD_Write_COM(0x0010);
LCD_Write_DATA(0x0014);
LCD_Write_COM(0x0011);
LCD_Write_DATA(0x0202);
LCD_Write_COM(0x0012);
LCD_Write_DATA(0x0101);
LCD_Write_COM(0x0013);
LCD_Write_DATA(0x0001);

LCD_Write_COM(0x0007);
LCD_Write_DATA(0x0001);
LCD_Write_COM(0x0100);
LCD_Write_DATA(0x0730); /* BT,AP 0x0330 */
LCD_Write_COM(0x0101);
LCD_Write_DATA(0x0237); /* DC0,DC1,VC */
LCD_Write_COM(0x0103);
LCD_Write_DATA(0x2b00); /* VDV 0x0f00 */
LCD_Write_COM(0x0280);
LCD_Write_DATA(0x4000); /* VCM   */
LCD_Write_COM(0x0102);
LCD_Write_DATA(0x81b0); /*VRH,VCMR,PSON,PON */
delay(100);

LCD_Write_COM(0x0001);
LCD_Write_DATA(0x0100);
LCD_Write_COM(0x0002);
LCD_Write_DATA(0x0100);
LCD_Write_COM(0x0003); /* Entry Mode Set  Set GRAM write direction and BGR=1 */
LCD_Write_DATA((1<<12)|(1<<9)|(1<<7)|(1<<5)|(1<<4)|(0<<3));
LCD_Write_COM(0x0009);
LCD_Write_DATA(0x0001);

LCD_Write_COM(0x000C);
LCD_Write_DATA(0x0000); /* MCU interface */

LCD_Write_COM(0x0090);
LCD_Write_DATA(0x8000);
LCD_Write_COM(0x000f);
LCD_Write_DATA(0x0000);

LCD_Write_COM(0x0500);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0501);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0502);
LCD_Write_DATA(0x005f);
LCD_Write_COM(0x0401);
LCD_Write_DATA(0x0001);
LCD_Write_COM(0x0404);
LCD_Write_DATA(0x0000);
delay(100);
LCD_Write_COM(0x0007);
LCD_Write_DATA(0x0100);
delay(100);

break;
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Haalo avenue33, have you solved the problem?
Morale64
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 637
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No smiley-sad
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you see this folder?
https://www.dropbox.com/sh/yuz21ie5dboxpyk/KEwGkSMXhV
from this Ihave extracted the address list and is little different from the one you have posted:
case R61509V:

/* Initialize R61509V */
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0000);
LCD_Write_DATA(0x0000);
delay(10);
LCD_Write_COM(0x0400);
LCD_Write_DATA(0x6200);
LCD_Write_COM(0x0008);
LCD_Write_DATA(0x0808);


/* GAMMA */
LCD_Write_COM(0x0300);
LCD_Write_DATA(0x0c00);
LCD_Write_COM(0x0301);
LCD_Write_DATA(0x5A0B);
LCD_Write_COM(0x0302);
LCD_Write_DATA(0x0906);
LCD_Write_COM(0x0303);
LCD_Write_DATA(0x1017);
LCD_Write_COM(0x0304);
LCD_Write_DATA(0x2300);
LCD_Write_COM(0x0305);
LCD_Write_DATA(0x1700);
LCD_Write_COM(0x0306);
LCD_Write_DATA(0x6309);
LCD_Write_COM(0x0307);
LCD_Write_DATA(0x0C09);
LCD_Write_COM(0x0308);
LCD_Write_DATA(0x100C);
LCD_Write_COM(0x0309);
LCD_Write_DATA(0x2232);

LCD_Write_COM(0x0010);
LCD_Write_DATA(0x0016);
LCD_Write_COM(0x0011);
LCD_Write_DATA(0x0101);
LCD_Write_COM(0x0012);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0013);
LCD_Write_DATA(0x0001);


LCD_Write_COM(0x0100);
LCD_Write_DATA(0x0330);                /* BT,AP 0x0330 */
LCD_Write_COM(0x0101);
LCD_Write_DATA(0x0237);                   /* DC0,DC1,VC */
LCD_Write_COM(0x0103);
LCD_Write_DATA(0x0D00);                /* VDV   0x0f00 */
LCD_Write_COM(0x0280);
LCD_Write_DATA(0x6100);                /* VCM        */
LCD_Write_COM(0x0102);
LCD_Write_DATA(0xC1B0);                /*VRH,VCMR,PSON,PON */
delay(100);

LCD_Write_COM(0x0001);
LCD_Write_DATA(0x0100);
LCD_Write_COM(0x0002);
LCD_Write_DATA(0x0100);
LCD_Write_COM(0x0003);                  /* Entry Mode Set  Set GRAM write direction and BGR=1 */
LCD_Write_DATA(0x1030);
LCD_Write_COM(0x0009);
LCD_Write_DATA(0x0001);

LCD_Write_COM(0x000C);
LCD_Write_DATA(0x0000);                  /* MCU interface */

LCD_Write_COM(0x0090);
LCD_Write_DATA(0x8000);
LCD_Write_COM(0x000f);
LCD_Write_DATA(0x0000);

LCD_Write_COM(0x0210);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0211);
LCD_Write_DATA(0x00EF);
LCD_Write_COM(0x0212);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0213);
LCD_Write_DATA(0x018F);

LCD_Write_COM(0x0500);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0501);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0502);
LCD_Write_DATA(0x005f);
LCD_Write_COM(0x0401);
LCD_Write_DATA(0x0001);
LCD_Write_COM(0x0404);
LCD_Write_DATA(0x0000);
delay(100);
LCD_Write_COM(0x0007);
LCD_Write_DATA(0x0100);
delay(100);
LCD_Write_COM(0x0200);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0201);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0x0202);
break;
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use the connection from UTFT library
Logged

Pages: [1]   Go Up
Jump to: