Author Topic: NHD-5.7-640480WF-CTXL-T  (Read 2229 times)

Mike18

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
NHD-5.7-640480WF-CTXL-T
« on: July 01, 2015, 07:37:42 AM »
Hello,

I am trying  to configure NHD-5.7-640480WF-CTXL-T display with SSD1963 driver, but I can not find values for: HBP.HFP,HSYNC,VBP,VFP ,VSYNC.

Please Help

Mike

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: NHD-5.7-640480WF-CTXL-T
« Reply #1 on: July 15, 2015, 10:32:31 AM »
Hi Mike!

Please consult the SSD1963 spec for additional timing characteristics  ;)

http://www.newhavendisplay.com/app_notes/SSD1963.pdf

Next, I have attached some example Arduino code:

Code: [Select]
//---------------------------------------------------------
/*
NHD_5_7_640480WF_mega.ino
Program for writing to Newhaven Display 5.7 TFT with NHD-5.7-640480WF-20 Controller Board (SSD1963, 8-bit)

(c)2013 Mike LaVine - Newhaven Display International, LLC.

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
*/
//---------------------------------------------------------

// The 8 bit data bus is connected to PORTA of the Arduino Mega2560
// 5V voltage regulator on Arduino Mega has been replaced with a 3.3V regulator to provide 3.3V logic

int RS  = 30;    // RS signal connected to Arduino digital pin 30
int WR  = 31;    // /WR signal connected to Arduino digital pin 31
int RD  = 32;    // /RD signal connected to Arduino digital pin 32
int RES = 33;    // /RES signal connected to Arduino digital pin 33

// /CS signal tied to GND
// U/D and R/L signals can be either high or low, depending on scan direction preference

//;******************************************************************************
void TFT_Write_Command(unsigned char command)
{
  digitalWrite(RS, LOW);
  PORTA = command;
  digitalWrite(WR, LOW);
  digitalWrite(WR, HIGH);
}
//;******************************************************************************
void TFT_Write_Data(unsigned char data)
{
  //digitalWrite(RS, HIGH);
  PORTA = data;
  digitalWrite(WR, LOW);
  digitalWrite(WR, HIGH);
}
//====================================================
void TFT_Command_Write(unsigned char REG,unsigned char VALUE)
{
        TFT_Write_Command(REG);
        digitalWrite(RS, HIGH);
        TFT_Write_Data(VALUE);
}
//======================================================
void WindowSet(unsigned int s_x,unsigned int e_x,unsigned int s_y,unsigned int e_y)
{
TFT_Write_Command(0x2a); //SET column address
digitalWrite(RS, HIGH);
TFT_Write_Data((s_x)>>8); //SET start column address
TFT_Write_Data(s_x);
TFT_Write_Data((e_x)>>8); //SET end column address
TFT_Write_Data(e_x);

TFT_Write_Command(0x2b); //SET page address
digitalWrite(RS, HIGH);
TFT_Write_Data((s_y)>>8); //SET start page address
TFT_Write_Data(s_y);
TFT_Write_Data((e_y)>>8); //SET end page address
TFT_Write_Data(e_y);
}
void disp()
{
unsigned int i, j;
        WindowSet(0,639,0,479);               //set start/end column/page address (full screen)
TFT_Write_Command(0x2C);              //command to begin writing to frame memory
        digitalWrite(RS, HIGH);
for(i=0;i<480;i++)         //fill screen with blue pixels
{
    for(j=0;j<640;j++)
            {
              TFT_Write_Data(0xFF);
              TFT_Write_Data(0x00);
              TFT_Write_Data(0x00);
            }
}
        WindowSet(0,639,0,479);               //set start/end column/page address (full screen)
TFT_Write_Command(0x2C);              //command to begin writing to frame memory
        digitalWrite(RS, HIGH);
        for(i=0;i<480;i++)         //fill screen with green pixels
{
    for(j=0;j<640;j++)
            {
              TFT_Write_Data(0x00);
              TFT_Write_Data(0xFF);
              TFT_Write_Data(0x00);
            }
}
        WindowSet(0,639,0,479);               //set start/end column/page address (full screen)
TFT_Write_Command(0x2C);              //command to begin writing to frame memory
        digitalWrite(RS, HIGH);
        for(i=0;i<480;i++)         //fill screen with red pixels
{
    for(j=0;j<640;j++)
            {
              TFT_Write_Data(0x00);
              TFT_Write_Data(0x00);
              TFT_Write_Data(0xFF);
            }
}
}
//======================================================
void setup()
{
  DDRA = 0xFF;
  PORTA = 0x00;
  DDRC = 0xFF;
  PORTC = 0x00;
  digitalWrite(RD, HIGH);
  digitalWrite(WR, LOW);
  digitalWrite(RES, LOW);
  delay(120);
  digitalWrite(RES, HIGH);
  delay(120);
  TFT_Write_Command(0x01);         //Software reset
  delay(120);
  TFT_Write_Command(0xe2);         //set multiplier and divider of PLL
  digitalWrite(RS, HIGH);
  TFT_Write_Data(0x1d);
  TFT_Write_Data(0x02);
  TFT_Write_Data(0x04);
  TFT_Command_Write(0xe0,0x01);    //Enable PLL
  delay(1);
  TFT_Command_Write(0xe0,0x03);    //Lock PLL
  TFT_Write_Command(0x01);         //Software reset
  delay(120);
  TFT_Write_Command(0xb0); //SET LCD MODE  SET TFT 18Bits MODE
  digitalWrite(RS, HIGH);
  TFT_Write_Data(0x0c); //SET TFT MODE & hsync+Vsync+DEN MODE
  TFT_Write_Data(0x80); //SET TFT MODE & hsync+Vsync+DEN MODE
  TFT_Write_Data(0x02); //SET horizontal size=320-1 HightByte
  TFT_Write_Data(0x7f);         //SET horizontal size=320-1 LowByte
  TFT_Write_Data(0x01); //SET vertical size=240-1 HightByte
  TFT_Write_Data(0xdf); //SET vertical size=240-1 LowByte
  TFT_Write_Data(0x00); //SET even/odd line RGB seq.=RGB
  TFT_Command_Write(0xf0,0x00);         //SET pixel data I/F format=8bit
  TFT_Command_Write(0x36,0x09);         //SET address mode=flip vertical 
  TFT_Write_Command(0xe6);    //SET PCLK freq
  digitalWrite(RS, HIGH);
  TFT_Write_Data(0x02);
  TFT_Write_Data(0xff);
  TFT_Write_Data(0xff);
  TFT_Write_Command(0xb4); //SET HBP
  digitalWrite(RS, HIGH);
  TFT_Write_Data(0x02); //SET HSYNC Total=760
  TFT_Write_Data(0xf8);
  TFT_Write_Data(0x00); //SET HBP 68
  TFT_Write_Data(0x44);
  TFT_Write_Data(0x0f);  //SET HSYNC Pulse Width=128=127pixels+1
  TFT_Write_Data(0x00); //SET Hsync pulse start position
  TFT_Write_Data(0x00);
  TFT_Write_Data(0x00); //SET Hsync pulse subpixel start position
  TFT_Write_Command(0xb6); //SET VBP
  digitalWrite(RS, HIGH);
  TFT_Write_Data(0x01); //SET Vsync total
  TFT_Write_Data(0xf8);
  TFT_Write_Data(0x00); //SET VBP=19
  TFT_Write_Data(0x13);
  TFT_Write_Data(0x07);  //SET VSYNC Pulse Width= 8=7lines+1
  TFT_Write_Data(0x00); //SET Vsync pulse start position
  TFT_Write_Data(0x00);
  TFT_Write_Command(0x13); //SET display on
  //TFT_Write_Command(0x38); //SET display on
  TFT_Write_Command(0x29); //SET display on
  delay(10);
}

void loop()
{
  disp();
  delay(1000); 
}

Hope this helps!

 

NHD‐2.4‐240320SF‐CTXL#‐FTN1 touch-screen problem

Started by hbcelebiBoard TFTs

Replies: 5
Views: 4179
Last post December 10, 2014, 11:19:05 AM
by Michael_L
Working on NHD‐2.4‐240320SF‐CTXL#‐FTN1, have problem in initialization

Started by sli25Board TFTs

Replies: 6
Views: 3791
Last post June 04, 2015, 09:52:25 PM
by sli25
Problem in bringing up NHD‐2.4‐240320SF‐CTXL#‐FTN1 on Renesas RL78/G14

Started by sli25Board TFTs

Replies: 3
Views: 3057
Last post May 28, 2015, 02:59:03 PM
by Michael_L
different voltages for VDD and IOVDD (NHD-2.4-240320SF-CTXL#-FTN1)

Started by jhagmarBoard TFTs

Replies: 1
Views: 2588
Last post June 19, 2014, 09:40:02 AM
by Michael_L
Touch Screen - NHD-2.4-240320SF-CTXL#-FTN1

Started by marcelocrrBoard TFTs

Replies: 2
Views: 2352
Last post November 23, 2014, 10:07:16 AM
by PeterT