Pages: [1] 2 3   Go Down
Author Topic: [no longer relevant] Touch using CTE shield on DUE etc  (Read 9173 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, now that I have got the 7" TFT working I'm trying to get the touch screen working....

I've installed Henning's Utouch library [http://www.henningkarlsen.com/electronics/library.php?id=55] and now I'm trying to see if I can get it to work.

Strangly when I run the Utouch demo the display reverses again!  ie it works backwards from the UTFT demo but anyway I'll look at that later, for now I can reverse the screen at will so it's not an issue.

The Utouch demo starts off initialising the screen etc so I've copied those bits from UTFT and the display works complete with buttons.

The touch option does nothing, here is the init line for touch:

UTouch myTouch(6,5,4,3,2);

The parameters are:

TCLK, TCS, TDIN, TDOUT, IRQ

so

TCLK=6
TCS=5
TDIN=4
TDOUT=3
IRQ=2

Looking at the DUE pin out sheet and the CTE shield it would appear that it is connected like this for the 32 pin TFT:


TCLK = CLK on the ICSP header = Digital pin 76
TCS = 31 on the header which according to the shield circuit diagram should be = Digital pin 5
TDIN  = miso on the ICSP header = Digital pin 74
TDOUT = mosi on the ICSP header = Digital pin 75
IRQ = 26 on the header which according to the shield circuit diagram should be = Digital pin 2


So this would make it:

UTouch      myTouch(76,5,74,75,2);

Now I ran it for the first time and the calibration program changed screen when I pressed it first time so I thought it was all working but I couldn't calibrate the screen nor would it do anything else.  After re-running the program over and over touch does not work at all.  Not sure why the screen changed first time but it isn't working now.

I am going to carry on working on it (as I did with UTFT) but if anyone has any input or has already got this working it would be appreciated.

Also has anyone any idea if any libraries work with the SD card slot on the CTE board using a DUE or better still the micro SD card slot on the TFT.


Cheers.
« Last Edit: May 23, 2013, 09:18:38 am by cowasaki » Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can't get the SD card to read either......

Re SD card there doesn't appear to be anywhere to change the SD SPI pin.  On the CTE shield it states that this is 53 if jumper 8 is set but doesn't say what it is if it is not set.  Again will look into this.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That link must be N/C if not made.  I've just put an SD card into the card slot on the LCD and it reads it....
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just touch to get working now smiley-grin
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, got touch working now too smiley-grin

UTouch      myTouch(6,52,4,3,2);
Logged

Alamos, Sonora, Mexico
Offline Offline
Full Member
***
Karma: 5
Posts: 141
learning never stops.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Good Stuff!!  I have the 7" working with the same shield too, but I haven't tried the touch stuff. I'll tackle that now. I'm looking forward to using this Shield with the 5" version of this TFT (same controller, same 800X480 res). It's that the 5" version is a bit more enclosure friendly than the 7".

Peter
Logged

Quiero una vida simple en Mexico...nada mas.

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope, it appears it should be:

UTouch      myTouch(6,5,4,3,2);  after all but.....

When you touch the screen data becomes available so "touch the screen to continue" works but......

It always returns 509,264 as x,y
Logged

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

Hi Cowasaki,

since there have been reports of problems regarding SD incompatibility with some shields, which SD card have you successfully used with the CTE shield?

Thanks,
dodgerts
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It wasn't in the CTE shield it was in the back of the LCD.  It was a 2Gb Sandisc micro SD.


I don't think that the CTE shield is quite right for the touch part of the wiring somehow.....  It works for the TFT (so long as I use CTE's modified UTFT library) and the micro SD card works but their touch software is rubbish and doesn't work.  If I use henning's software I just get a detection that the screen has been touched but it always returns the same values....
Logged

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

I am attempting to run this code.  I want to load a small bitmap called sonora.bmp from the SDCard on the 7" screen and the ColdTears shield.  But I get an error (it's below the code)

Code:
#include "SPI.h"
#include <UTFT.h>
#define FLASH_CS_PIN 52
#define SPI_RATE 4
#define BVS_13 10
#define BVS_15 12
#define BVS_19 14
#define BVS_22 18
#define BVS_28 22
#define BVS_34 28
#define BVS_43 38
#define BVS_52 53
#define BVS_74 78
#define BVS_112 122

extern uint8_t BigFont[];

UTFT myGLCD(CTE70);

void setup()
{
  delay(1000);
  myGLCD.SPI_Flash_init(FLASH_CS_PIN,SPI_RATE);
  Serial1.begin(38400);
  myGLCD.InitLCD();
  myGLCD.setFont(BigFont);
}


void loop()
{
  myGLCD.clrScr();
  myGLCD.Swtich_LCD_TB_Bit(0);
  myGLCD.print("Sonora Technical",CENTER,75);
  myGLCD.drawRect(300,140,500,340);
  myGLCD.drawCircle(600,350,80);
  myGLCD.Load_image(0,0,"Sonora");
  while (true) {};   
}


C:\Projects\ArduinoProjects\Arduinos\arduino152/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=152 -D__SAM3X8E__ -mthumb -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\system/libsam -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\system/CMSIS/CMSIS/Include/ -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\system/CMSIS/Device/ATMEL/ -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\cores\arduino -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\variants\arduino_due_x -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\libraries\SPI -IC:\Projects\ArduinoProjects\Arduinos\arduino152\libraries\UTFT_DUE C:\Users\HERNAN~1\AppData\Local\Temp\build8677726899341832836.tmp\CTE_70inch_800x480CircRect.cpp -o C:\Users\HERNAN~1\AppData\Local\Temp\build8677726899341832836.tmp\CTE_70inch_800x480CircRect.cpp.o
CTE_70inch_800x480CircRect.ino: In function 'void loop()':
CTE_70inch_800x480CircRect:37: error: invalid conversion from 'const char*' to 'int'
CTE_70inch_800x480CircRect:37: error: initializing argument 3 of 'void UTFT::Load_image(int, int, int)'
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am attempting to run this code.  I want to load a small bitmap called sonora.bmp from the SDCard on the 7" screen and the ColdTears shield.  But I get an error (it's below the code)


The error is in the Load_Image function call.  Have you checked what is required of this call?  Also you might need to add .bmp - I've not used it myself.
Logged

Alamos, Sonora, Mexico
Offline Offline
Full Member
***
Karma: 5
Posts: 141
learning never stops.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Daniel,
Bear in mind load_image is not actually loading anything from the SD chip.... Rather it is loading it from the 1963 LCD Flash.... It is stored in the LCD Flash by location...(hence the requirement for the function call to be fed 3 integer values, x, y, location id).
There is another sample sketch that tells you how to load/import a file from the SD chip into the LCD Flash....
None of it is as pretty as we'd like...but it's there.

Here's the benefit... If you can Import all of the images into the LCD Flash...then you no longer need to 'mount your file system...aka SD card' in your sketches. Therefore, that spares you loading some headers and doing extra defines that you won't use. Downside is..if the LCD goes bad...you will have to reimport all of the fotos...in other words, run the import sketch again.

Looks like cold tears even offers a windows based utility as one of the steps in the process...
I'll go through the process myself...as I have the same equipment. ;p
Peter
Logged

Quiero una vida simple en Mexico...nada mas.

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

Thanks! Yes I'm trying to run that scketch that tells me how to load an image into my LCD Flash memory but it's still doing nothing..

I followed step by step of Image Importer Guide proccess and still nothing...

smiley-sad heh
Logged

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

hi cowasaki,

bear in mind that the tft you using is a 32 pin version, which means that the touch controller is direct connected to the spi bus and share with the sd card. if you look at the touch library, it is written for the 40pin version, of which the touch controller is not connected to the spi bus. thats why you cannot get the touch working.


It wasn't in the CTE shield it was in the back of the LCD.  It was a 2Gb Sandisc micro SD.


I don't think that the CTE shield is quite right for the touch part of the wiring somehow.....  It works for the TFT (so long as I use CTE's modified UTFT library) and the micro SD card works but their touch software is rubbish and doesn't work.  If I use henning's software I just get a detection that the screen has been touched but it always returns the same values....
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi cowasaki,

bear in mind that the tft you using is a 32 pin version, which means that the touch controller is direct connected to the spi bus and share with the sd card. if you look at the touch library, it is written for the 40pin version, of which the touch controller is not connected to the spi bus. thats why you cannot get the touch working.


It wasn't in the CTE shield it was in the back of the LCD.  It was a 2Gb Sandisc micro SD.


I don't think that the CTE shield is quite right for the touch part of the wiring somehow.....  It works for the TFT (so long as I use CTE's modified UTFT library) and the micro SD card works but their touch software is rubbish and doesn't work.  If I use henning's software I just get a detection that the screen has been touched but it always returns the same values....

The CTE shield has both a 32 and 40 pin connection, is there not a way to get the touch to work on the 32 pin connection ??
Logged

Pages: [1] 2 3   Go Up
Jump to: