Pages: [1]   Go Down
Author Topic: Help Me - 3,5 TFT Touch LCD Screen Display - I can not make it work, help.  (Read 417 times)
0 Members and 1 Guest are viewing this topic.
Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Venezuela
Offline Offline
God Member
*****
Karma: 17
Posts: 520
Ground, ground, always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
//   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 (53.06 KB, 337x450 - viewed 17 times.)
« Last Edit: July 25, 2014, 01:46:39 pm by lucasmacedo » Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 98
Posts: 3568
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Denmark
Offline Offline
God Member
*****
Karma: 15
Posts: 705
Please don't send questions as PM!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Code:
//   ic:ili9327

So, try here:
http://bit.ly/1t5nfZI

// Per.
Logged

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Denmark
Offline Offline
God Member
*****
Karma: 15
Posts: 705
Please don't send questions as PM!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 49
Posts: 1619
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Queens, New York
Online Online
Faraday Member
**
Karma: 98
Posts: 3568
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

ILI9327 researched on various websites, including Arduino.cc unsuccessfully
Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 49
Posts: 1619
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So did i (click !)
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Full Member
***
Karma: 7
Posts: 142
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-cool smiley-cool
Logged

Pages: [1]   Go Up
Jump to: