Help Me - 3,5 TFT Touch LCD Screen Display - I can not make it work, help.

I bought in the Aliexpress 3.5 inch TFT LCD Touch Screen Display Module For Arduino UNO R3 model, but I can not make it work, is just the white screen, the seller gave me a sample code that draws rectangles with a black background on the screen, not against any code that works in LCD tested with examples of UTFT, TFT, Touchscreen libraries, and only white screen appear nothing characters. Please help me, I need urgent work, if someone can provide me information I will be very grateful, here's the seller's website - http://www.aliexpress.com/item/3-5-inch-TFT-Touch-LCD-Screen-Display-Module-For-Arduino-UNO-R3-HIGH-QUALITY-Free/1786048346.html

Hello Lucas,

Your link (including the pictures) does not provide any information of the board. The code close to the touchscreen lines also doesn't mean anything. Could find the brand and model number of the LCD (may be with a booklet or other document in the shipping package?). Regards,

p

The two controllers are in the attached photo are HC245, the seller sent me the sample code, but only this code works, I can do no other work, the following code that works:

//   ic:ili9327  
#define LCD_RD   A0
#define LCD_WR   A1     
#define LCD_RS   A2        
#define LCD_CS   A3       
#define LCD_REST A4

void Lcd_Writ_Bus(char VH)
{
  unsigned char i,temp,data; 
  data=VH;
  for(i=8;i<=9;i++)
  {
    temp=(data&0x01);
    if(temp)
      digitalWrite(i,HIGH);
    else
      digitalWrite(i,LOW);
    data=data>>1;
  }	
  for(i=2;i<=7;i++)
  {
    temp=(data&0x01);
    if(temp)
      digitalWrite(i,HIGH);
    else
      digitalWrite(i,LOW);
    data=data>>1;
  }	 

  digitalWrite(LCD_WR,LOW);
  digitalWrite(LCD_WR,HIGH);
}


void Lcd_Write_Com(char VH)  
{   
  digitalWrite(LCD_RS,LOW);
  Lcd_Writ_Bus(VH);
}

void Lcd_Write_Data(char VH)
{
  digitalWrite(LCD_RS,HIGH);
  Lcd_Writ_Bus(VH);
}

void Lcd_Write_Com_Data(int com,int dat)
{
  Lcd_Write_Com(com);
  Lcd_Write_Data(dat);
}

void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2)
{
  Lcd_Write_Com(0x2a); // Set_column_address 4 parameters
  Lcd_Write_Data(x1>>8);
  Lcd_Write_Data(x1);
  Lcd_Write_Data(x2>>8);
  Lcd_Write_Data(x2);

  Lcd_Write_Com(0x2b); // Set_page_address 4 parameters
  Lcd_Write_Data(y1>>8);
  Lcd_Write_Data(y1);
  Lcd_Write_Data(y2>>8);
  Lcd_Write_Data(y2);

  Lcd_Write_Com(0x2c); // Write_memory_start								 
}

void Lcd_Init(void)
{
  digitalWrite(LCD_REST,HIGH);
  delay(5); 
  digitalWrite(LCD_REST,LOW);
  delay(15);
  digitalWrite(LCD_REST,HIGH);
  delay(15);

  digitalWrite(LCD_CS,HIGH);
  digitalWrite(LCD_WR,HIGH);
  digitalWrite(LCD_CS,LOW);  //CS

  Lcd_Write_Com(0xE9);
  Lcd_Write_Data(0x20);

  Lcd_Write_Com(0x11); //Exit Sleep
  delay(100);

  Lcd_Write_Com(0xD1);
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x71);
  Lcd_Write_Data(0x19);

  Lcd_Write_Com(0xD0);
  Lcd_Write_Data(0x07);
  Lcd_Write_Data(0x01);
  Lcd_Write_Data(0x08);

  Lcd_Write_Com(0x36);
  Lcd_Write_Data(0x48);

  Lcd_Write_Com(0x3A);
  Lcd_Write_Data(0x05);

  Lcd_Write_Com(0xC1);
  Lcd_Write_Data(0x10);
  Lcd_Write_Data(0x10);
  Lcd_Write_Data(0x02);
  Lcd_Write_Data(0x02);

  Lcd_Write_Com(0xC0); //Set Default Gamma
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x35);
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x01);
  Lcd_Write_Data(0x02);

  Lcd_Write_Com(0xC5); //Set frame rate
  Lcd_Write_Data(0x04);

  Lcd_Write_Com(0xD2); //power setting
  Lcd_Write_Data(0x01);
  Lcd_Write_Data(0x44);

  Lcd_Write_Com(0xC8); //Set Gamma
  Lcd_Write_Data(0x04);
  Lcd_Write_Data(0x67);
  Lcd_Write_Data(0x35);
  Lcd_Write_Data(0x04);
  Lcd_Write_Data(0x08);
  Lcd_Write_Data(0x06);
  Lcd_Write_Data(0x24);
  Lcd_Write_Data(0x01);
  Lcd_Write_Data(0x37);
  Lcd_Write_Data(0x40);
  Lcd_Write_Data(0x03);
  Lcd_Write_Data(0x10);
  Lcd_Write_Data(0x08);
  Lcd_Write_Data(0x80);
  Lcd_Write_Data(0x00);

  Lcd_Write_Com(0x2A); 
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0xeF);

  Lcd_Write_Com(0x2B); 
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x00);
  Lcd_Write_Data(0x01);
  Lcd_Write_Data(0x3F);
  Lcd_Write_Data(0x8F); // on internet

  Lcd_Write_Com(0x29); //display on      

  Lcd_Write_Com(0x2C); //display on 

  digitalWrite(LCD_CS,HIGH);
}

void H_line(unsigned int x, unsigned int y, unsigned int l, unsigned int c)                   
{	
  unsigned int i,j;
  Lcd_Write_Com(0x02c); //write_memory_start
  digitalWrite(LCD_RS,HIGH);
  digitalWrite(LCD_CS,LOW);
  l=l+x;
  Address_set(x,y,l,y);
  j=l*2;
  for(i=1;i<=j;i++)
  {
    Lcd_Write_Data(c);
  }
  digitalWrite(LCD_CS,HIGH);   
}

void V_line(unsigned int x, unsigned int y, unsigned int l, unsigned int c)                   
{	
  unsigned int i,j;
  Lcd_Write_Com(0x02c); //write_memory_start
  digitalWrite(LCD_RS,HIGH);
  digitalWrite(LCD_CS,LOW);
  l=l+y;
  Address_set(x,y,x,l);
  j=l*2;
  for(i=1;i<=j;i++)
  {
    Lcd_Write_Data(c);
  }
  digitalWrite(LCD_CS,HIGH);   
}

void Rect(unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int c)
{
  H_line(x  , y  , w, c);
  H_line(x  , y+h, w, c);
  V_line(x  , y  , h, c);
  V_line(x+w, y  , h, c);
}

void Rectf(unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int c)
{
  unsigned int i;
  for(i=0;i<h;i++)
  {
    H_line(x  , y  , w, c);
    H_line(x  , y+i, w, c);
  }
}

void LCD_Clear(unsigned int j)                   
{	
  unsigned int i,m;
  Lcd_Write_Com(0x02c); //write_memory_start
  digitalWrite(LCD_RS,HIGH);
  digitalWrite(LCD_CS,LOW);
  Address_set(0,0,479,399);

  for(i=0;i<480;i++)
    for(m=0;m<400;m++)
    {
      Lcd_Write_Data(j);
    }
  digitalWrite(LCD_CS,HIGH);   
}

void setup()
{
  for(int p=2;p<10;p++)
  {
    pinMode(p,OUTPUT);
  }
  pinMode(A0,OUTPUT);
  pinMode(A1,OUTPUT);
  pinMode(A2,OUTPUT);
  pinMode(A3,OUTPUT);
  pinMode(A4,OUTPUT);
  digitalWrite(A0, HIGH);
  digitalWrite(A1, HIGH);
  digitalWrite(A2, HIGH);
  digitalWrite(A3, HIGH);
  digitalWrite(A4, HIGH);
  Lcd_Init();
  LCD_Clear(0x00);
}

void loop()
{  

  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(0x00);
}

25_07_2014_15_38_27.jpg

But you have a working code, so now add to it. That is an third party LCD, so there may not be a library for it, which means you need to make your own functions. and/or library.

What else are you trying to do with it?

Friend the problem is that I can not develop using the sample code provided, I would like to create buttons, place images on the LCD, but do not know where to start, provided the code is not easy to understand, I would like to customize the LCD but not against possibilities.

The 74HC245 is not the controller.

http://www.nxp.com/documents/data_sheet/74HC_HCT245.pdf

It says on the first line in the code which controller it is for, read the line:

//   ic:ili9327

So, try here:

// Per.

But the controller solder in the card are there in HC245, watching datasheet ILI9327 can change the LCD functions like brightness, gamma, LCD on, Off, but can not create designs, shapes, write on the screen, etc.

The 74HC245 is not a controller - it is a level converter, converting the 5 Volt signals from Arduino to 3.3 Volt which the display can handle.

Have you tried the link i posted ?

// Per.

Those aren't controllers, they are level shifters.
the display functions at 3 volts, Arduino at 5 volts.
Connecting them without level shifters would destroy at least one of them.

What you just called card, is a shield.
Assume a shield is an interface between different devices, which in this case is very much true.
There are 2 devices on that shield; a display with ili9327 controller (possibly built in the glass part), and a SD card reader.

Thats because you need a proper library that has all the functions you're looking for. You can try your luck with the UTFT and UTouch libraries provided HERE, but other then that, YOU need to make the functions yourself.

To be honest, all you really need is a way to make a pixel on the screen and be able to add color to that pixel. The rest will come afterwards.

ILI9327 researched on various websites, including Arduino.cc unsuccessfully

So did i (click !)

Researched by several examples on google and arduino.cc on codes for example ili9327 but not found, help guys.

Looks to me like another copy of the SansSmart Shield and display

If I'm right plug onto a Mega down load UTFT install in IDE and run 320 x 240 examples

happy coding 8) 8)

I think the problem is the connection UNO-Pins with the data-pins DB8 , DB9, … DB15 of the dsiplay:

normally the connection is:

DB8 → digital-Pin 0 = PD0
DB9 → digtal -Pin 1 = PD1
DB10 → digtal-Pin 2 = PD2

DB15 → disgital-Pin7 = PD7

I think the 3.5" display the data-Pins starts at digital -Pin 2

DB8 → digital-PIn 2 = PD2
DB9 → digital-Pin 3 = PD3

DB13 → digtal-Pin 7 = PD7

and now it needs Port B, that’s the Problem

DB14 → digital-Pin8 = PB0
DB15 → digital-Pin9 = PB1

UTFT - I think - needs only Port D for the data - Pins

mausi_mick

an other problem is, that the ILI9237 in UTFT is only 16 bit, not 8 bit (for UNO)

Hi,

on a russian site there is a UTFT 2.77b lib with 8-bit-Mode for ILI9327

look there:

http://arduino.ru/forum/apparatnye-voprosy/tft-35-i-arduino?page=4

the bib is quick

mausi-mick

ILI9327_8Bit__UTFT_2-77b.JPG

Hi, Lucas

Did you reach to any success on 3.5" touch screen?

Hello,

have you tried to load a Bitmap from SD Card and Display it on the Screen. Coud not access the SDCard with UTFT_tinyFat and tiny_Fat.

Working Example ( without SD Card ) for this Display you can get at:
https://www.ex-store.de/media/UTFT_V2.77b.zip
It's an little modified UTFT Library.
Test the ILI9327_400x240_8bit_utft_paint Example and check there the Pin Definitions!!!
There is also an example for the Touchscreen:
ILI9327_UTouch_Calibration, it works if you set Pin Definitions like the first Example.

Just check the IDE included SD Card Library, it works with CS ( chipSelect ) on Pin 10.
But the Problem is that UTFT only displays Byte Arrays and accept no filenames....




I have the same and this is the code that works for this TFT.
Only black screen first and random colored rectangles after.
No touch screen functionality though.
Does anybody has made a library with this code?
Is it possible to build a library for it?
That would be great help for all the people who bought cheap Chinese products like that to do experiments.

//   ic:ili9327  
#define LCD_RD   A0
#define LCD_WR   A1     
#define LCD_RS   A2        
#define LCD_CS   A3       
#define LCD_REST A4

void Lcd_Writ_Bus(char VH)
{
 unsigned char i,temp,data; 
 data=VH;
 for(i=8;i<=9;i++)
 {
   temp=(data&0x01);
   if(temp)
     digitalWrite(i,HIGH);
   else
     digitalWrite(i,LOW);
   data=data>>1;
 } 
 for(i=2;i<=7;i++)
 {
   temp=(data&0x01);
   if(temp)
     digitalWrite(i,HIGH);
   else
     digitalWrite(i,LOW);
   data=data>>1;
 } 

 digitalWrite(LCD_WR,LOW);
 digitalWrite(LCD_WR,HIGH);
}


void Lcd_Write_Com(char VH)  
{   
 digitalWrite(LCD_RS,LOW);
 Lcd_Writ_Bus(VH);
}

void Lcd_Write_Data(char VH)
{
 digitalWrite(LCD_RS,HIGH);
 Lcd_Writ_Bus(VH);
}

void Lcd_Write_Com_Data(int com,int dat)
{
 Lcd_Write_Com(com);
 Lcd_Write_Data(dat);
}

void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2)
{
 Lcd_Write_Com(0x2a); // Set_column_address 4 parameters
 Lcd_Write_Data(x1>>8);
 Lcd_Write_Data(x1);
 Lcd_Write_Data(x2>>8);
 Lcd_Write_Data(x2);

 Lcd_Write_Com(0x2b); // Set_page_address 4 parameters
 Lcd_Write_Data(y1>>8);
 Lcd_Write_Data(y1);
 Lcd_Write_Data(y2>>8);
 Lcd_Write_Data(y2);

 Lcd_Write_Com(0x2c); // Write_memory_start 
}

void Lcd_Init(void)
{
 digitalWrite(LCD_REST,HIGH);
 delay(5); 
 digitalWrite(LCD_REST,LOW);
 delay(15);
 digitalWrite(LCD_REST,HIGH);
 delay(15);

 digitalWrite(LCD_CS,HIGH);
 digitalWrite(LCD_WR,HIGH);
 digitalWrite(LCD_CS,LOW);  //CS

 Lcd_Write_Com(0xE9);
 Lcd_Write_Data(0x20);

 Lcd_Write_Com(0x11); //Exit Sleep
 delay(100);

 Lcd_Write_Com(0xD1);
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x71);
 Lcd_Write_Data(0x19);

 Lcd_Write_Com(0xD0);
 Lcd_Write_Data(0x07);
 Lcd_Write_Data(0x01);
 Lcd_Write_Data(0x08);

 Lcd_Write_Com(0x36);
 Lcd_Write_Data(0x48);

 Lcd_Write_Com(0x3A);
 Lcd_Write_Data(0x05);

 Lcd_Write_Com(0xC1);
 Lcd_Write_Data(0x10);
 Lcd_Write_Data(0x10);
 Lcd_Write_Data(0x02);
 Lcd_Write_Data(0x02);

 Lcd_Write_Com(0xC0); //Set Default Gamma
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x35);
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x01);
 Lcd_Write_Data(0x02);

 Lcd_Write_Com(0xC5); //Set frame rate
 Lcd_Write_Data(0x04);

 Lcd_Write_Com(0xD2); //power setting
 Lcd_Write_Data(0x01);
 Lcd_Write_Data(0x44);

 Lcd_Write_Com(0xC8); //Set Gamma
 Lcd_Write_Data(0x04);
 Lcd_Write_Data(0x67);
 Lcd_Write_Data(0x35);
 Lcd_Write_Data(0x04);
 Lcd_Write_Data(0x08);
 Lcd_Write_Data(0x06);
 Lcd_Write_Data(0x24);
 Lcd_Write_Data(0x01);
 Lcd_Write_Data(0x37);
 Lcd_Write_Data(0x40);
 Lcd_Write_Data(0x03);
 Lcd_Write_Data(0x10);
 Lcd_Write_Data(0x08);
 Lcd_Write_Data(0x80);
 Lcd_Write_Data(0x00);

 Lcd_Write_Com(0x2A); 
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0xeF);

 Lcd_Write_Com(0x2B); 
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x00);
 Lcd_Write_Data(0x01);
 //  Lcd_Write_Data(0x3F);
 Lcd_Write_Data(0x8F); // on internet

 Lcd_Write_Com(0x29); //display on      

 Lcd_Write_Com(0x2C); //display on 

 digitalWrite(LCD_CS,HIGH);
}

void H_line(unsigned int x, unsigned int y, unsigned int l, unsigned int c)                   
{ 
 unsigned int i,j;
 Lcd_Write_Com(0x02c); //write_memory_start
 digitalWrite(LCD_RS,HIGH);
 digitalWrite(LCD_CS,LOW);
 l=l+x;
 Address_set(x,y,l,y);
 j=l*2;
 for(i=1;i<=j;i++)
 {
   Lcd_Write_Data(c);
 }
 digitalWrite(LCD_CS,HIGH);   
}

void V_line(unsigned int x, unsigned int y, unsigned int l, unsigned int c)                   
{ 
 unsigned int i,j;
 Lcd_Write_Com(0x02c); //write_memory_start
 digitalWrite(LCD_RS,HIGH);
 digitalWrite(LCD_CS,LOW);
 l=l+y;
 Address_set(x,y,x,l);
 j=l*2;
 for(i=1;i<=j;i++)
 {
   Lcd_Write_Data(c);
 }
 digitalWrite(LCD_CS,HIGH);   
}

void Rect(unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int c)
{
 H_line(x  , y  , w, c);
 H_line(x  , y+h, w, c);
 V_line(x  , y  , h, c);
 V_line(x+w, y  , h, c);
}

void Rectf(unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int c)
{
 unsigned int i;
 for(i=0;i<h;i++)
 {
   H_line(x  , y  , w, c);
   H_line(x  , y+i, w, c);
 }
}

void LCD_Clear(unsigned int j)                   
{ 
 unsigned int i,m;
 Lcd_Write_Com(0x02c); //write_memory_start
 digitalWrite(LCD_RS,HIGH);
 digitalWrite(LCD_CS,LOW);
 Address_set(0,0,479,399);

 for(i=0;i<480;i++)
   for(m=0;m<400;m++)
   {
     Lcd_Write_Data(j);
   }
 digitalWrite(LCD_CS,HIGH);   
}

void setup()
{
 for(int p=2;p<10;p++)
 {
   pinMode(p,OUTPUT);
 }
 pinMode(A0,OUTPUT);
 pinMode(A1,OUTPUT);
 pinMode(A2,OUTPUT);
 pinMode(A3,OUTPUT);
 pinMode(A4,OUTPUT);
 digitalWrite(A0, HIGH);
 digitalWrite(A1, HIGH);
 digitalWrite(A2, HIGH);
 digitalWrite(A3, HIGH);
 digitalWrite(A4, HIGH);
 Lcd_Init();
 LCD_Clear(0x00);
}

void loop()
{  

 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(0x00);
}