Pages: [1]   Go Down
Author Topic: 2.4 tft lcd touch shield no response when touching screen  (Read 2442 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I am trying to calibrate my 2.4" touch screen, using the in build UTouch_Calibration sketch provided
I am using an Arduino Uno R3
Touch screen is iteadstudio http://imall.iteadstudio.com/development-platform/im120417012.html

The program uploads and displays correctly but when trying to touch the screen to continue there is no response,
I am not sure if the initialization numbers are correct. smiley-eek

here is the code
#include <UTFT.h>
#include <UTouch.h>

// Define the orientation of the touch screen. Further
// information can be found in the instructions.
#define TOUCH_ORIENTATION  PORTRAIT

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Uncomment the next two lines for the Arduino 2009/UNO
UTFT        myGLCD(ITDB24E_8,19,18,17,16);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(15,8,14,9,10);

// Uncomment the next two lines for the Arduino Mega
//UTFT        myGLCD(ITDB32S,38,39,40,41);   // Remember to change the model parameter to suit your display module!
//UTouch      myTouch(6,5,4,3,2);

// ************************************
// DO NOT EDIT ANYTHING BELOW THIS LINE
// ************************************
uint32_t cx, cy;
uint32_t rx[10], ry[10];
uint32_t clx, crx, cty, cby;
float px, py;
int dispx, dispy, text_y_center;
uint32_t calx, caly, cals;
char buf[13];

void setup()
{
  myGLCD.InitLCD(); //do i need to place PORTRAIT in here?
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);

  myTouch.InitTouch(TOUCH_ORIENTATION);
  myTouch.setPrecision(PREC_LOW);
  dispx=myGLCD.getDisplayXSize();
  dispy=myGLCD.getDisplayYSize();
  text_y_center=(dispy/2)-6;
}
/////////////////////////
//REMOVED REST OF CODE FOR POST

Thanks
J
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Fixed it...  smiley-draw

this is what the issue is:
UTouch      myTouch(15,8,14,9,10); //original code
changed to
UTouch      myTouch(15,10,14,8,9); // now working

this is because the Utouch.cpp code calls the object with the following parameters
UTouch::UTouch(byte tclk,byte tcs, byte din, byte dout, byte irq)
{
T_CLK = tclk;
T_CS = tcs;
T_Din = din;
T_DOUT = dout;
T_IRQ = irq;
}
the Touch_CLK etc I got from the iteadstudio data sheet, so one can tell what pin numbers are used on the Arduino.
so the bottom line is the pin numbers need to pass in the correct order for the touch to work.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm also using the Arduino 2.4" TFT LCD Touch shield and by reviewing the product specification I use another pin setup.
(The TFT driver is based on S6D112 with 8bit data and 4bit control interface)

The pin mapping with Arduino Uno R3 board that I use is:

Code:
#define TOUCH_ORIENTATION  PORTRAIT // If ribbon cable is on the short side the set orientation equal to PORTRAIT.

#define T_CLK 15   //Touch_CLK
#define T_CS 17    //TFT_CS  (SD_CS on 10)
#define T_DIN 14   //Touch_Din
#define T_DOUT 8   //Touch_Dout
#define T_IRQ 9    //Touch_IRQ

// Arduino 2009/UNO - Arduino 2.4" TFT LCD Touch shield
UTFT       myGLCD(ITDB24E_8, 19, 18, 17, 16);
UTouch     myTouch(T_CLK, T_CS, T_DIN, T_DOUT, T_IRQ);


Br.
DS
« Last Edit: March 10, 2013, 07:21:20 pm by dansan » Logged

Pages: [1]   Go Up
Jump to: