Loading...

You have no items in your shopping cart.

 
 
 
×

Registration

Profile Informations

Login Datas

or login

First name is required!
Last name is required!
First name is not valid!
Last name is not valid!
This is not an email address!
Email address is required!
This email is already registered!
Password is required!
Enter a valid password!
Please enter 6 or more characters!
Please enter 16 or less characters!
Passwords are not same!
Terms and Conditions are required!
Email or Password is wrong!
Captcha is required!
Captcha is wrong!

Raspberry Pi To ITDB02 Series LCD Adapter Kit

With the best selling of Raspberry Pi, we are receiving more and more e-mails consulting how to drive our ITDB02 Series TFT LCD modules with Raspberry Pi. If you use the I/O library of Raspberry Pi, it is quite easy to drive these screens to achieve a variety of displays.

To facilitate the use of Raspberry Pi and screen module to work together, we specifically developed a simple adapter board and customized a batch of 26-pin (2X13) cable . Simply insert the screen module into the adapter board, then connect the board and Raspberry Pi plate with cable, thus the hardware connection is done, saving the trouble of corresponding connection of each pin.

Following is a mapping table from pins of Raspberry Pi to those of screen module generated after using the adapter board:

Pin of ITDB02 LCD Pins of Raspberry
DB8 D0
DB9 D1
DB10 D2
DB11 D3
DB12 D4
DB13 D5
DB14 D6
DB15 D7
CS D10
RS D8
WR D9
RST D11
T_CLK D12
T_CS D13
T_DIN D14
T_DOUT D15
T_IRQ D16
VCC +5V 
GND GND

The pin of Raspberry Pi can be used to drive the corresponding pin of screen module in the table.

Here we provide a complete example of driving a ITDB02-2.8 module with Raspberry Pi, to let it refresh blue, red, green and black, and then enter into touch mode. When your fingers click the corresponding position, it will be filled with a white point to achieve the handwriting function.

#include 
#include 

void loop(void);
/**********************************************
Define zone
**********************************************/
#define RS 8
#define WR 9
#define CS 10
#define RST 11

#define DB0 0
#define DB1 1
#define DB2 2
#define DB3 3
#define DB4 4
#define DB5 5
#define DB6 6
#define DB7 7


#define T_CLK 12
#define T_CS 13
#define T_DIN 14
#define T_DOUT 15
#define T_IRQ 16

#define X_CONST 240
#define Y_CONST 320

#define PREC_TOUCH_CONST 1500

#define PixSizeX	13.78
#define PixOffsX	411

#define PixSizeY	11.01
#define PixOffsY	378

#define WINDOW_XADDR_START	0x0050 // Horizontal Start Address Set
#define WINDOW_XADDR_END	0x0051 // Horizontal End Address Set
#define WINDOW_YADDR_START	0x0052 // Vertical Start Address Set
#define WINDOW_YADDR_END	0x0053 // Vertical End Address Set
#define GRAM_XADDR		    0x0020 // GRAM Horizontal Address Set
#define GRAM_YADDR		    0x0021 // GRAM Vertical Address Set
#define GRAMWR 			    0x0022 // memory write

/* LCD color */
#define White          0xFFFF
#define Black          0x0000
#define Blue           0x001F
#define Blue2          0x051F
#define Red            0xF800
#define Magenta        0xF81F
#define Green          0x07E0
#define Cyan           0x7FFF
#define Yel0         0xFFE0

/**********************************************
Val Zone
**********************************************/
int TP_X,TP_Y;


/**********************************************
Standard C functions zone
**********************************************/

void Write_Command(unsigned int c)
{
        digitalWrite(RS,0);
 	digitalWrite(CS,0);
	if(c & (1<<15))
		digitalWrite(DB7,1);
	else
		digitalWrite(DB7,0);
if(c & (1<<14))
		digitalWrite(DB6,1);
	else
		digitalWrite(DB6,0);
if(c & (1<<13))
		digitalWrite(DB5,1);
	else
		digitalWrite(DB5,0);
if(c & (1<<12))
		digitalWrite(DB4,1);
	else
		digitalWrite(DB4,0);
if(c & (1<<11))
		digitalWrite(DB3,1);
	else
		digitalWrite(DB3,0);
if(c & (1<<10))
		digitalWrite(DB2,1);
	else
		digitalWrite(DB2,0);
if(c & (1<<9))
		digitalWrite(DB1,1);
	else
		digitalWrite(DB1,0);
if(c & (1<<8))
		digitalWrite(DB0,1);
	else
		digitalWrite(DB0,0);
	digitalWrite(WR,0);
	digitalWrite(WR,1);	
	if(c & (1<<7))
		digitalWrite(DB7,1);
	else
		digitalWrite(DB7,0);
if(c & (1<<6))
		digitalWrite(DB6,1);
	else
		digitalWrite(DB6,0);
if(c & (1<<5))
		digitalWrite(DB5,1);
	else
		digitalWrite(DB5,0);
if(c & (1<<4))
		digitalWrite(DB4,1);
	else
		digitalWrite(DB4,0);
if(c & (1<<3))
		digitalWrite(DB3,1);
	else
		digitalWrite(DB3,0);
if(c & (1<<2))
		digitalWrite(DB2,1);
	else
		digitalWrite(DB2,0);
if(c & (1<<1))
		digitalWrite(DB1,1);
	else
		digitalWrite(DB1,0);
if(c & (1<<0))
		digitalWrite(DB0,1);
	else
		digitalWrite(DB0,0);		
	digitalWrite(WR,0);
	digitalWrite(WR,1);
	digitalWrite(CS,1);
}


void Write_Data(unsigned int c)
{
        digitalWrite(RS,1);
	digitalWrite(CS,0); 
		if(c & (1<<15))
		digitalWrite(DB7,1);
	else
		digitalWrite(DB7,0);
if(c & (1<<14))
		digitalWrite(DB6,1);
	else
		digitalWrite(DB6,0);
if(c & (1<<13))
		digitalWrite(DB5,1);
	else
		digitalWrite(DB5,0);
if(c & (1<<12))
		digitalWrite(DB4,1);
	else
		digitalWrite(DB4,0);
if(c & (1<<11))
		digitalWrite(DB3,1);
	else
		digitalWrite(DB3,0);
if(c & (1<<10))
		digitalWrite(DB2,1);
	else
		digitalWrite(DB2,0);
if(c & (1<<9))
		digitalWrite(DB1,1);
	else
		digitalWrite(DB1,0);
if(c & (1<<8))
		digitalWrite(DB0,1);
	else
		digitalWrite(DB0,0);
	digitalWrite(WR,0);
	digitalWrite(WR,1);	
	if(c & (1<<7))
		digitalWrite(DB7,1);
	else
		digitalWrite(DB7,0);
if(c & (1<<6))
		digitalWrite(DB6,1);
	else
		digitalWrite(DB6,0);
if(c & (1<<5))
		digitalWrite(DB5,1);
	else
		digitalWrite(DB5,0);
if(c & (1<<4))
		digitalWrite(DB4,1);
	else
		digitalWrite(DB4,0);
if(c & (1<<3))
		digitalWrite(DB3,1);
	else
		digitalWrite(DB3,0);
if(c & (1<<2))
		digitalWrite(DB2,1);
	else
		digitalWrite(DB2,0);
if(c & (1<<1))
		digitalWrite(DB1,1);
	else
		digitalWrite(DB1,0);
if(c & (1<<0))
		digitalWrite(DB0,1);
	else
		digitalWrite(DB0,0);		
	digitalWrite(WR,0);
	digitalWrite(WR,1);
	digitalWrite(CS,1);
}

void Write_Command_Data(unsigned int cmd,unsigned int dat)
{
	Write_Command(cmd);
	Write_Data(dat);
}

void Lcd_Init()
{
	pinMode(RS,OUTPUT);
	pinMode(WR,OUTPUT);
	pinMode(CS,OUTPUT);
	pinMode(RST,OUTPUT);
	pinMode(DB0,OUTPUT);
	pinMode(DB1,OUTPUT);
	pinMode(DB2,OUTPUT);
	pinMode(DB3,OUTPUT);
	pinMode(DB4,OUTPUT);
	pinMode(DB5,OUTPUT);
	pinMode(DB6,OUTPUT);
	pinMode(DB7,OUTPUT);

  
	digitalWrite(RST,1);
        delay(1);	
	digitalWrite(RST,0);
	delay(1);
	
	digitalWrite(RST,1);
	digitalWrite(CS,1);
	digitalWrite(WR,1);
	delay(20);

	
	Write_Command_Data(0x0011,0x2004);		
        Write_Command_Data(0x0013,0xCC00);		
        Write_Command_Data(0x0015,0x2600);	
	Write_Command_Data(0x0014,0x252A);			
	Write_Command_Data(0x0012,0x0033);		
	Write_Command_Data(0x0013,0xCC04);		
	Write_Command_Data(0x0013,0xCC06);		
	Write_Command_Data(0x0013,0xCC4F);		
	Write_Command_Data(0x0013,0x674F);
	Write_Command_Data(0x0011,0x2003);
	Write_Command_Data(0x0030,0x2609);		
	Write_Command_Data(0x0031,0x242C);		
	Write_Command_Data(0x0032,0x1F23);		
	Write_Command_Data(0x0033,0x2425);		
	Write_Command_Data(0x0034,0x2226);		
	Write_Command_Data(0x0035,0x2523);		
	Write_Command_Data(0x0036,0x1C1A);		
	Write_Command_Data(0x0037,0x131D);		
	Write_Command_Data(0x0038,0x0B11);		
	Write_Command_Data(0x0039,0x1210);		
	Write_Command_Data(0x003A,0x1315);		
	Write_Command_Data(0x003B,0x3619);		
	Write_Command_Data(0x003C,0x0D00);		
	Write_Command_Data(0x003D,0x000D);		
	Write_Command_Data(0x0016,0x0007);		
	Write_Command_Data(0x0002,0x0013);		
	Write_Command_Data(0x0003,0x0003);		
	Write_Command_Data(0x0001,0x0127);		 
	Write_Command_Data(0x0008,0x0303);		
	Write_Command_Data(0x000A,0x000B);		
	Write_Command_Data(0x000B,0x0003);   
	Write_Command_Data(0x000C,0x0000);   
	Write_Command_Data(0x0041,0x0000);    
	Write_Command_Data(0x0050,0x0000);   
	Write_Command_Data(0x0060,0x0005);    
        Write_Command_Data(0x0070,0x000B);    
	Write_Command_Data(0x0071,0x0000);    
	Write_Command_Data(0x0078,0x0000);    
	Write_Command_Data(0x007A,0x0000);   
	Write_Command_Data(0x0079,0x0007);		
	Write_Command_Data(0x0007,0x0051);   
	Write_Command_Data(0x0007,0x0053);		
	Write_Command_Data(0x0079,0x0000);

	Write_Command(0x0022);
	
}
void SetXY(unsigned int x0,unsigned int x1,unsigned int y0,unsigned int y1)
{
  Write_Command_Data(0x0046,(x1 << 8)| x0);
  //Write_Command_Data(0x0047,x1);
  Write_Command_Data(0x0047,y1);
  Write_Command_Data(0x0048,y0);
  Write_Command_Data(0x0020,x0);
  Write_Command_Data(0x0021,y0);
  Write_Command (0x0022);//LCD_WriteCMD(GRAMWR);
}
void Pant(unsigned int color)
{
	int i,j;
	SetXY(0,239,0,319);

    for(i=0;i<320;i++)
	 {
	  for (j=0;j<240;j++)
	   	{
         Write_Data(color);
	    }

	  }		
}
void LCD_clear()
{
    unsigned int i,j;
	SetXY(0,239,0,319);
	for(i=0;i

At current, both the cable and blue adapter board are still in production, and the adapter board + cable kit will be on sales in Imall soon. Now we have 15 sets of green sample boards remaining, and we want to send them to you for free. If you want to have one, you only need to ReTweet us in Twitter. If the number of RT is less than 15, we will contact each of you and send one to you; if the number of RT is more than 15, we will randomly select 15 lucky guys.

Related article: