Arduino Forum

Products => Arduino Due => Topic started by: promacjoe on Apr 21, 2013, 09:13 pm

Title: Announcement: CTE has updated their drivers.
Post by: promacjoe on Apr 21, 2013, 09:13 pm
CTE has released an updated driver, that fixed some of the problems we have been having.
Unfortunately the display is still mirrored, although annoying it is a minor inconvenience compared to some of the other problems i was having.

The "UTFT fonts" now display properly using the "UTFT print function" . This has been the main problem I was having. I have only done limited testing, but the results have been good. This means we can format numbers using the " PrintNnumI or the PrintNnumF " statements. It also means we can make our own fonts using the UTFT font converter, or we can do it manually, "kind of a pain". Unfortunately the fonts provided with the displays will still not work with the print statements.

The new drivers are currently available at http://coldtears.lin3.siteonlinetest.com/files/Arduino_DUE_TFT_library.zip (http://coldtears.lin3.siteonlinetest.com/files/Arduino_DUE_TFT_library.zip).

These drivers should work with the mega and other compatible shields, but at this point since I do not have any other shields to test it on I cannot say for sure. If anyone contest these drivers on compatible shields please let us know if they work properly.

At least it's a step in the right direction. Being able to use the standard commands is a big plus.

promacjoe.
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on Apr 21, 2013, 11:28 pm
Note: I have now corrected the mirror issue in these drivers. I simply copied a set of parameters that I knew would display in the correct orientation  To the correct location in the " UTFT.cpp " file. In my case, the " SSD1963_800_CTE7 "section at line 2331. These parameters are for the 7" CTE display. So far everything displays and functions correctly.

In my case the parameters were obtained from a set of CTE drivers offered from " ageurtse ", a member of this form, thank you for your assistance.

I hope this will help someone else.

promacjoe
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on Apr 22, 2013, 03:49 pm
Joe,
thanks for this info. I need to finish a few modifications to my 5" & 7" boards (Font ICs..which Coldtears is sending me with my latest shipment). I have more interest in the 5" version than the 7".. However, I will still be interested in looking at the parameters you are all using in the CPP file for the CTE7. I'm also working with the 3.5 480X320 LCD as well. Daniel Hernandez and I, both here in Guaymas, Sonora, Mexico, are trying to get these LCDs to suit our needs.
Peter
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on Apr 23, 2013, 11:23 pm
Joe,
Could you share those updated parameters with us?  For the 7" CTE LCD?  I have that one, plus the 5".

I've noted even with the new drivers.... you still have to rotate the display 180deg. (in our case the entire DUE as we are using the CTE shield as well.... which means the power connector and usb connectors are on the wrong side of our enclosure.)
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on Apr 24, 2013, 01:42 am

I obtained the parameters from this post, " updated library UTFT version 2.1 with a CTE shield " at http://arduino.cc/forum/index.php/topic,158782.0.html (http://arduino.cc/forum/index.php/topic,158782.0.html).
Download the file given, and go to the " tft_drivers "directory. Then go down to the directory that matches the controller for your LCD, open the file that corresponds to your LCD resolution. Compare these parameters to the parameters in the "CTE UTFT" drivers. Change any parameters that do not match.

Note: I believe the 5" and 7" TFT LCDs use the same controllers and should use the same parameters.

There is also a discussion about these parameters under this post " FIXED: SSD1963 controller with 7" TFT (horizontally mirrored image) ". at  http://arduino.cc/forum/index.php?PHPSESSID=ff622bb36029623ad0f1cf6495b33aca&topic=152053.0 (http://arduino.cc/forum/index.php?PHPSESSID=ff622bb36029623ad0f1cf6495b33aca&topic=152053.0)

This is the best information I can give you. Since I am still learning "C" myself I can only pass on the information that I get. Fortunately others with better skills has posted really good information. And by the way thanks to those who have contributed their knowledge, it has really helped me.  Other than that you'll just have to do your homework just like I did.

promacjoe
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on Apr 27, 2013, 12:21 am
I'm happy with the results of these new drivers.  NO reversing of any kind of any objects (bitmaps, texts, simple primitives, etc...)
I've have tested in on the 5" 1963 based board (800X480). Performance seems decent too.
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 28, 2013, 01:07 pm
It's a shame they haven't updated them based on the latest set of files (in the latest set each display has it's own definitions file). Will be taking a look at this today....
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 28, 2013, 01:11 pm
Well it worked straight from the download.

Lets see if the SD card and touch bits work......

Then I need to start writing my GUI :)
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 28, 2013, 01:28 pm
With their own 7" TFT display, their own shield and their own software the display demo works perfectly but the touch screen demo isn't quite right....

So if you copy the following files into the latest CTE Due TFT library directory:

Utouch.cpp
Utouch.h
UtouchCD.h
Examples/CTE_TestTP_DUE

... and then you then copy Henning's calibration sketch into the examples directory and change the screen and pinouts to:

Code: [Select]
UTFT        myGLCD(CTE70);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(6,5,32,3,2);


The issue begins with the touch sensor being rotated by 180 degrees, so by subtracting the resolution off each we get a correctISH figure i.e....

Code: [Select]
 x = myTouch.getX();
 y = myTouch.getY();
 Serial1.print(x);
 Serial1.print(",");
 Serial1.println(y);
 String test_string = String(509-x)+" , "+String(264-y) + "                ";



Henning's screen in the calibration file is a ITDB02-3.2S so a lower resolution....

These are the figures he got:

Code: [Select]
#define CAL_X 0x03DE005DUL
#define CAL_Y 0x03B40106UL
#define CAL_S 0xF31FD108UL



Running Henning's calibration routine on my CTE70 gives these figures:

Code: [Select]
#define CAL_X 0x000b2911UL
#define CAL_Y 0x000b1a2cUL
#define CAL_S 0x8031f1dfUL



If I place those figures into the UTouchCD.h file the touch screen fails to work at all....

IF I then use a mixture of them i.e.

Code: [Select]
#define CAL_X 0x03DE005DUL
#define CAL_Y 0x03B40106UL
#define CAL_S 0xF31FD108UL

//Attempt at the CTE70
//#define CAL_X 0x000b2911UL
//#define CAL_Y 0x000b1a2cUL
#define CAL_S 0x8031f1dfUL



The resolution is correct although still reversed BUT it does not read past 765 of 800 in the X axis or 479 in the Y axis. (Although using the calibration sketch it read to the edge of the touch screen).
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 28, 2013, 03:35 pm
Ok I've modified the touch library to add functions:

setReverseX(boolean)
setReverseY(boolean)

Both of which DEFAULT to reversed......

Utouch.h

Code: [Select]
/*
 UTouch.h - Arduino/chipKit library support for Color TFT LCD Touch screens
 Copyright (C)2010-2012 Henning Karlsen. All right reserved
 
 Basic functionality of this library are based on the demo-code provided by
 ITead studio. You can find the latest version of the library at
 http://www.henningkarlsen.com/electronics

 If you make any modifications or improvements to the code, I would appreciate
 that you share the code with me so that I might include it in the next release.
 I can be contacted through http://www.henningkarlsen.com/electronics/contact.php

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

 This library 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
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef UTouch_h
#define UTouch_h

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

#define PORTRAIT 0
#define LANDSCAPE 1

#define PREC_LOW 1
#define PREC_MEDIUM 2
#define PREC_HI 3
#define PREC_EXTREME 4

class UTouch
{
public:
word TP_X ,TP_Y;

UTouch(byte tclk, byte tcs, byte tdin, byte dout, byte irq);

void InitTouch(byte orientation = LANDSCAPE);
void read();
bool dataAvailable();
int getX();
int getY();
void setPrecision(byte precision);
void setReverseX(boolean reversed);
void setReverseY(boolean reversed);
   
   private:
byte T_CLK, T_CS, T_DIN, T_DOUT, T_IRQ;
long _default_orientation;
byte orient;
byte prec;
byte display_model;
long disp_x_size, disp_y_size, default_orientation;
long touch_x_left, touch_x_right, touch_y_top, touch_y_bottom;

void touch_WriteData(byte data);
       word touch_ReadData();
bool _revTouchX;
bool _revTouchY;

};

#endif


Utouch.cpp

Code: [Select]
/*
 UTouch.cpp - Arduino/chipKit library support for Color TFT LCD Touch screens
 Copyright (C)2010-2012 Henning Karlsen. All right reserved
 
 Basic functionality of this library are based on the demo-code provided by
 ITead studio. You can find the latest version of the library at
 http://www.henningkarlsen.com/electronics

 If you make any modifications or improvements to the code, I would appreciate
 that you share the code with me so that I might include it in the next release.
 I can be contacted through http://www.henningkarlsen.com/electronics/contact.php

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

 This library 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
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include "UTouch.h"
#include "UTouchCD.h"

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;
}


void UTouch::InitTouch(byte orientation)
{
orient = orientation;
_default_orientation = CAL_S>>31;

touch_x_left = (CAL_X>>14) & 0x3FFF;
touch_x_right = CAL_X & 0x3FFF;

touch_y_top = (CAL_Y>>14) & 0x3FFF;
touch_y_bottom = CAL_Y & 0x3FFF;

disp_x_size = (CAL_S>>12) & 0x0FFF;
disp_y_size = CAL_S & 0x0FFF;

prec = 10;

_revTouchX = true;
_revTouchY = true;

pinMode(T_CLK,  OUTPUT);
   pinMode(T_CS,   OUTPUT);
   pinMode(T_DIN,  OUTPUT);
   pinMode(T_DOUT, INPUT);
   pinMode(T_IRQ,  OUTPUT);

digitalWrite(T_CS,  HIGH);
digitalWrite(T_CLK, HIGH);
digitalWrite(T_DIN, HIGH);
digitalWrite(T_CLK, HIGH);
}

void UTouch::touch_WriteData(byte data)
{
byte temp;
byte nop;

temp=data;
digitalWrite(T_CLK,LOW);

for(byte count=0; count<8; count++)
{
if(temp & 0x80)
digitalWrite(T_DIN, HIGH);
else
digitalWrite(T_DIN, LOW);
temp = temp << 1;
digitalWrite(T_CLK, LOW);                
nop++;
digitalWrite(T_CLK, HIGH);
nop++;
}
}

word UTouch::touch_ReadData()
{
byte nop;
word data = 0;
for(byte count=0; count<12; count++)
{
data <<= 1;
digitalWrite(T_CLK, HIGH);              
nop++;
digitalWrite(T_CLK, LOW);
nop++;
if (digitalRead(T_DOUT))
data++;
}
return(data);
}

void UTouch::read()
{
unsigned long tx=0, temp_x=0;
unsigned long ty=0, temp_y=0;
int datacount=0;

digitalWrite(T_CS,LOW);                    

for (int i=0; i<prec; i++)
{
touch_WriteData(0x90);        
digitalWrite(T_CLK,HIGH);
digitalWrite(T_CLK,LOW);
temp_x=touch_ReadData();

touch_WriteData(0xD0);      
digitalWrite(T_CLK,HIGH);
digitalWrite(T_CLK,LOW);
temp_y=touch_ReadData();

if (!((temp_x>max(touch_x_left, touch_x_right)) or (temp_x==0) or (temp_y>max(touch_y_top, touch_y_bottom)) or (temp_y==0)))
{
ty+=temp_x;
tx+=temp_y;
datacount++;
}
}

digitalWrite(T_CS,HIGH);
if (datacount>0)
{
if (orient == _default_orientation)
{
TP_X=tx/datacount;
TP_Y=ty/datacount;
}
else
{
TP_X=ty/datacount;
TP_Y=tx/datacount;
}
}
else
{
TP_X=-1;
TP_Y=-1;
}
}

bool UTouch::dataAvailable()
{
bool avail;
pinMode(T_IRQ,  INPUT);
avail = !digitalRead(T_IRQ);
pinMode(T_IRQ,  OUTPUT);
return avail;
}

int UTouch::getX()
{
long c;

if (orient == _default_orientation)
{
c = long(long(TP_X - touch_x_left) * (disp_x_size)) / long(touch_x_right - touch_x_left);
if (c<0)
c = 0;
if (c>disp_x_size)
c = disp_x_size;
}
else
{
if (_default_orientation == PORTRAIT)
c = long(long(TP_X - touch_y_top) * (-disp_y_size)) / long(touch_y_bottom - touch_y_top) + long(disp_y_size);
else
c = long(long(TP_X - touch_y_top) * (disp_y_size)) / long(touch_y_bottom - touch_y_top);
if (c<0)
c = 0;
if (c>disp_y_size)
c = disp_y_size;
}
   if (_revTouchX) c=disp_x_size-c;
   return c;
}

int UTouch::getY()
{
int c;

if (orient == _default_orientation)
{
c = long(long(TP_Y - touch_y_top) * (disp_y_size)) / long(touch_y_bottom - touch_y_top);
if (c<0)
c = 0;
if (c>disp_y_size)
c = disp_y_size;
}
else
{
if (_default_orientation == PORTRAIT)
c = long(long(TP_Y - touch_x_left) * (disp_x_size)) / long(touch_x_right - touch_x_left);
else
c = long(long(TP_Y - touch_x_left) * (-disp_x_size)) / long(touch_x_right - touch_x_left) + long(disp_x_size);
if (c<0)
c = 0;
if (c>disp_x_size)
c = disp_x_size;
}
if (_revTouchY) c=disp_y_size-c;
   return c;
}

void UTouch::setPrecision(byte precision)
{
switch (precision)
{
case PREC_LOW:
prec=1;
break;
case PREC_MEDIUM:
prec=10;
break;
case PREC_HI:
prec=25;
break;
case PREC_EXTREME:
prec=100;
break;
default:
prec=10;
break;
}
}

void UTouch::setReverseX(boolean reversed)
{
if (reversed)
{
   _revTouchX=true;
   }
   else
   {
   _revTouchX=false;
   }
}

void UTouch::setReverseY(boolean reversed)
{
if (reversed)
{
   _revTouchY=true;
   }
   else
   {
   _revTouchY=false;
   }
}

Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 28, 2013, 03:41 pm
Henning's button demo works straight out of the box with the modified library using the CTE70 screen, CTE shield and Due.

Code: [Select]
// UTouch_ButtonTest (C)2010-2012 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a quick demo of how create and use buttons.
//
// This program requires the UTFT library.
//
// It is assumed that the display module is connected to an
// appropriate shield or that you know how to change the pin
// numbers in the setup.
//

#include <UTFT.h>
#include <UTouch.h>

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

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

UTFT        myGLCD(CTE70);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(6,5,32,3,2);

int x, y;
char stCurrent[20]="";
int stCurrentLen=0;
char stLast[20]="";

/*************************
**   Custom functions   **
*************************/

void drawButtons()
{
// Draw the upper row of buttons
  for (x=0; x<5; x++)
  {
    myGLCD.setColor(0, 0, 255);
    myGLCD.fillRoundRect (10+(x*60), 10, 60+(x*60), 60);
    myGLCD.setColor(255, 255, 255);
    myGLCD.drawRoundRect (10+(x*60), 10, 60+(x*60), 60);
    myGLCD.printNumI(x+1, 27+(x*60), 27);
  }
// Draw the center row of buttons
  for (x=0; x<5; x++)
  {
    myGLCD.setColor(0, 0, 255);
    myGLCD.fillRoundRect (10+(x*60), 70, 60+(x*60), 120);
    myGLCD.setColor(255, 255, 255);
    myGLCD.drawRoundRect (10+(x*60), 70, 60+(x*60), 120);
    if (x<4)
      myGLCD.printNumI(x+6, 27+(x*60), 87);
  }
  myGLCD.print("0", 267, 87);
// Draw the lower row of buttons
  myGLCD.setColor(0, 0, 255);
  myGLCD.fillRoundRect (10, 130, 150, 180);
  myGLCD.setColor(255, 255, 255);
  myGLCD.drawRoundRect (10, 130, 150, 180);
  myGLCD.print("Clear", 40, 147);
  myGLCD.setColor(0, 0, 255);
  myGLCD.fillRoundRect (160, 130, 300, 180);
  myGLCD.setColor(255, 255, 255);
  myGLCD.drawRoundRect (160, 130, 300, 180);
  myGLCD.print("Enter", 190, 147);
  myGLCD.setBackColor (0, 0, 0);
}

void updateStr(int val)
{
  if (stCurrentLen<20)
  {
    stCurrent[stCurrentLen]=val;
    stCurrent[stCurrentLen+1]='\0';
    stCurrentLen++;
    myGLCD.setColor(0, 255, 0);
    myGLCD.print(stCurrent, LEFT, 224);
  }
  else
  {
    myGLCD.setColor(255, 0, 0);
    myGLCD.print("BUFFER FULL!", CENTER, 192);
    delay(500);
    myGLCD.print("            ", CENTER, 192);
    delay(500);
    myGLCD.print("BUFFER FULL!", CENTER, 192);
    delay(500);
    myGLCD.print("            ", CENTER, 192);
    myGLCD.setColor(0, 255, 0);
  }
}

// Draw a red frame while a button is touched
void waitForIt(int x1, int y1, int x2, int y2)
{
  myGLCD.setColor(255, 0, 0);
  myGLCD.drawRoundRect (x1, y1, x2, y2);
  while (myTouch.dataAvailable())
    myTouch.read();
  myGLCD.setColor(255, 255, 255);
  myGLCD.drawRoundRect (x1, y1, x2, y2);
}

/*************************
**  Required functions  **
*************************/

void setup()
{
// Initial setup
  myGLCD.InitLCD();
  myGLCD.clrScr();

//    myGLCD.Swtich_LCD_TB_Bit(1);
myTouch.InitTouch();
  myTouch.setPrecision(PREC_MEDIUM);

  myGLCD.setFont(BigFont);
  myGLCD.setBackColor(0, 0, 255);
  drawButtons(); 
}

void loop()
{
  while (true)
  {
    if (myTouch.dataAvailable())
    {
      myTouch.read();
      x=myTouch.getX();
      y=myTouch.getY();
     
      if ((y>=10) && (y<=60))  // Upper row
      {
        if ((x>=10) && (x<=60))  // Button: 1
        {
          waitForIt(10, 10, 60, 60);
          updateStr('1');
        }
        if ((x>=70) && (x<=120))  // Button: 2
        {
          waitForIt(70, 10, 120, 60);
          updateStr('2');
        }
        if ((x>=130) && (x<=180))  // Button: 3
        {
          waitForIt(130, 10, 180, 60);
          updateStr('3');
        }
        if ((x>=190) && (x<=240))  // Button: 4
        {
          waitForIt(190, 10, 240, 60);
          updateStr('4');
        }
        if ((x>=250) && (x<=300))  // Button: 5
        {
          waitForIt(250, 10, 300, 60);
          updateStr('5');
        }
      }

      if ((y>=70) && (y<=120))  // Center row
      {
        if ((x>=10) && (x<=60))  // Button: 6
        {
          waitForIt(10, 70, 60, 120);
          updateStr('6');
        }
        if ((x>=70) && (x<=120))  // Button: 7
        {
          waitForIt(70, 70, 120, 120);
          updateStr('7');
        }
        if ((x>=130) && (x<=180))  // Button: 8
        {
          waitForIt(130, 70, 180, 120);
          updateStr('8');
        }
        if ((x>=190) && (x<=240))  // Button: 9
        {
          waitForIt(190, 70, 240, 120);
          updateStr('9');
        }
        if ((x>=250) && (x<=300))  // Button: 0
        {
          waitForIt(250, 70, 300, 120);
          updateStr('0');
        }
      }

      if ((y>=130) && (y<=180))  // Upper row
      {
        if ((x>=10) && (x<=150))  // Button: Clear
        {
          waitForIt(10, 130, 150, 180);
          stCurrent[0]='\0';
          stCurrentLen=0;
          myGLCD.setColor(0, 0, 0);
          myGLCD.fillRect(0, 224, 319, 239);
        }
        if ((x>=160) && (x<=300))  // Button: Enter
        {
          waitForIt(160, 130, 300, 180);
          if (stCurrentLen>0)
          {
            for (x=0; x<stCurrentLen+1; x++)
            {
              stLast[x]=stCurrent[x];
            }
            stCurrent[0]='\0';
            stCurrentLen=0;
            myGLCD.setColor(0, 0, 0);
            myGLCD.fillRect(0, 208, 319, 239);
            myGLCD.setColor(0, 255, 0);
            myGLCD.print(stLast, LEFT, 208);
          }
          else
          {
            myGLCD.setColor(255, 0, 0);
            myGLCD.print("BUFFER EMPTY", CENTER, 192);
            delay(500);
            myGLCD.print("            ", CENTER, 192);
            delay(500);
            myGLCD.print("BUFFER EMPTY", CENTER, 192);
            delay(500);
            myGLCD.print("            ", CENTER, 192);
            myGLCD.setColor(0, 255, 0);
          }
        }
      }
    }
  }
}
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on Apr 29, 2013, 12:49 am
Actually,
with my display, I noted something completely different...

when I used the get(x) function it was returning the y..

So I just flipped the asssignments..
Then I scale the 509X264 to match 800X480... sure makes figuring out which object was touched much easier.
NO problem with the SD either, as I was able to upload a custom 800X480 image.

I'm much happier with this.... with the other libraries... the smaller y axis had 509 points of resolution... where as the larger x axis only had 264... It's much better now...and by applying a scaling factor, you are always working in the same units.
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 29, 2013, 12:51 am

Actually,
with my display, I noted something completely different...

when I used the get(x) function it was returning the y..

So I just flipped the asssignments..
Then I scale the 509X264 to match 800X480... sure makes figuring out which object was touched much easier.
NO problem with the SD either, as I was able to upload a custom 800X480 image.

I'm much happier with this.... with the other libraries... the smaller y axis had 509 points of resolution... where as the larger x axis only had 264... It's much better now...and by applying a scaling factor, you are always working in the same units.


The 509x264 is fixed by the last line of the CD file.
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on Apr 29, 2013, 01:09 am
You know..the last thing I want to do is modify libraries when I buy something. 

I simply want to work on my own projects and prototypes..and just have the stuff I BUY....well... WORK as advertised.

You are correct though...everything from ColdTears comes rotated 180 degF.  That still persists.

So, with your modifications everything works...and is rotated correctly? Touch and Display? If so, have you thought about feeding those changes back to ColdTearsElectronics?
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 29, 2013, 01:27 am

You know..the last thing I want to do is modify libraries when I buy something. 

I simply want to work on my own projects and prototypes..and just have the stuff I BUY....well... WORK as advertised.

You are correct though...everything from ColdTears comes rotated 180 degF.  That still persists.

So, with your modifications everything works...and is rotated correctly? Touch and Display? If so, have you thought about feeding those changes back to ColdTearsElectronics?


Yes I had thought about it.  I'm just working on something at the moment and will then pass it back.  What would be better for me is to get all the pin outs and pass everything back to Henning so it can be added to the genuine library and work from there.

I'm working on a GUI library which will work with the other 3 libraries (UTFT, UTouch and SD card).  I'm working on normal buttons, radio buttons/groups, check boxs, pop up numeric/hex & alpha keyboards, pop-up message boxes etc.  Biggest problem I have though is working out how to implement it into the IDE properly.  PaulS has been giving me some help as I didn't know how to use one library from another.  I think we are nearly there with that so it will be a case of implementing all the goodies then.
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on Apr 29, 2013, 04:06 am
What really bugs me about their drivers, is that their demo shows it in the correct orientation. They either mirrored everything after the demo was made, or corrected the drivers for the demo but never applied the corrections to the drivers they offer us.

They seem to have decent product, but they are getting a bad reputation with their drivers. Not asking for drivers that make it work like an iPad, just basic functionality that we can use in our programs. And if you're going to use someone else's drivers for your hardware, don't render their functions unusable. Is that too much to ask.

promacjoe
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on Apr 30, 2013, 09:01 pm
Well I've been very busy!

I wanted to write a library to create all the GUI objects such as buttons, panels, radio sets, check boxes, pop up keyboards, etc etc but could I work out how to access the UTFT and UTouch libraries from my own library?......  No I couldn't.

So....

I have merged the CTE Touch & TFT libraries into ONE single library and complete with the modifications and now I am adding my GUI library into the same library...


Current position:

Both libraries merged and working using my CTE 7" display....


Adds functions:

setReverseY(boolean reversed);
setReverseX(boolean reversed);
addButton(....)
drawButton(....)
drawButton_pressed(....)
checkButton(....)


I have already written the following functions and need to incorporate them:

preserveColours()
restoreColours()
numberPad(...)     {pop up numeric keyboard with optional decimal point button)
addPanel(...)
checkAllButtons()
clearButtons()

(all buttons/panels/keyboards are user adjustable for colour, border colour, pressed colour, border size, font etc)
eg.  addButton(int buttonnumber,word x,word y,word xs,word ys,long colour,long borcolour,long textcolour,long presscolour,long presstextcolour,byte borwidth,String top,int xo,int yo,int font)

Plus I have made several private variables and functions public as they are useful.


To do list:

Incorporate my already written functions
Add checkboxs
Add radio boxes and radio groups
Add input boxes
Add alphabetical keyboard
Add hex keyboard
Add thermometer bar
Add rev counter display
Add calibrate function        {so users can calibrate the display themselves}
Make my re-written TP_X to x / TP_Y to y functions work with the current screen orientation.

PLUS

Other things that people might point out as useful.....
Once all the above is done I'm looking at adding mouse/keyboard support with mouse pointers etc but I haven't looked at that at all yet.

I'm also having major problems with my Tajuino board which gets VERY hot and sometimes takes 5 or 6 attempts at uploading etc.
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on May 01, 2013, 12:57 am
We now have in our possession 3 of the 5" CTE 800X480 displays.  The first one was the one accidently purchased without a Font IC.

Cold Tears sent me an IC for it. I installed it... Meh.... doesn't work.  Still can't use fonts or load bitmaps.

We also noticed the two most recent 5" screens we received have their connector located on the exact opposite side of the LCD screen.  Strange.

Furthermore, the last two CTE DUE shields we purchased are version 1.03, as opposed to version 1.02.

We will try the 7" models next.
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on May 01, 2013, 03:49 am
" I'm also having major problems with my Tajuino board which gets VERY hot and sometimes takes 5 or 6 attempts at uploading etc. "

I have also noticed that the 3.3 V regulator gets very hot on my Arduino due. I think the 7 inch display draws too much power for the due to realistically handle on a long-term basis. I'm not sure if a heatsink would correct the problem, So I plan to isolate the 3.3 V regulated output from the due and connect it to an external regulated power supply.  3A regulated Power supplies are cheap, and should eliminate the heat problem.

promacjoe
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 01, 2013, 03:59 am

" I'm also having major problems with my Tajuino board which gets VERY hot and sometimes takes 5 or 6 attempts at uploading etc. "

I have also noticed that the 3.3 V regulator gets very hot on my Arduino due. I think the 7 inch display draws too much power for the due to realistically handle on a long-term basis. I'm not sure if a heatsink would correct the problem, So I plan to isolate the 3.3 V regulated output from the due and connect it to an external regulated power supply.  3A regulated Power supplies are cheap, and should eliminate the heat problem.

promacjoe


So long as the rest of the board can handle it. Let us know how it goes as I was looking at doing something similar myself. What is the regulator on board rated at, just 500mA. We should be able to replace it with one rated at 1A and drive it from a lead attached to two USB ports.
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on May 01, 2013, 07:26 am
According to the schematic, the Arduino due uses a NPC1117ST33T3G 3.3V regulator. According to the datasheet, this regulator is rated at 1A. since it is a linear regulator it generates a lot of heat, so replacing this regulator would not do much good.

My thought was to replace the power supply header on the adapter board with one that is extra long and bent to provide a place for external connectors. By snipping off the 3.3V pen that would plug into the Arduino due board, you would isolate the power going to the display. Now it can be connected to an external PWM power supply adjusted to 3.3 V. This type regulator does not get as hot and can produce a very stable voltage. And since you replaced the entire power header, you get access to the VIN,GND, master reset, 3.3V  "IOREF PIN low current" and 5V power from the Arduino due as well.

This should eliminate the heat problem caused by pulling too much current from the due board.

promacjoe
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 01, 2013, 07:38 am

According to the schematic, the Arduino due uses a NPC1117ST33T3G 3.3V regulator. According to the datasheet, this regulator is rated at 1A. since it is a linear regulator it generates a lot of heat, so replacing this regulator would not do much good.

My thought was to replace the power supply header on the adapter board with one that is extra long and bent to provide a place for external connectors. By snipping off the 3.3V pen that would plug into the Arduino due board, you would isolate the power going to the display. Now it can be connected to an external PWM power supply adjusted to 3.3 V. This type regulator does not get as hot and can produce a very stable voltage. And since you replaced the entire power header, you get access to the VIN,GND, master reset, 3.3V  "IOREF PIN low current" and 5V power from the Arduino due as well.

This should eliminate the heat problem caused by pulling too much current from the due board.

promacjoe


I hadn't thought about it to that extent yet but it's the back light that is drawing most of the current so with that in mind I was going to simply use the existing back light power connection to driver a transistor to switch a separate power supply to the back light from a second USB socket.
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 01, 2013, 03:06 pm
In fact forget what I said....

If you look at the CTE shield jumpers 3,4 & 5 control the connection to LEDA+.  The default for these jumpers in JP3 & JP5 disconnected and JP4 connected.  If you desolder JP4 then the shield no longer connects to the LEDA+ pin.

Now look at the LCD and the pin next to LEDA+ is labelled 5v.....  This is a 5v connection to the backlight.  Just connect your 5v supply to this pin through a current limiting resistor which limits the current to 620mA.

This will supply all the power to the backlight from the alternative supply leaving the Due to simply power the rest of the circuitry which appears to be 100mA

Simples.....
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on May 01, 2013, 11:59 pm
That would be a good way of doing it, but my project, a (DRO), is a standalone unit with maybe a USB host set up. I'm not planning on using the USB to power my project. I have a 9 V 3A power supply which will be more than enough power. I also need 1.5V, 3.3V, 5V, 9V power to be available if  needed, external of the Arduino. I won't be pulling much current, and some voltage may not be needed for some applications. I would also like a external reset switch to be available.

promacjoe
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 02, 2013, 01:25 am
There is another error in their documentation....

After lots of messing TP Data IN goes to pin 32 and also pin 4 but only if link 10 is soldered !!  So basically it only actually goes to pin 32 normally.
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on May 02, 2013, 02:19 am
That answers a question that I asked in another post. The schematic shows one thing, but the documents show something else. Their documentation is kind of vague and sporadic. Thankfully there are people in this group that has experimented enough and is willing to post the results. Thank you for that tidbit it will be very helpful to me and hopefully to others. Maybe someone will sort through all of this information and write a good tutorial.

every little bit helps.

promacjoe
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 02, 2013, 09:54 am
I plan on doing just that shortly.  I made a cable yesterday which replaces the CTE shield...

Basically take one old 40 pin IDE cable, cut it down to 8 inches and then crimp on 2 x 8 ways headers, 1 x 1 way header, 1 x icsp header and 2 x 16 way headers.....  The 1x1 way header provides the 5v for the backlight bypassing the Due board and avoiding drawing too much current.  I've tested touch, flash, screen and SD card functionality and they all work. The advantage of this method is that you get an understanding of exactly what you are connecting and to where plus you can still get at everything else.  It very much helps if you are planning to build your own shields (I have also created an Eagle CAD device of the DUE which I've posted on here and will include in my "everything you wanted to know about getting the TFT to work thread later")

I've also merged ALL the relevant libraries bar the SD library (which I will be doing over the next couple of days) into one library with one folder.

So it should be an easy matter of making the lead (or buying a shield) and then using the ONE folder.

I have added functions for reversing the screen and touch panel plus moving several variables into the public area and am currently adding commands for a GUI I think I should call it DUEGUI :-)

Merging all these libraries together means that I can add a single command to load a screen from SD and display it, call a calibration setup screen and save the details to SD card or flash, create pop ups and all manner of other useful stuff whilst having as little as possible in the actual sketch.

All my hardware findings will appear in the next few days with an alpha test version of the combined library (it will have the current functionality of the separate libraries all in one plus a selection of the functions I have mentioned).
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on May 02, 2013, 11:54 pm
Cowaski,
you are doing awesome work.

I noted yesterday (May 1st) that Henning Karlsen updated his UTFT libraries to include the Elec Freaks Models: TFT01-5.0 & TFT01-7.0, which appears to be identical to Cold Tears 5" & 7" LCDs, but perhaps missing the IC Font chips.

I'll run some tests on these libraries..
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 03, 2013, 12:35 am
It would be nice to use Henning's library as the basis for the complete library.  CTE have however added a number of quite useful additions as well so I'll have a look but it might be a case of keeping the older one.  I'll see what is involved in adding the extra commands to the straight library then adding touch, sd and my GUI.
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 03, 2013, 01:05 am
I've just downloaded it and tried it and I get no output with either:

UTFT myGLCD(SSD1963_800,25,26,27,28);

or

UTFT myGLCD(SSD1963_800ALT,25,26,27,28);

Maybe I need to insert the CTE70 init code again.  I gave Henning the code but he wasn't too happy about inserting it as he hadn't tested it
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 03, 2013, 11:24 am
Hmmm....

I might have some interesting news coming shortly :D
Title: Re: Announcement: CTE has updated their drivers.
Post by: cowasaki on May 03, 2013, 07:36 pm
Well, I've spoken to CTE about the power issue AND the missing labels from the Schematic which are now history!  Version 1.04 of the shield will now include a 5v input switched by the current input so therefore it will be software compatible BUT will not draw too much power from the Due.  It really does look like they are wanting to get everything right for their customers.
Title: Re: Announcement: CTE has updated their drivers.
Post by: ODwyerPW on May 04, 2013, 12:53 am
Cool beans.
Title: Re: Announcement: CTE has updated their drivers.
Post by: geniom on Sep 21, 2013, 10:27 pm
@cowasaki
have you find the correct string for the touch?
i have the same tft display with font-ic and same cte shied but with MEGA and the touch not work, the coordinates are 800 or similar in all position.
i have the sd inserted in the slot on tft, i don't have tried without sd.
but the touch not work, the tft and the sd work perfectly.
i use the utouch not modified, if i must use the modification of this i don't know what is the modification.

thanks
Title: Re: Announcement: CTE has updated their drivers.
Post by: gloffreda on Nov 03, 2013, 07:27 pm
Hello all,

Just looked this topic and saw something about the jumpers for LEDA+.
I'm using CTE 70 and DUE and i'm trying to use the PWM to control de LCD LED.

In the shield, this is marked:
JP5 - PWM (9)

Which made think that pin 9 would be the PWM control for the LED, but the PIN 9 isn't even connected to the shield.  :0
Took the datasheet and saw PIN7 as PWM, tried to open the JP4 and soldered JP5.
analogWrite(7, 255);
Just for fun tried with all PWM pins from 0 to 7.
The LCD LED doesn't light up.

Can anybody help me ?

Thank you
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on Nov 04, 2013, 03:23 am
If I read the schematic right, jumper 3, 4 and 5 Are all connected to the same pin on the display.
JP3 Is connected to 5V.
JP4 Is connected to 3.3V. " Default ".
JP5 is connected to the PWM. " CN4, Pen7 ".

Only one jumper can be used at a time. All other jumpers must be disconnected.

Note: 3.3 V should turn on the LCD backlight. If it does not come on you may have something wrong with your display/Adapter board.

Hope this helps.

promacjoe.

Title: Re: Announcement: CTE has updated their drivers.
Post by: gloffreda on Nov 04, 2013, 05:12 pm
Hi promacjoe,

Thank you for your reply.
I read the schematic exactly as you described.
If JP4 is set, I have the LED on at 100%, full 3.3V.

So I've desoldered JP4 and soldered JP5 to use PWM.
In my test code I just used analogWrite(7, 100); on setup section and it doesn't turn the LED on.

Am I doing something wrong ?

Thank you,

Giulio
Title: Re: Announcement: CTE has updated their drivers.
Post by: promacjoe on Nov 05, 2013, 03:00 am
Unfortunately I have not used the PWM function for that display. My best suggestion is to make sure your software/hardware is functioning correctly. Connected either to an oscilloscope to see what your output is or connect a small LED with a current drop resister and see if you can very the output.
If you set the PWM for 100%,  the display backlight should come on. That is if your circuit is functioning properly. My only other thought is that the due does not put out enough current to adequately drive that circuit. It may need some kind of buffer, such as a logic level converter to drive it properly.

I hope this helps.

promacjoe.