Author Topic: NHD-7.0-800480EF-ATXL interfaced to a LPC 1788  (Read 3481 times)

saphira

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
NHD-7.0-800480EF-ATXL interfaced to a LPC 1788
« on: September 08, 2014, 02:44:33 PM »
Hi all,
Im very new to LCD interfacing to a microcontroller.
I'm using LPC 1788 family controller which needs to be interfaced with 7'' LCD(New heaven display NHD-7.0-800480EF-ATXL) which has built in Touch controller FT5406D09. I need some help for this. If someone can share me any sample project for Keil-MDK Arm and guide me as to go further in development will be very much useful.

Thanks in advance.
Saphira

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-7.0-800480EF-ATXL interfaced to a LPC 1788
« Reply #1 on: September 09, 2014, 08:47:47 AM »
Hello saphira,

Unfortunately, we do not have any sample projects to share for that controller, but hopefully someone that stumbles upon this thread will!  What we do have available is our example program code for the controller that we use for our TFTs, and that is the SSD1963.  Here are two links to them:
http://www.newhavendisplay.com/app_notes/TFT_7_0.txt
http://www.newhavendisplay.com/app_notes/Arduino_nhd-7_0-800480EF.txt

For reference for the initialization commands/parameters, you may also refer to the SSD1963 datasheet, here: http://www.newhavendisplay.com/app_notes/SSD1963.pdf

Here is a bit of code that should help out with interfacing the capacitive touch panel:
Code: [Select]
//---------------------------------------------------------
/*
CTP_Register_Test_mega.ino
Program for writing/reading to/from Newhaven Display Capacitive Touch Panel with FocalTech FT5x06 controller
Please refer to the below URLs for the touch panel controller documentation:
http://www.newhavendisplay.com/app_notes/FT5x06.pdf
http://www.newhavendisplay.com/app_notes/FT5x06_registers.pdf

(c)2014 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.
*/
//---------------------------------------------------------
#include <Wire.h>

int WAKE = 14;    //WAKE signal is connected to digital pin 14 on the Arduino Mega2560
int INT = 15;     //INT signal is connected to digital pin 15 on the Arduino Mega2560

//SDA line is connected to digital pin 20 (SDA) on the Arduino Mega2560
//SCL line is connected to digital pin 21 (SCL) on the Arduino Mega2560

unsigned char dummy, gesture, numpoints, t1xh, t1xl, t1yh, t1yl;
unsigned char x, read1, read2, read3, read4;
unsigned int t1x, t1y;

const char slave = 0x38;    //slave address of 0x70 shifted over 1 bit

void init_CTP()
{
digitalWrite(WAKE, HIGH);
        delay(100);
digitalWrite(INT, HIGH);
delay(100);
        digitalWrite(WAKE, LOW);
        delay(200);
        digitalWrite(WAKE, HIGH);
        delay(200);
}
     
void i2c_read(char addr, unsigned char reg)                  //function for reading a specified register
{
  unsigned char x;
  Wire.beginTransmission(addr);
  Wire.write(reg);
  Wire.endTransmission();
  Wire.requestFrom(addr, 1);
  while(Wire.available())
  {
    x = Wire.read();
    Serial.println(x, DEC);
  }
}

void i2c_read4times(char addr, unsigned char reg)           //function for reading 4 registers in a row, starting from specified register
{
  unsigned char x;
  Wire.beginTransmission(addr);
  Wire.write(reg);
  Wire.endTransmission();
  Wire.requestFrom(addr, 4);
  while(Wire.available())
  {
    read1 = Wire.read();
    read2 = Wire.read();
    read3 = Wire.read();
    read4 = Wire.read();
  }
}
/*****************************************************/
/*****************************************************/
void setup()
{
        pinMode(WAKE, OUTPUT);
        pinMode(INT, INPUT);
        init_CTP();
        Wire.begin();
        Serial.begin(9600);       
}
void loop()
{
    while((digitalRead(INT)) == LOW)
    {
        i2c_read4times(slave, 0x00);
        dummy = read1;                               //dummy read
        gesture = read2;                             //which gesture register read
        numpoints = read3;                           //how many touch points register read
        t1xh = read4;                                //upper 8 bits of X-axis touch location
        i2c_read4times(slave, 0x04);
        t1xl = read1;                                //lower 8 bits of X-axis touch location
        t1yh = read2;                                //upper 8 bits of Y-axis touch location
        t1yl = read3;                                //lower 8 bits of X-axis touch location
        dummy = read4;                               //dummy read
        t1x = t1xl | (t1xh << 8);                    //get the 16 bit X-axis touch location
        t1y = t1yl | (t1yh << 8);                    //get the 16 bit Y-axis touch location
       
    //****************************************************************************//
    //  UNCOMMENT THE LINE BELOW THAT YOU WANT TO BE SHOWN ON THE SERIAL MONITOR  //
    //****************************************************************************//
       
        //Serial.println(gesture, HEX);delay(25);    //show gesture value
        //Serial.println(numpoints, HEX);delay(25);  //show how many touch points
        //Serial.println(t1x, HEX);delay(25);        //show 16 bit X-axis touch location
        //Serial.println(t1y, HEX);delay(25);        //show 16 bit Y-axis touch location
       
        //delays are only used here to slow down scrolling in the serial monitor
        //********************************************************************//
    }   
}

For any specific electrical/timing information on the LCD itself, please refer to our datasheet, here: http://www.newhavendisplay.com/specs/NHD-7.0-800480EF-ATXL-CTP.pdf

saphira

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: NHD-7.0-800480EF-ATXL interfaced to a LPC 1788
« Reply #2 on: September 10, 2014, 07:12:48 AM »
Hi Michael,
Thanks for the reply.
Is it possible to get the required driver files as i need to bring the LCD up by interfacing it to LPC1788 and to test the touch panel. OR can u tell me the list of required driver files which needs to be integrated in the project.

Thanks

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-7.0-800480EF-ATXL interfaced to a LPC 1788
« Reply #3 on: September 11, 2014, 08:01:19 AM »
We do not have any driver files available for the display.  As I have previously posted, what we do have is code to initialize and write to the display using the SSD1963 controller.  If you are using a different controller, you would need to refer to that controller's documentation for example initialization code, or search the web for some.  If you are not using a TFT controller, and instead using a 24-bit RGB interface directly, there wouldn't be any initialization code.  You would just need to set the correct timing, shown in the datasheet for the display.

 

NHD‐3.5‐320240MF‐ATXL#‐T‐1 Touch Signal

Started by jmasamotoBoard TFTs

Replies: 1
Views: 2112
Last post February 05, 2016, 08:05:40 AM
by Paul_B
NHD‐3.5‐320240MF‐ATXL#‐CTP‐1 Problem with standby mode

Started by guenterBoard TFTs

Replies: 0
Views: 1948
Last post June 16, 2016, 12:14:36 PM
by guenter
NHD‐4.3‐480272EF‐ATXL#‐CTP | FAN5333 | BBB | Nothing on the Display

Started by Alias_AliasBoard TFTs

Replies: 1
Views: 3430
Last post September 25, 2015, 03:09:24 PM
by Paul_B
NHD-5.0-800480TF-ATXL#-T and NHD-5.0-800480TF-20 Controller Board No Touch?

Started by dfanslerBoard TFTs

Replies: 5
Views: 911
Last post May 26, 2017, 11:10:57 AM
by Saurabh_B
NHD-7.0-800480EF-34 Controller Board vs NHD-4.3-480272MF-34 Controller Board

Started by EdwinSBoard TFTs

Replies: 1
Views: 2766
Last post July 08, 2014, 09:34:55 AM
by Michael_L